Archive | Programming RSS feed for this section

Create A Text Field FlashMX 102


for (i =0;i<10;i++){
this.createTextField("textHolder"+i, i, 120+(i*20),120+(i*20),100,19);
this["textHolder"+i].text = "hello Helmut " + i;
}

TextFields 101 FlashMX


this.createTextField("textHolder", 1, 120,120,100,19);
this.textHolder.text = "hello Helmut";

Push an Array Flash MX


Me = new Array("Helmut");
FullName = Me.push("Granda");
trace("FullName: " + Me[0] + " " + Me[1]);

Multy Dimensional Arrays 101 Flash MX


Name = new Array ()
Name.First = new Array ("Helmut","Flash");
Name.Last = new Array ("Granda","MX");

trace ("FIrst Name: " +Name.First[0]);
trace ("Last Name: " + Name.Last[0]);
trace("Full Name: " + Name.First[0] + " " + Name.Last[0]);
trace ("FIrst Name: " +Name.First[1]);
trace ("Last Name: " + Name.Last[1]);
trace("Full Name: " + Name.First[1] + " " + Name.Last[1]);

Arrays in Flash MX


Name = new Array ("Helmut", "Granda");
trace ("FIrst Name: " +Name[0]);
trace ("Last Name: " + Name[1]);
trace("Full Name: " + Name[0] + " " + Name[1]);

Send Playhead to a Random Frame


randomFrame = random(50+1);
gotoAndStop(randomFrame);
trace(this._currentFrame);

Open a PDF file from Flash


//open in a new window
getURL("http://www.mywebsite.com/mypdf.pdf","_blank");

//open in the same window
getURL("http://www.mywebsite.com/mypdf.pdf","_top");

//open in a frame
getURL("http://www.mywebsite.com/mypdf.pdf","_frameName");

Creating a Function 101 Basic function


//declare your function and function name:
traceFunction = function(parameterPassed){
//what do you want the function to do?
trace(parameterPassed);
//end your function
};

//Lets make it work
traceFunction("Hello Earth")

Random Number Specifying Variable


//random(#)

randomLimit = 60

myRandomNumber = random(randomLimit);

trace(myRandomNumber)

Get a Random Number


//random(#)

myRandomNumber = random(60);
trace(myRandomNumber)