我正在将 Flash 8 中内置的 swf 嵌入到 as3 项目中。当我调用 stop() 或 gotoAndStop(0); 在表示嵌入 swf 实例的 MovieClip 上,它会停止一秒钟,然后继续。尝试在 mc 上调用 removeChild 会将其从显示屏中删除,但 swf 中的音频会继续播放。swf,在这种情况下必须嵌入,我不能使用加载器。有任何想法吗
编码:
[Embed (source = "t1.swf")]
private var t1:Class;
private var mc:MovieClip;
public function iphoneTest()
{
var tf:TextField = new TextField();
tf.x = 10;
tf.y = 100;
tf.width = 100;
tf.height = 50;
tf.text = "Hello worl";
mc = new t1();
var button:CustomSimpleButton = new CustomSimpleButton();
button.width = 50;
button.height = 50;
button.x = 10;
button.y = 150;
button.addEventListener(MouseEvent.CLICK, onClick);
this.addChild(mc);
this.addChild(tf);
this.addChild(button);
}
private function onClick(e:MouseEvent):void {
mc.stop();
this.removeChild(mc);
}