Home » Corona »

API Comparison: Adobe Flash and Corona SDK

Are you a Flash developer? This comparison chart is for you! This chart compares some major differences between the Adobe Flash API and Corona SDK API.

In this comparison: loading images, displaying text, masking, tweening, audio, video, sprite sheets, physics, and analytics.

More info about Flash and Corona SDK pt-m

Flash-Corona-Comparison-Image

Loading Images

ActionScript Corona SDK
var myLoader:Loader = new Loader(); var fileRequest:URLRequest = new URLRequest("image.png"); myLoader.load(fileRequest); addChild(myLoader); local myImage = display.newImage( "image.png" );

Displaying Text

ActionScript Corona SDK
var myText:TextField = new TextField(); myText.x = 0; myText.y = 0; var format:TextFormat = new TextFormat(); format.font = "Helvetica"; format.color = 0x0000FF; format.size = 16; myText.defaultTextFormat = format; myText.text = "Hello World"; addChild(myText); local myText = display.newText( "Hello World", 0, 0, "Helvetica", 16 ) myText:setTextColor(0, 0, 255)

Masking

ActionScript Corona SDK
var imageLoader:Loader = new Loader(); var fileRequest:URLRequest = new URLRequest("myImage.png"); imageLoader.load(fileRequest); addChild(imageLoader); var maskLoader:Loader = new Loader(); fileRequest = new URLRequest("myMask.png"); maskLoader.load(fileRequest); addChild(maskLoader); imageLoader.mask = maskLoader; local myImage = display.newImage( "image.png" ) local myMask = graphics.newMask( "mask.png" ) myImage:setMask( myMask )

Tweening

ActionScript Corona SDK
var myTween:Tween = new Tween(myObject, "x", None.easeNone, 0, 300, 3, true); myObject.x = 0 transition.to(myObject, { time=3000, x=300, transition=easing.linear})

Audio

ActionScript Corona SDK
var mySound:Sound = new Sound(); var soundRequest:URLRequest = new URLRequest("mySound.mp3"); mySound.load(soundRequest); mySound.play(); mySound = audio.loadSound("mySound.,mp3") audio.play(mySound)

Video

ActionScript Corona SDK
var connection:NetConnection; function VideoExample() { connection = new NetConnection(); connection.addEventListener( NetStatusEvent.NET_STATUS, netStatusHandler); connection.connect(null); } function netStatusHandler(event:NetStatusEvent):void { if(event.info.code == "NetConnection.Connect.Success"){ var stream:NetStream = new NetStream(connection); var video:Video = new Video(); video.attachNetStream(stream); stream.play("myVideo.mp4"); addChild(video); } } media.playVideo( "myMovie.mp4", true)

Sprite Sheet

ActionScript Corona SDK
Not supported out of the box spriteSheet = sprite.newSpriteSheet("sprites.png", 100, 100) spriteSheet.play()

Physics

ActionScript Corona SDK
Not supported out of the box (Requires manual Box2d integration) local physics = require( "physics" ) physics.start() local ground = display.newImage( "ground.png" ) ground.x = 160; ground.y = 445 physics.addBody( ground, "static", { friction=0.5, bounce=0.3 } ) local crate = display.newImage( "crate.png" ) crate.x = 180; crate.y = -50; crate.rotation = 5 physics.addBody( crate, { density=3.0, friction=0.5, bounce=0.3 } )

Analytics

ActionScript Corona SDK
Not supported out of the box local analytics = require("analytics") analytics.init("1234567890ABCDEFG") analytics.logEvent("Game Event")



Ready to get started?

Create amazing games and apps for iOS & Android