|
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)
- Use
Windows Media File Editor(or ASF Indexer) to add the script
command to your video file(ASF or WMV)
- 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 ();
- 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);
- 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
|