Sunteți pe pagina 1din 4

Tutorial details: Difficulty Level: Beginner Actions for Flash 5 break -- Stops a repeated action in a loop.

Below you can see axample, the value in the variable "xxxx" would be "6" on (release) { do { k = k+1; if (k>5) { break } } while (k<8); xxxx = k; } call -- Initiates an action in a specified frame but does not open the frame. The frames script is essentially "borrowed" by calling action. The only parameter is the name of the on (release) { tiltit(35); }
getURL -- opens specified URL getURL ("http://www.actionscript.org/", "_new");

Go To -- go to a specified line number or label and either play or stop.


gotoAndPlay (1); gotoAndStop (5);

if

-- Establishes a condition to launch other actions.

if (k==8) { gotoAndPlay (1); } ifFrameLoaded -- Determines whether a specified frame is loaded. ifFrameLoaded ("Scene 2", 6) { gotoAndPlay (7); }

include -- If you have code which you repeatedly using in your movies,the best way to save
your time is to write it ones and then use it as a include action. on(release) { #include "myscript.as" }

Load Movie -- Loads a specified movie at a URL in stated level or into a specified target
movie clip on (release) { loadMovieNum ("xxxx.swf", 1); }

loadVariables -- Loads rext files as Variables into the specified level or target.In the text
file, the Variables must have the format, "varName=varValue" (no quotation marks).If more than one variable is placed in the text file, an ampersand (&) must separate the variables with no spaces carriage returns. loadVariables ("xxx.txt", 0);

nextFrame -- go to next frame (Expert mode only)


nextframe ()

nextScene -- go to next Scene (Expert mode only)


nextScene ()

onClipEvent -- actionscript associated with the selected movie clip.


onClipEvent (load) { score = 1; }

prevFrame -- go to previos frame (Expert mode only)


prevFrame ()

prevScene -- go to previos Scene (Expert mode only)


prevScene ()

print -- sends a specified bounding box in the named level or target to a printer as a vector
graphic. the folowing box maybe a movie,frame, or max area. on (release) { print (0, "bmovie"); }

printAsBitmap -- sends a specified bounding box in the named level or target to a printer
as a bitmaped graphic. the folowing box maybe a movie,frame, or max area. on (release) { printAsBitmap (0, "bmovie"); }

removeMovieClip -- Deletes a specified movie clip from a movie.


on (release) { removeMovieClip (_root.shopts./orangeShorts); }

return -- when executed , this optinal expression returns a value of function or null if no
expression is includet. function doTax(price,rate) { return price + (price*rate); } using return generates a calculated outcome in the function that maybe passed to the variable.Using the above script , the variable out in the folowing script would contain the calculated values of the literals used as arguments. on (release) { out=doTax(39,.08); }

setProperty -- changes the Property of the specified movie clip.


onClipEvent (load) { setProperty ("/mcXXX", _rotation, 44); } replecement format: onClipEvent (mouseDown) { _root.mcXXX._rotation=44; }

set variable -- establishes and/or changes a variable's value. Variable values can be any
legitimate do { var k=k+1; } while (k<10); trace (k);

var -- establishes a varible as a local varible.It is especially valuable in functions where more
than single button , frame,or MC are included in script. function counter() { var k+=1; }

while -- a loop that establishes the loop condition at the top of the loop and executes until the
condition is met. If the condition is met on internal iteration of the loop, it exits the loop whithout executing statement inside the loop. on (release) { while (k<9){ k=k+1; } box=k; }

with -- the with statement addresses an object, and the object is subject to the statements
within the curly brackets ({}) after the with object is identified. Multiple statements can accompany the with action. on (release) {

with (_root.show) { _rotation=56; _alpha=76; } }

S-ar putea să vă placă și