FMProjector/FMPlayer Tutorial > Two-Way Synchronization
Back link
 

Home
FMProjetor
FMPlayer

Sample & Tutorial
 

Fundamental
- FSCommand Fundamental
- FMProjector Howto
- FMPlayer Howto
- Smartclips Howto
FSCommand Samples
- FSCommand Tutorial
- 1. Play video in Flash
- 2. Streaming&Overlap
- 3. Full screen video
- 4. Fast forward/backward
- 5. Synchronization
- 6. Embed PDF
- 7. Embed RealPlayer object
- 8. ASP interface
Smartclip Samples

- 9. Video w/ slider
-10. Read/write registry w/ sc
FSCommand Reference

- FAQ
- FSCommand Tutorial
- FSCommand fast track
Showcases
Support Forum
Submit yours
Anything done by you that can inspire and do help to others. It has better to be short, clear, and self-explained.

Contact
  Technical Support
  support@flashants.com
Marketing & Sales
  sales@flashants.com
Feedback & Suggestion
  feedback@flashants.com

 

The wedding - download this sample files

This sample shows you how to sync Flash by the script commands in Video file(ASF/WMV). In the sample, we use script commands in asf/wmv file to trigger Flash event and pass parameters to Flash. You can see the Flash RED HEART is precisely triggered by the KISS in the video.

Required utilities: Windows Media File Editor or Window Media ASF Indexer (You can download the above free tools from Microsoft. It is contained in the Windows Media Encoder 9 Series or Windows Media Tools 7/8)

  1. Use Windows Media File Editor(or ASF Indexer) to add the script command to your video file(ASF or WMV)
  2. In the flash file, we add the following fscommand to specify the frame label that contains the action scripts to be executed upon the event. And then we begin to playback the video here.
    fscommand ("fas.event.ScriptCommand", 
    "_root.SC_Label,scriptType,scriptValue"); fscommand ("fas.avclip.load", "../mediadata/wedding2.asf"); fscommand ("fas.avclip.xy", "10,10"); stop ();
  3. At frame 3, add a frame label "SC_Label" to be refered under the event triggered above. All the action scripts in this frame will be executed when the video play head rich the scriptcommand. In this example, we simply use the following command to play the flash movie start at this frame(frame 3):
    gotoAndPlay (3);
  4. The RED HEART movie start at frame 3.

The action scripts in the frame labeled with "SC_Label" will be executed whenever the script commands in the ASF/WMV file is played. And at the same time, pass the script type and parameter to "scriptType" and "scriptValue" variables in Flash.(In this sample, we don't make use of these parameters.) If you have multiple script commands in your video, you'll need to use "scriptType" and "scriptValue" variables to distinguish which script command triggers the event. Please refer to the following FAQ for more detail explanation: FAQ 2.5