1. Goto: jump to a specified Frame)
Scene: Specifies Scene
Frame: Number, Label, Expression, Next Frame, and Previous Frame. You can select the Number and Label of the Frame. The Expression is used to indicate the Next Frame and the Previous Frame.
Expression: defines the Expression.
Control: Go to and Play, Go to and Stop determine whether to continue playing or Stop after the specified frame is reached by selecting this project:
Go to and Play (1) Jump to the first frame
Go to Next Frame to jump to the Next Frame for playing
Go to and Stop ("intro") to jump to the frame broadcast labeled intro 2. Play: Play
Stop: Stop Toggle High Quality: how detailed the screen is to be switched Stop All Sounds: Stop All Sounds Get URL: Open the specified URL
URL: URL
Windows: _ self, _ blank, _ parent, _ top
Variables: Don't Send, Send use GET, Send use POST variable transmission method example:
Get URL ("next. asp", window = "_ blank", vars = POST) open next. asp in a new window and pass parameter 3. FScommand: Call Command
Command: Command
Arguments: Parameters
For standalone player: Fixed commands and parameter examples used by fullscreen, allowscale, showmenu, exec, and quit players:
FS Command ("fullscreen", "true") sets full-screen playback 4. Load/Unload Movie: Transfers/releases external videos
Action: Load movie into location, Unload movie from location, Load variables into location: You can choose whether to transfer a new movie, release the imported movie, and call the variable
URL: the video URL
Location: Level, Target: the transferred layer, or the Location of a Target object
Variables: Don't Send, Send use GET, Send use POST: Example of variable transmission method:
Load Movie ("test.swf", 1): Call test.swf to the first layer.
Load Movie ("test.swf", "loadit", vars = GET): Call test.swf to the location of the loadit target object.
Unload Movie ("loadit"): releases the film at the loadit target object.
Load Variables ("makeit. asp", 2, vars = GET): Call makeit. asp and receive the returned Variables. 5. Tell Target: Specify the Target object.
Target: Target object example:
Begin Tell Target ("obj") specifies the Target object obj
End Tell Target6, If Frame is Loaded: judge whether a Frame is transferred
Scene: Specifies the scenario
Frame: Number, Label, Expression: Specifies the Frame, Number, or Expression.
Expression: Expression example:
If Frame Is Loaded (Scene 1, "end ")
End Frame Loaded
: Determine whether frames labeled as end in scenario 1 are transferred to 7. On MouseEvent mouse Time Response
Event: Press, Release, Release Outside, Roll Over, Roll Out, Drag Over, Drag Out, Key Press events: Press, open, open Outside, Focus Move, remove, drag, drag, and press the button for example:
On (Press) when you Press the mouse
End On
On (Key: s) keyboard when s is pressed
End On8 and If determine whether the condition is true
Condition: Condition
Add Else/Else If clause: Add Else To judge again. Example:
If (a = 10) If a = 10 then ......
End If
If (a = 10) If a = 10 then ...... Otherwise ......
Else
End If9 and Loop
Condition: Condition example:
Loop While (a = 10) Loop if a = 10
End Loop10, Call function frame or object
Frame: function Frame example:
Call ("make") Call make frame program 11 and Set Property to Set Properties
Set: Y Positon, X Position, Y Scale, X Scale, Alpha, Visibility, Rotation, Name, High quality, Show focus rectangle, Sound buffer time Set y coordinate, x coordinate, y magnification, x magnification, transparency, visibility, rotation angle, name, fineness, focus rectangle display, sound buffer time (5 seconds by default)
Target: Target object
Value: value example:
Set Property ("aoe", X Position) = "12" sets the x coordinate of the target object aoe to 12
Set Property (Show focus rectangle) = "0" clear focus Box 12. Set Variable to Set variables
Variable: Variable
Value: value example:
Set Variable: "test" = 10 Set test = 1013, Duplicate/Remove Movie Clip to copy the object
Action: Duplicate movie clip, Remove duplicate movie clip, you can select whether to copy or delete
Target: Target object
New name: name of the New target object
Depth: Depth example:
Duplicate Movie Clip ("aoe", "aoe2", 1) copy a new aoe animation named aoe2
Remove Movie Clip ("aoe2") Delete the target object aoe214 and Drag Movie Clip and Drag the video Clip.
Start drag operation: Start to drag
Target: Target object
Constrain to rectangle: Left, Top, Right, Bottom cursor position, Top Left and Bottom Right
Lock mouse to center: place the mouse in the center
Stop drag operation:
Start Drag ("aoe", L = 2, T = 3, R = 4, B = 5) Drag the target object aoe at the position of L = 2, T = 3, R = 4, B = 5
Start Drag ("aoe", lockcenter): Drag the target object aoe, which is located in the center.
Stop Drag Stop dragging 15. Trace
Message: Information example:
Trace ("aoe") displays aoe
Trace (aoe) displays aoe value 16, Comment
Comment: annotation example:
Comment ("computing") Note: variables do not need to be declared for calculation in ActionScript. However, declaring variables is a good programming style, which makes it easy to grasp the lifecycle of a variable, knowing the meaning of a variable is helpful for program debugging. Generally, most global variables have been declared in the first sector of the animation and the initial values are assigned to them. Each MC object has its own set of variables, and variables in different MC objects are independent of each other and do not affect each other. Variable name
The variable name must meet the following requirements:
1) The variable name must be an identifier and cannot contain any special symbols;
2) variable names cannot be keywords and boolean values (true and flase)
3) The variable name is unique in its scope. Variable type
In Flash, you do not need to explicitly declare the type of a variable. When a variable is assigned a value, its type is dynamically determined. Of course, you can also interpret the value assignment statement as a variable declaration statement, for example:
X = 3;
The preceding expression declares an x variable of the number type and the value of x is 3. The value assignment to variable x may change its data type:
X = "hello ";
In this case, variable x is changed from number type to string type. This is somewhat different from other advanced languages such as C, but in fact, the value assignment statement in Flash is not only a value assignment function, it also plays a role in variable declaration.
A variable type that is declared but not assigned a value is called a non-type variable. In Flash 5, the variable [2] can automatically convert the variable type under certain conditions. For example, after a value is passed for the trace statement, the value is automatically converted to a string type and Output to the Output window. In the expression, ActionScript converts the type of the variable as needed, as shown in the following example:
"The number is" + 7
ActionScript automatically converts number 7 to string "7" and adds it to the end of the preceding string:
"The number is 7"
When debugging a script, you need to know exactly the data type of a variable. Because the data type determines the behavior of the variable, the typeof operator is provided in ActionScript to determine the type of a variable:
Trace (typeof (aVariable ));
In addition, Flash 5 provides two types of conversion functions. The Number function can convert a String to a Number. Corresponding, the String function can convert a Number into a String, which is easy to use, the script editing panel of Flash 5 has provided sufficient prompts. Variable Scope
In ActionScript, there are local variables and global variables. global variables are valid throughout the animation script, while local variables are only valid within its own scope. The var statement is required to declare a local variable. For example, in the following example, I is a local cyclic variable, which is valid only in the init function:
Function init (){
Var I;
For (I = 0; I <10; I ++ ){
RandomArray [I] = random (100 );
}
}
Local variables can prevent name conflicts, and name conflicts may cause fatal program errors. For example, variable n is a local variable, which can be used to count in one MC object, and another MC object may also have a variable n, which may be used as a circular variable, because they have different scopes, they do not cause any conflict.
The advantage of using local variables is to reduce the possibility of program errors. For example, if a function uses a local variable, the variable is changed only within the function, and a global variable can be changed anywhere in the program, incorrect variables may cause the function to return incorrect results or even cause the entire system to crash. In Flash5 ActionScript, variable [3]. In addition, function parameters are used as a local variable of the function. For example:
X = 3;
Function test (x)
{
X = 1;
A = x;
}
Test (x)
After the program is executed, the result is a = 1, x = 3. From this example, we can see that the x parameter in the test function is indeed processed as a local variable in the function. Variable Declaration
In a program, directly assigning values to a variable or using the setVariables statement is equivalent to declaring a global variable. The declaration of a local variable requires the var statement. Declare a variable using the var statement in a function. The variable becomes a local variable of the function and will be released at the end of function execution; variables declared by using the var Statement on the Root timeline are also global. They are released only when the animation ends.
After a global variable is declared and the variable is declared again using the var statement, the var statement is invalid. For example:
AVariable = 10;
Var aVariable;
AVariable + = 1;
In the preceding script, the variable aVariable is repeatedly declared twice. The declaration of the var statement is regarded as invalid. After the script is executed, the value of the variable aVariable is 11.
Note: The call statement will also generate a local variable scope for the program block it calls. When the called script ends, this local scope also disappears. In Flash 5, the call statement can be replaced by the with statement. Variable [4] In Flash5 ActionScript Note: The call statement will also generate a local variable scope for the program block it calls. When the called script ends, this local scope also disappears. In Flash 5, the call statement can be replaced by the with statement.
The trace statement can be used to detect the value of a variable. For example, trace (aVariable) converts the value of the variable aVariable into a string and passes it to the Output window. In debug mode, you can also change and obtain the value of a variable at any time. Use of Variables
When referencing a variable, you must declare the variable first (using the var statement or directly assigning values). If the variable is not initialized, an error will occur in the following example:
GotoAndPlay (aFrame );
AFrame is a tag. Because aFrame is not declared, gotoAndPlay will be incorrectly executed and jump to an uncertain position.
The content of variables can be changed at any time, and the type of variables determines their behavior. Note the following section about variable types. Some of these features are unique in ActionScript.
The simple data type transmits the value of the variable, that is, the content of the variable will be copied before it is passed out, whether in the value assignment statement, or is it the same if it is passed to a function as a parameter:
Var x = 4;
Var y = Math. sqrt (x );
In the preceding example, the value of variable x is copied and passed to the sqrt function, and value 2 to variable y. The value of variable x remains unchanged. Object Data Types contain a large amount of complex information. Variables with such data types do not save the actual content of objects. They only save a pointer to objects, when you call an object's properties or methods, find the actual location of the object based on the pointer and return the required content. The variable [5] in Flash5 ActionScript is an example of passing through a pointer:
Var myArray = ["Holly", "Tom"];
Var newArray = myArray;
MyArray [1] = "Marry ";
Trace (newArray );
In the above example, an array object myArray has two elements, and newArray is assigned a pointer to myArray. When the second element of myArray is changed, all other variables pointing to it will also change, and the final trace statement will output ["Marry", "Tom"] to the output window.
The following is an example of passing an object type variable as a parameter to a function:
Function initArray (newArray ){
Var I;
For (I = 0; I <10; I ++ ){
NewArray [I] = random (100 );
}
}
Var myArray = new Array ();
InitArray (myArray );
In the preceding example, myArray is passed to the initArray function. Because the object pointer is passed, the array myArray is initialized in the function.
In ActionScript, references to general objects are called strong references, and references to MC animations are called weak references. A strong reference means that the object cannot be released as long as there is a pointer pointing to the object. A weak reference means that after the MC animation ends, all pointers pointing to the MC animation will no longer work.
FLASH
Full Screen Technology1. Flash Player playback without a browser:
A. Do not display full screen (similar to screen saver effect) on the Flash player menu bar. Use the FS Command at the first frame and select fullscreen in the For standalone player option, in this case, the value of arguments is true, and that of Command is fullscreen. You can press ESC to exit or set a button on Actions, and use FS command to select quit in the For standalone player option to exit. Note: All options on For standalone player are only suitable For playback with Flash player. When browsing Flash animation, if you press CTRL + F, you can switch between full screen and non-full screen.
B. If you only want to fill the flash player window with swf files, you do not need to do anything. Directly click the swf file.
The preceding full screen mode is used in non-Internet environments.
2. run in a non-Flash Player (such as IE:
A. Only fill the browser: this situation is relatively simple, no matter whether the Flash size you make is 800 × 600, you only need to set the WIDTH and HEIGHT parameters to 100% in the HTML of the swf File. Of course, you can also set them in the settings of the HTML File exported from Flash by opening the File menu; select Publish Settings to bring up the export Settings dialog box. In the Dimensions option under the HTML Tag, select Percent (percentage) from the drop-down list, and enter 100 in the WIDTH and HEIGHT boxes, running this HTML file with the same name as swf has the same effect as directly adding statements. This full-screen browser has nothing to do with the settings of the swf file, but it is best to set the size of around 700 × 400, otherwise it is easy to cause the image (mainly the bitmap called in Flash) chinese character distortion.
B. Full Screen Display of the browser menu bar and toolbar is not displayed. This kind of full screen is a little complicated and has nothing to do with Flash settings, but it needs to be done with javascript. Method: add the following code between and in the HTML file
You can also add
Javascript: window. open ("*. swf", "", "fullscreen = 1, menubar = no, width = 800, height = 600 ″)
This full screen is similar to screen saver, and you can exit with ALT + F4 or the set button. Set fullscreen to = 0 to display the full screen of the menu bar and toolbar of the browser. (Note: *. swf is the file name of the Flash animation you want to display)
Help you get the getURL command
Since it is a network animation, the connection between FLASH Animation and "HYPERLINK" is essential. Next we will take a common and important ACTION function getURL () in FLASH () make a summary. First, getURL is triggered in two ways: [1] Add the getURL command to a clip on the animation timeline in the passive link mode of the audience, when the animation is played to this drive, it is automatically linked to the page address specified by the getURL parameter.
[2] Add the getURL command to a button in the scenario by means of active audience connection. When the button is triggered, the animation links to the page address specified by the getURL parameter. Its position in the ACTION panel:
In FLASH5.0: ACTIONS -- getURL
In flash mx: ACTIONS -- Browser/Network -- getURL syntax format: getURL ("url", "window", "variables"); parameter description: [1] url parameters: url is used to obtain the unified positioning resources of documents. Note that when writing complete than www.sina.com.cn can be written directly in the IE address bar, but here, we must write a http://www.sina.com.cn can, of course, FTP addresses and CGI scripts can also be used as their parameters.
The above is an absolute address, which provides a complete set of unified positioning resources.
In fact, the relative address can also be used here:
1. if SWF and the resource to be opened belong to the same directory, you can directly write the file name and suffix to be opened. For example, getURL ("aaa.swf );
2. If the resource is in the next directory, it starts with "/", for example, getURL ("/aaa.swf ");
3. If the resource is in the upper-level directory, it will start with "../", such as gerURL ("../aaa.swf )";
The directory mentioned above refers to the directory where SWF files are stored as the benchmark.
[2] windows parameters: Set the webpage window opening mode of the link to be accessed. You can enter your own copy or window name (in combination with the settings of the frame in Dreamweaver ). You can also select from the drop-down list:
_ Self: Open the link in the current browser.
_ Blank: Open the webpage in a new window.
_ Parent: opens the link in the browser window at the upper level. This option can be used if there are multiple nested frameworks and you want to link the URLs to replace the page where the video itself is located.
_ Top: open a new link above the current browser. If you have set some frameworks in Dreamweaver, this video is located in a framework. If you want the URL to be linked to appear on all frameworks instead of any frameworks, OK, select it.
[3] Variable parameter: Specifies the transmission mode of the parameter. In most cases, the default parameter is Don't Send. If you want to submit the content to the server, you must select Send Using GET or Send Using POST. ". "GET" means to directly add the parameter list to the url and submit it together. It is generally applicable when there are few and simple parameters. "POST" means to submit the parameter list separately, the speed is slower, but data is not easy to lose. It is suitable for scenarios with complicated parameters. Other use of URL: [1] triggered by email program
Use getURL to implement the mail program trigger effect (when you click this button, automatically open OUTLOOK and other local machine default Mail Program) just need to write getURL ("mailto: flasher@flasherclub.com ") you can. Note that there is no space between mail and. Change the email address as needed. [2] Desktop shortcuts
I remember the last time I got a full-screen animation on the desktop. The shortcut on the desktop can be used to connect to common addresses, such as getURL ("E: \ My Documents \ FLASH GAME "); but as a desktop, you must have a special link such as [my computer] [my documents]. I want to tell you my failure lessons: if getURL ("My Computer"); is invalid, the following are some special desktop link parameters:
Link to [my computer] gerURL ("file &: // :{ 20D04FE0-3AEA-1069-A2D8-08002B30309D }");
Link to [my document] gerURL ("file &: // :{ export d8fba-ad25-11d0-98a8-0800361b1103 }");
Link to [Network Neighbor] getURL ("file &: // :{ 208D2C60-3AEA-1069-A2D7-08002B30309D }");
Link to [Control Panel] gerURL ("file &: //: {20D04FE0-3AEA-1069-A2D8-08002B30309D}/: {21EC2020-3AEA-1069-A2DD-08002B30309D }");
Link to [recycle bin] getURL ("file &: // :{ 645FF040-5081-101B-9F08-00AA002F954E}"); [3] Call javascript Functions on the webpage
Format: getURL ("javascript: function ()");
Function is a function defined in HTML or a function in the function library.
Principle: When the animation executes the getURL command, it starts to search for the javascript function named function on the html page of the animation swf file and immediately executes the function. The most common example here is to use getURL to call javascript to open a new window.
The method is as follows:
Add the following code to the Flash button
On (release ){
GetURL ("javascript: openNewWindow ('url', 'windowname', 'width, Height, Tool bar, Menu bar, Location bar, Scroll bar, Status bar, resizable ') ");
} The specific parameter settings are as follows:
URL-> the page address of the pop-up window
Width-> window Width
Height-> window Height
Name-> window Name
Tool bar-> whether a toolbar is required
Menu bar->... Menu bar
Location bar->... Address bar
Scroll bar->... Scroll bar
Status bar->... Status bar
Resizable-> whether the file can be changed and published in HTML format. open the file and add a piece of code to it to define a function named openNewWindow.
This function is used to open the URL-based webpage file in a new window named "features ".