Flash CC Pro上没有提示点,所以我如何跳转到特定点?

时间:2014-06-18 18:53:32

标签: flash flv

我尝试在Flash CC Pro上创建一个按钮,以跳转到我导入的FLV视频的特定点。

在Flash CS上我知道我可以在FLV中添加提示点,然后使用动作脚本跳转到提示点。但是我在Flash Pro CC上看到你无法添加这些提示点,所以我该如何设置动作呢?

谢谢!

1 个答案:

答案 0 :(得分:0)

在Flash Pro CC中不推荐使用UI添加/删除提示点。

您需要使用Actionscript添加或删除提示点并寻找特定的提示点。

此官方文档解释了如何 - http://help.adobe.com/en_US/ActionScript/3.0_UsingComponentsAS3/WS5b3ccc516d4fbf351e63e3d118a9c65586-7feb.html#WS5b3ccc516d4fbf351e63e3d118a9c65b32-7f05

示例代码:

// Requires an FLVPlayback instance called my_FLVPlybk on Stage 
import fl.video.*; 
import fl.video.MetadataEvent; 

//my_FLVPlybk.source = "http://www.helpexamples.com/flash/video/cuepoints.flv" 
var cuePt:Object = new Object(); //create cue point object 
cuePt.time = 2.5; 
cuePt.name = "ASpt1"; 
cuePt.type = "actionscript"; 
my_FLVPlybk.addASCuePoint(cuePt);//add AS cue point 

// add 2nd AS cue point using time and name parameters 
my_FLVPlybk.addASCuePoint(5, "ASpt2"); 

my_FLVPlybk.addEventListener(MetadataEvent.CUE_POINT, cp_listener); 
function cp_listener(eventObject:MetadataEvent):void { 
        trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime); 
        trace("Cue point name is: " + eventObject.info.name); 
        trace("Cue point type is: " + eventObject.info.type); 
}