flash as3.0加载SWF后怎么样控制他啊?
先看看我写的他就是不往后播放了啊······varloader:Loader=newLoader();loader.load(newURLRequest("1.swf")...
先看看我写的 他就是不往后播放了啊······
var loader:Loader = new Loader();
loader.load(new URLRequest("1.swf"));
main_mc.addChild(loader);
btn_btn.addEventListener(MouseEvent.CLICK,onclick);
function onclick(event:MouseEvent):void {
addEventListener(Event.ENTER_FRAME,onenterframe);
}
function onenterframe(event:Event):void {
trace("ok");
main_mc.prevFrame()
} 展开
var loader:Loader = new Loader();
loader.load(new URLRequest("1.swf"));
main_mc.addChild(loader);
btn_btn.addEventListener(MouseEvent.CLICK,onclick);
function onclick(event:MouseEvent):void {
addEventListener(Event.ENTER_FRAME,onenterframe);
}
function onenterframe(event:Event):void {
trace("ok");
main_mc.prevFrame()
} 展开
1个回答
展开全部
你这里的main_mc不过是装载1.swf的容器,并不是1.swf本身,所以操作无效,你这么写。
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadComplete);
loader.load(new URLRequest("1.swf"));
var mc:MovieClip = new MovieClip();
function loadComplete(e:Event):void {
mc = e.target.content as MovieClip;
main_mc.addChild(mc);
mc.play();
btn_btn.addEventListener(MouseEvent.CLICK,onclick);
}
function onclick(event:MouseEvent):void {
addEventListener(Event.ENTER_FRAME,onenterframe);
}
function onenterframe(event:Event):void {
trace("ok");
main_mc.mc.prevFrame();
}
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadComplete);
loader.load(new URLRequest("1.swf"));
var mc:MovieClip = new MovieClip();
function loadComplete(e:Event):void {
mc = e.target.content as MovieClip;
main_mc.addChild(mc);
mc.play();
btn_btn.addEventListener(MouseEvent.CLICK,onclick);
}
function onclick(event:MouseEvent):void {
addEventListener(Event.ENTER_FRAME,onenterframe);
}
function onenterframe(event:Event):void {
trace("ok");
main_mc.mc.prevFrame();
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询