What is a FSCommand?


 

NOTE: FSCommand Usage is now deprecated. It is still available in Zinc™ v2.5 to provide backwards compatibility but should not be exclusively used for new projects. This chapter is included as a point of reference on FSCommand Implementation. All new Zinc™ v2.5 Projects should be scripted with {mdm}Script™ 2.0.

 

 

A FSCommand is a function in Adobe Flash that provides communication with a SWF movie's host application. A host application is anything that contains the actual SWF movie, ranging from the actual Adobe Flash Player, to a 3rd party developed player (often referred to as a "wrapper").

 

FSCommands have certain rules and procedures which must be followed for correct usage with Adobe Actionscript. These requirements and limitations are listed below:

 

FSCommand Execution Order

The SWF Format is engineered to execute all native actionscript first, and then execute FSCommands. Even if your FSCommands are placed at the top of your code, they will still be executed last.

 

FSCommands in Loops

FSCommands will not work in standard actionscript loops such as IF, FOR and WHILE. This is due to the point mentioned above. Instead of Loop statements, you must use either Frame-by-Frame looping methods, or the SetInterval Statement.

 

FSCommands and Variables

By default, FSCommands will ALWAYS return and read values (variables) to the _root of your SWF movie, even if the FSCommand is executed within a Movie Clip. You must be sure to target variables correctly.

 

 

Whilst FSCommands have always (and still do) provide the basis of Communication between a SWF and it's host, the limitations described above have rendered them clumsy to use and awkward to script with.