EasyManua.ls Logo

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT - Page 385

MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT
816 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
fscommand() 385
Example
The following is an example of using for..in to iterate over the properties of an object:
myObject = { name:'Tara', age:27, city:'San Francisco' };
for (name in myObject) {
trace ("myObject." + name + " = " + myObject[name]);
}
The output of this example is as follows:
myObject.name = Tara
myObject.age = 27
myObject.city = San Francisco
The following is an example of using the typeof operator with for..in to iterate over a
particular type of child:
for (name in my_mc) {
if (typeof (my_mc[name]) = "movieclip") {
trace ("I have a movie clip child named " + name);
}
}
The following example enumerates the children of a movie clip and sends each to Frame 2 in their
respective Timelines. The
RadioButtonGroup movie clip is a parent with several children,
_RedRadioButton_, _GreenRadioButton_ and _BlueRadioButton.
for (var name in RadioButtonGroup) {
RadioButtonGroup[name].gotoAndStop(2);
}
fscommand()
Availability
Flash Player 3.
Usage
fscommand("command", "parameters")
Parameters
command
A string passed to the host application for any use or a command passed to
Flash Player.
parameters A string passed to the host application for any use or a value passed to Flash Player.
Returns
Nothing.
Description
Function; allows the SWF file to communicate with either Flash Player or the program hosting
Flash Player, such as a web browser. You can also use the
fscommand action to pass messages to
Macromedia Director, or to Visual Basic, Visual C++, and other programs that can host
ActiveX controls.

Table of Contents

Related product manuals