|
Selteco.com > Alligator Flash Designer > FlashDesignerZone.com > Documentation > ActionScript
ActionScriptFrame ScriptFrame ActionScript is executed when the frame is about to appear. To define the script choose "Frame" > "ActionScript" command and enter the script in the dialog.
Button ScriptsActionScript can be executed on button events (OnClick, OnUp, OnOver, OnOut etc). To define an event script select the item and choose "Action" and "On Click", "On Out", "On Over", "On Up" commands. Select "ActionScript" option and enter the script.
To create edit fieldsUse edit fields to allow interaction between the user and the movie. To draw an edit choose the tool and draw it on the frame.
The field will appear as "Edit1", "Edit2" etc.
To test the ActionScriptDraw an edit field that will appear as "Edit1" (or Edit2 etc). Choose "Frame" > "ActionScript" and paste the code: Edit1 = "hello there";Hit F9 to execute the script. To test the ActionScript for a button clickDraw an edit field that will appear as "Edit1" (or Edit2 etc). Draw a button. Select the button and choose "Action" > "On Click". Select "ActionScript" and paste the code: Edit1 = "hello there";Hit F9 and click the button to execute the script. To enable the item for the scriptTo access item properties like _rotation in your script you have to export it as "ActionScript Target". Choose "Item" > "Placement Properties" and check "ActionScript Target". Flash Designer defines the following items as ActionScript targets:
Sprite1._rotation = 90;
Note: The sprite will be rotated by the top left edge (coordinate 0,0). Move sprite items over the top left edge of the sprite to rotate the item by its center point.
To show or to hide an itemUse: youritem._visible = false; to hide the item and youritem._visible = true; to show the itemMovie Controlstop();Stops the movie.
play();
nextFrame();
prevFrame();
NOTE: Because Flash Designer is using 2 physical frames for each frame use nextFrame and prevFrame twice. For example: prevFrame();prevFrame();
gotoAndPlay("Frame 2");
gotoAndStop("Frame 2");
_parent.gotoAndStop("Frame 2");
Sprite2.gotoAndStop("Frame 2");
_root.gotoAndStop("Frame 2");
stopAllSounds();
getURL(url,target);
Flash Player VersionActionScript is in the beta phase. Not all commands are supported.If you use action script we suggest to set Flash Player version to 6. Choose "Movie" > "Export Options" and change Target Player to Flash Player 6
ParametersYou can pass parameters to your Flash movie in the query string, for examplePARAM NAME="MOVIE" VALUE="myflashfile.swf?param1=3¶m2=john" To specify parameters choose "Movie" > "Export Options" and enter parameters in "Parameters" field.
Operators
Control Flowif (expression) { } else { };Example: if (x==9) gotoAndStop("Frame 2"); else gotoAndStop("Frame 3");
while(expression) { };
while(x<10) { x++; }
for(init;expression;increment) { };
for(x=0;x<10;x++) { } *break and continue is not supported in for and while
Macromedia ActionScript Reference (PDF 6MB)download.macromedia.com/pub/documentation/en/flash/mx2004/fl_actionscript_reference.pdf Built-in classesCore ClassesArgumentsArray Boolean Button Date Error Function Math Number Object String Flash Player ClassesAccessibilityButton Color ContextMenu ContextMenuItem Key LocalConnection Mouse MovieClip MovieClipLoader PrintJob Selection Stage System TextField TextFormat Media ClassesCameraMicrophone NetConnection NetStream Sound Video
| ||||||||||
|
Products
|
Purchase
|
Downloads
|
Support
|
Flash Tutorials
|
Contact
Copyright © 1999-2012 Selteco Software, Inc. www.selteco.com, ph: +1 519-270-9057 |