Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 AS3删除本地enterFrame侦听器_Actionscript 3_Listener_Flash Cs5_Flvplayback - Fatal编程技术网

Actionscript 3 AS3删除本地enterFrame侦听器

Actionscript 3 AS3删除本地enterFrame侦听器,actionscript-3,listener,flash-cs5,flvplayback,Actionscript 3,Listener,Flash Cs5,Flvplayback,(我不知道为什么问题没有显示“你好”) 大家好, 我有以下代码: myVideo1.addEventListener(MetadataEvent.METADATA_RECEIVED, timeListener); function timeListener(eventObject:MetadataEvent):void { var totalSeconds = String(eventObject.info.duration); durationTime = String(Math.floo

(我不知道为什么问题没有显示“你好”)

大家好,

我有以下代码:

myVideo1.addEventListener(MetadataEvent.METADATA_RECEIVED, timeListener);

function timeListener(eventObject:MetadataEvent):void
{ 
var totalSeconds = String(eventObject.info.duration);
durationTime = String(Math.floor(totalSeconds));

addEventListener(Event.ENTER_FRAME, updateTime2);//<---LISTENER

var timeFull = durationTime;

function updateTime2(event:Event):void
{
    var elapsedSeconds = String(Math.floor(myVideo1.playheadTime));
    var runTime:String = (elapsedSeconds);
    var timeGone = Math.floor((eventObject.info.duration) - (myVideo1.playheadTime));
    var timeRem = Math.floor(timeGone / 60);
    var secGone = String(timeGone / 60 - timeRem);
    // etc...
}
}
myVideo1.addEventListener(MetadataEvent.METADATA\u已接收,timeListener);
函数timeListener(eventObject:MetadataEvent):void
{ 
var totalSeconds=String(eventObject.info.duration);
持续时间=字符串(数学地板(总秒));
addEventListener(Event.ENTER_FRAME,updateTime2)//

这就是你想要的吗?

你的脚本在哪里?很抱歉,我以前没有看到答案。是的,我必须使用删除程序。我在函数外部使用了删除程序,但它不起作用。这就是问题的原因。答案正确吗?如果正确,如果你将其标记为正确,我将非常感激。)
removeEventListener(Event.ENTER_FRAME, updateTime2);