问题描述
我曾尝试使用计时器从FlashFirebug插件AS3的控制台,但它不工作(尝试了好几种的组合)。计时器code是这样的:
i have tried to use a timer in the as3 console from FlashFirebug addon but it doesn't work (have tried several combinations). The timer code was this:
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.display.Sprite;
var myTimer = new Timer(1000, 2);
myTimer.addEventListener(TIMER, timerHandler);
myTimer.start();
function timerHandler(event:TimerEvent){trace("timerHandler: ");}
//但它给这个错误:
//but it gives this error:
Error #1034: Type Coercion failed: cannot convert r1.deval.rt::FunctionDef@50ef781 to Function.
//也试图在使用setInterval这个code:
//also have tried with setInterval with this code:
import flash.utils.Timer;
import flash.events.TimerEvent;
import flash.display.Sprite;
import flash.utils.setInterval;
function d(){trace("cc");}
setInterval(d, 2000);
//但是控制台错误说:
//but console error says:
Error: Call to a possibly undefined method.
//可能需要进口的东西。试图寿进口进口flash.utils.setInterval;但给出了这样的错误:错误:。能够将它实例前进口的flash.display.MovieClip之前,必须先导入类;
//probably need to import something. tried tho import "import flash.utils.setInterval;" but gives this error:"Error: You must import the class before being able to instantiate it. Ex. import flash.display.MovieClip;"
你能帮我一下吗?定时器或setInterval的功能呢?谢谢,约翰·
Can you help me on This? timer or setInterval functions?Thanks,John
推荐答案
这是很老。但回答它来帮助人的未来。
This is quite old. But answering it to help anyone in the future.
FlashFirebug 4.8.0 这仍然是在批准队列(在回答时)应使您能够注入运行的SWF内的SWF文件。
FlashFirebug 4.8.0 which is still on the approval queue (at the time of answer) should enable you to inject an SWF file inside the running SWF.
这将允许您使用全AS3功能,当你打的限制与控制台。
That would allow you to use full AS3 capabilities when you hit limitations with the console.
这篇关于flashfirebug AS3控制台定时器或setInterval的不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!