IAT167-Hello World Example.docx

36 views1 pages
package
{
import flash.display.Shape;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.TextEvent;
import flash.geom.Rectangle;
import flash.text.TextField;
import flash.display.MovieClip;
public class Main extends Sprite
{
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
var myNumber:Number = 792;
var myMessage:TextField = new TextField;
myMessage.text = "I hate coding ActionScript";
var myShape:Shape = new Shape();
myShape.graphics.lineStyle(10, 0x0000FF, 1);
myShape.x = 100;
myShape.y = 100;
myShape.graphics.drawCircle(100, 100, 50);
trace("Hello World!");
trace(myNumber);
myNumber = myNumber + 11;
trace("My number is " + myNumber);
myMessage.x = 250;
myMessage.scaleX = 1.5;
myMessage.textColor = 0xCCCCCC;
stage.addChild(myMessage);
stage.addChild(myShape);
}
}
}
Unlock document

This preview shows half of the first page of the document.
Unlock all 1 pages and 3 million more documents.

Already have an account? Log in

Get OneClass Grade+

Unlimited access to all notes and study guides.

Grade+All Inclusive
$10 USD/m
You will be charged $120 USD upfront and auto renewed at the end of each cycle. You may cancel anytime under Payment Settings. For more information, see our Terms and Privacy.
Payments are encrypted using 256-bit SSL. Powered by Stripe.