The basic usage of Flash common as control statement

Source: Internet
Author: User
Tags expression vars

Very many friends often ask about Flash 's actionscrIPT script statement usage, some very simple commands can achieve some kind of function, at present I put some FL as The basic usage of H's common action statement is explained.

1. Goto: Jump to a specified frame
Scene: Specify Scene
Frame:number,label,expreSSIon,next frame,previous Frame can select the number of the frame, the label, through the expression, the next frame, the previous frame
Expression: Defining An expression
Control:go to and Play,go the to and stop by selecting this item to determine whether to continue playing or stopping after the specified frame is reached

Example:
Go to and Play (1) skip to the first frame
Go to Next frame skip to next frames play
Go to and Stop ("Intro") jumps to a intro-labeled frame

2. Play: Playing
Stop: Stopping

Toggle High Quality: The degree of detail of the conversion screen

Stop all Sounds: stopping all sounds

   Get URL: Opens the specified URL
URLs: URLs
Windows system: The target used by _self,_blank,_parent,_top when opening the URL
Variables on ' t send,send use get,send the use POST variable delivery method

Example:
Get URL ("next. ASP", window=" _blank ", vars=post) opens next.asp in a new window, and passes parameters

3. Fscommand: Invoke command
Command: Commands
Arguments: Parameters
Fixed commands and parameters used by the for standalone Player:fullscreen,allowscale,showmenu,exec,quit player

Example:
FS Command ("fullscreen", "true") set full screen playback

4, Load/unload Movie: Transfer into/release the external film
Action:load movie into Location,unload movie from Location,load to variables: Can I choose whether to transfer the new movie, release the transferred movie, and transfer the variable
URL: The Web site of the movie
Location:level,target: The layer that is transferred, or the position of a target object
Variables on ' t send,send use get,send use POST: How variables are passed

Example:
Load Movie ("test.swf", 1): Transfer the test.swf to the first floor
Load Movie ("test.swf", "Loadit", Vars=get): Transfer test.swf to the location of the Loadit target object
Unload Movie ("Loadit"): Release the movie from Loadit target object
Load Variables ("makeit.asp", 2, Vars=get): Call makeit.asp and receive returned variables

5. Tell target: Specify target object
Target: Destination Object

Example:
Begin tell Target ("obj") specifies the target object obj
End Tell Target

6, if frame is Loaded: To determine whether a frame is transferred into
Scene: Specifying Scenes
Frame:number,label,expression: Specify frame, label, or expression
Expression: An expression

Example:
If Frame is Loaded (Scene 1, "End")
End Frame Loaded
: Determines whether the frame of the scene one is labeled end is transferred into

7, on MouseEvent Mouse time response
Event Ress,release,release outside,roll over,roll Out,drag Over,drag Out,key Press various events: Push, release, open outside, focus move, move out, drag, drag out, press

Example:
On (press) when the mouse is pressed
End on
On (key:s) keyboard when s is pressed
End on

8, if determine whether the condition is established
Condition: Conditions
Add Else/else If clause: Add Else to judge again

Example:
if (a=10) if a=10 so ...
End If
if (a=10) if a=10 so ... Or......
Else
End If

9. Loop loop
Condition: Conditions

Example:
Loop while (a=10) if a=10 loops
End Loop

10, call calls the function frame or object
Frame: Function Frame

Example:
Call (' make ') invokes the Make frame program

11, Set property settings 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, visual no, rotation angle, name, fineness, focus rectangle box display, sound buffer times (default 5 seconds)
Target: Destination Object
Value: Values

Example:
Set Property ("AoE", x Position) = "12" sets the X coordinate of the target object AoE to 12
Set property (show focused rectangle) = "0" Cancel Focus box

12. Set Variable setting variable
Variable: Variable
Value: Values

Example:
Set Variable: "Test" = 10 set test=10

13, Duplicate/remove Movie Clip replication Objects
Action uplicate movie Clip,remove Duplicate movie clip can choose whether to copy or delete
Target: Destination Object
New name: Names of newly targeted objects
Depth: Depth

Example:
Duplicate Movie Clip ("AoE", "AoE2", 1) copy AoE a new animation, named AoE2
Remove Movie Clip ("AoE2") deletes the target object aoe2

14. Drag Movie Clip Drag movie clips
Start drag operation: Begin dragging
Target: Destination Object
Constrain to Rectangle:left,top,right,bottom mouse position, left top right
Lock Mouse to center: mouse placed in centre
Stop drag Operation drag

Example:
Start Drag ("AoE", l=2, T=3, r=4, b=5) Drag target object AoE, location in l=2, T=3, r=4, b=5
Start Drag ("AoE", Lockcenter) Drag the target object AoE, located in the center
Stop Drag Drag

15. Trace Trace
Message: Information

Example:
Trace ("AoE") displays AOE
Trace (AOE) Displays the value of AOE

16. Comment Annotation
Comment: Notes

Example:
Comment ("calculation") Note: Calculating

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.