About using FLV video
617
5.
Select the Parameters tab, and click Launch Component Inspector.
6.
In the Component inspector, type
http://www.helpexamples.com/flash/video/clouds.flv
in the URL text box.
7.
Open the Actions panel (Window > Actions), and type the following code in the
Script pane:
import mx.controls.MediaPlayback;
var my_mp:MediaPlayback;
my_mp.autoPlay = false;
my_mp.addEventListener("cuePoint", doCuePoint);
my_mp.addCuePoint("one", 1);
my_mp.addCuePoint("two", 2);
my_mp.addCuePoint("three", 3);
my_mp.addCuePoint("four", 4);
function doCuePoint(eventObj:Object):Void {
trace(eventObj.type + " = {cuePointName:" + eventObj.cuePoi
" cuePointTime:" + eventObj.cuePoi "}");
}
8.
Select Control > Test Movie to test your code.
The following cue points trace in the Output panel:
cuePoint = {cuePointName:one cuePointTime:1}
cuePoint = {cuePointName:two cuePointTime:2}
cuePoint = {cuePointName:three cuePointTime:3}
cuePoint = {cuePointName:four cuePointTime:4}
For more information on working with the MediaPlayback component, see
“Media
components (Flash Professional only)” on page 813
. For more information on working with
the FLVPlayback component, see
“FLVPlayback Component (Flash Professional Only)”
on page 489
.
Adding seek functionality with cue points
(Flash Professional only)
You can embed Navigation cue points in an FLV file to add seeking functionality to your
applications. The
seekToNavCuePoint()
method of the FLVPlayback component locates the
cue point in the FLV file with the specified name, at or after the specified time. You can
specify a name as a string (such as
"part1"
or
"theParty"
).
You can also use the
seekToNextNavCuePoint()
method, which seeks to the next navigation
cue point, based on the current
playheadTime
. You can pass the method a parameter,
time
,
which is the starting time from where to look for the next navigation cue point. The default
value is the current
playheadTime
.
Summary of Contents for FLASH 8-LEARNING ACTIONSCRIPT 2.0 IN FLASH
Page 1: ...Learning ActionScript 2 0 in Flash...
Page 8: ...8 Contents...
Page 18: ...18 Introduction...
Page 30: ...30 What s New in Flash 8 ActionScript...
Page 66: ...66 Writing and Editing ActionScript 2 0...
Page 328: ...328 Interfaces...
Page 350: ...350 Handling Events...
Page 590: ...590 Creating Interaction with ActionScript...
Page 710: ...710 Understanding Security...
Page 730: ...730 Debugging Applications...
Page 780: ...780 Deprecated Flash 4 operators...
Page 830: ...830 Index...