FSCommandHandler

FSCommandHandler
Scaleform::GFx::State
    Scaleform::GFx::FSCommandHandler
Declaration
class FSCommandHandler : public State;
Description

FSCommandHandler is used to detect fscommand calls from ActionScript, which are routed to its Callback virtual function. 

ActionScript embedded in a movie can use the built-in fscommand() method to send data back to the host application. This method can be used to inform the application about button presses, menu selections and other UI events. To receive this data the developer needs to register a handler with SetFSCommandCallback. If specified, this handler gets called when ActionScript executes the fscommand statement. The handler receives the Movie* interface for the movie that the script is embedded in and two string arguments passed by the script to fscommand. 

One alternative to fscommand is ExternalInterface, which receives callbacks when ActionScript user executes ExternalInterface.call. External interface can receive more arguments and is handled by ExternalInterface state.

   // "fscommand" callback, handles notification callbacks from ActionScript.
   class MyFSCommandHandler : public GFx::FSCommandHandler
   {
     public:
     virtual void Callback(Movie* pmovie, const char* pcommand, const char* parg)
     {
        if (!strcmp(command, "wireframe"))
        {
           // Handle wireframe command...
        }
     }
   };
   ...
   // Install handler on the loader or individual movie. If installed on the loader, it will receive commands from all movie views; if installed on a movie view
   // the handler will only be called for fscommands executed in that view.
   Ptr<FSCommandHandler> pcommandHandler = *new MyFSCommandHandler;
   loader.SetFSCommandHandler(pcommandHandler);
Methods
Method 
Description 
Called when an fscommand is received. 
FSCommandHandler constructor. 
File

GFx_Loader.h