command| detailed
1, FS command Introduction
The FS command is a tool used by flash systems to support other applications to communicate commands to each other, both in Flash players and Web pages. Let's take a look at its basic usage:
The FS Command function is configured with ' Command ' and ' Arguments ' to apply to the following statement when standalone player plays:
Command Arguments FS command
Fullscreen true or false to control whether full screen
Allowscale true or False right-click to display menu
Exec Application Path Open application
Quit not fill in the animation
Note: In the Web page, the full screen playback method is different!
2. FS Command Page Primary usage
FS command has two main functions in Web applications
(1) enables Flash to send commands to the scripting language. You can call a function in a scripting language or pass a variable to a scripting language.
(2) enables the scripting language (Js,vbs) to send commands to flash. You can either define a variable in flash or directly control the jump on the timeline of the Flash animation or the attributes that define the entity in Flash.
To give you a sense of sensibility, first look at this program:
Did you see that? That's how it's done:
(1) using Flash as a simple button, the action of the button is set to:
On (release)
Fscommand ("alert", "Hello,this is FS Command speaking")
End on
(2) Output the button as SWF, insert the Web page with Dreamweaver, and start with the ID name "button"
(3) Add between Web page
<script language=javascript>
function Button_dofscommand (Command,args)
{if (Command = = "alert") {
Alert ("Now look in this:" +args);}
}
</script>
<script language=vbscript>
Sub button_fscommand (ByVal command, ByVal args)
Call Button_dofscommand (command, args)
End Sub
</SCRIPT>
The following (3) points of syntax to do some explanation: "function Id_dofscommand (Command,args)" is a reference to the FS command a fixed format, ID is the SWF inserted in the page after the ID name. "If" (command= ")" after the sentence to fill in the Flashaction command bar filled in the content, "args" is a variable, in the example of args representative is the content of argument. "Alert" is a "JS" function, the function is output information. See a section of the VBS code behind the JS statement? This code is very important. Oh, if your browser is IE, this code is essential.
3, the FS command Flash Methods
Flash methods refers to a specific set of functions that can be run in scripts and communicated in Flash.
In IE, the format of Flash methods is: Id.flashmethods
We still use the method of learning example to understand the function and usage of flash methods:
Please click on the button! Do you see the effect? It is achieved by:
(1) Draw a text box in Flash, define its entity name to get, and set the Text property to multiline (allow line wrapping), Word Wrap (boundary wrap).
(2) Make the button "submit" and "clear", respectively set the action as:
On (release)
Fscommand ("Post", "")
End on
On (release)
Fscommand ("Clear", "")
End on
(3) Use Dreamweaver to insert the exported SWF into the Web page with the ID name Buttonn.
(4) Add in the Code of the Web page:
<script language=javascript>
function Buttonn_dofscommand (Command,args)
{if (Command = = "POST")
Buttonn. SetVariable ("_root.get", "Haha!") Amazing, huh? That's what JavaScript says! ~0~ ")
else if (Command = = "clear")
Buttonn. SetVariable ("_root.get", "")
}
</script>
<script language=vbscript>
Sub buttonn_fscommand (ByVal command, ByVal args)
Call Buttonn_dofscommand (command, args)
End Sub
</SCRIPT>
4, Flash methods set of functions
Look at the above example, you must have some understanding of flash methods! Let me introduce all the functions of flash methods:
Flash method Function Function explanation
Play () animation
Stopplay () Stop animation
IsPlaying () Whether the animation is playing (True,false)
Gotoframe (Frame_number) jumps to a frame (frame_number+1)
Totalframes () Gets the total number of frames for the animation
Currentframe () to return the current animation frame number-1
Rewind () returns the animation to the first frame
Setzoomrect (left,top,right,buttom) enlarge the specified range
Zoom (percent) Change animation size
Pan (x_position,y_position,unit) enables animations to be translated in x,y direction
Percentloaded () returns the percentage of animations loaded (0-100)
Loadmovie (level_number,path) Load animation
Tgotoframe (Movie_clip,frame_number) Movie_clip jumps to the specified number of frames
Tgotolabel (muvie_clip,label_name) Movie_clip jumps to the specified label
Tcurrentframe (movie_clip) postback Movie_clip Current frame-1
Tcurrentlabel (movie_clip) postback movie_clip current label
Tplay (movie_clip) play Movie_clip
Tstopplay (Movie_clip) stop playback of Movie_clip
GetVariable (variable_name) Get variable
SetVariable (variable_name,value) variable assignment
Tcallframe (movie_clip,frame_number) call specifies the action on the frame
Tcalllabel (Movie_clip,label) call specifies the action on the label
Tgetproperty (movie_clip,property) Gets the specified property of the Movie_clip
Tsetproperty (movie_clip,property,number) sets the specified properties of the Movie_clip
What needs to be explained is that the last two functions are represented by numbers from 0 to 18 when they get the properties of the Movie_clip. The following lists the meanings they represent:
How a property acts as a digital use
x Position x coordinates 0 get,set
Y Position y-coordinate 1 get,set
x Scale x-directional scaling ratio 2 Get,set
Y Scale y-direction scaling ratio 3 Get,set
Currentframe movie_clip Current number of frames 4 get
Totalframes Movie_clip Total Frame number 5 get
Alpha Movie_clip Transparency 6 Get,set
Visibility Movie_clip is visible 7 get,set
Width Movie_clip 8 Get
Height Movie_clip 9 Get
The rotational degree of rotation movie_clip Get,set
Path one get for Target Movie_clip
Framesloaded Movie_clip The number of frames loaded
The Entity name Movie_clip Get,set
DropTarget Movie_clip Drag-Get
URL contains the URL of movie_clip animation
Highquality set screen quality for high quality Get,set
Focusrect Display button Border Get,set
Soundbuftime Preset sound buffering time Get,set
So far, the full use of the FS command has been introduced. As we can see, the FS command opens a script-language interface for Flash, which makes up for Flash's lack of function. So, take advantage of this method, will make us in the production of Flash animation!