Study Guides (390,000)
CA (150,000)
SFU (5,000)
IAT (80)
IAT 167 (20)
Final

IAT167-Arrays Example.docx


Department
Interactive Arts & Tech
Course Code
IAT 167
Professor
Jack Stockholm
Study Guide
Final

This preview shows half of the first page. to view the full 1 pages of the document.
package
{
import flash.display.Sprite;
import flash.events.Event;
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);
// entry point
var myArray:Array = new Array();
myArray [0] = "January";
myArray [1] = "February";
myArray [2] = "March";
myArray [3] = "April";
trace(myArray[2]);
for (var i:int = 0; i < myArray.length; i++)
{
myArray[i] = Math.round(Math.random() *10);
trace(myArray[i]);
}
}
}
You're Reading a Preview

Unlock to view full version