swf在闪光灯中相互叠加

时间:2013-02-04 15:41:01

标签: image actionscript-3 flash image-gallery

我有一个flash文件,(横幅广告),我需要有一个图片库和一个flv播放器,我有。为了节省空间我已经使用加载器通过他们的swf文件使用按钮来调用它们。但是当我这样做时,它会在我的主Flash页面上调用swf,不断地将越来越多的页面叠加在一起。

继承人是我的加载程序代码:

var loadedSWF:Loader = null;
var req:URLRequest = new URLRequest("imagegallery.swf");
loadedSWF = new Loader();
loadedSWF.load(req);


function loadSWF(file:String, container:MovieClip=null):void
{
if(container == null) container = MovieClip(root);

// removes the previously loaded SWF
if(loadedSWF != null)
{
    if(loadedSWF.parent) loadedSWF.parent.removeChild(loadedSWF);
}

addChild(loadedSWF);
}
imageGallery_btn.addEventListener(MouseEvent.CLICK, _click);
function _click(e:MouseEvent):void
{
  loadSWF("imagegallery.swf");
}

这是我在本网站上找到的一些代码。

heres an image of the problem:

0 个答案:

没有答案