开发者

Embedding two slideshows

I am trying to embedd two slideshows into my flash file.

I already managed to integrate one, but I can't integrate another since my knowledge of actionscript is very limited. For people that know Flash well it is a really easy question. What do I have to rename in this script so that I can create a second slideshow, without always calling on the first one.

Here is the script for the first slideshow: (I got it from the website where I bought the template for the slideshow from)

var loader:Loader = new Loader();
var monoslideshow:Object;
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, onLoadComplete);
addChild(loader);
loader.load(new URLRequest("monoslideshow.swf"));

function onLoadComplete(event:Event):void {
    monoslideshow = event.target.content;
    monoslideshow.showLogo = false;
    monoslideshow.setViewport(new Rectangle(730, 20, 700, 660));
    var xml:XML =
    <album title="ADVERTISING" itemPath="photography/advertising/" thumbnailPath="thumbnails/">
        <contents>
            <image source="2.jpg" />
            <image source="4.jpg" />
            <image source="6.jpg" />
            <image source="9.jpg" />
        开发者_高级运维</contents>
    </album>
    monoslideshow.loadXML(xml);
}


this is a piece of ugly code but it should work ok:

var loaderSlide_1:Loader = new Loader();
var loaderSlide_2:Loader = new Loader();
var monoslideshow_1:Object;
var monoslideshow_2:Object;

loaderSlide_1.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete_1);
loaderSlide_2.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete_2);
addChild(loaderSlide_1);
addChild(loaderSlide_2);

loaderSlide_1.load(new URLRequest("monoslideshow_1.swf")) ;
loaderSlide_2.load(new URLRequest("monoslideshow_2.swf")) ;

function onLoadComplete_1(event:Event):void { 
    monoslideshow_1 = event.target.content ;
    monoslideshow_1.showLogo = false ;
    monoslideshow_1.setViewport(new Rectangle(730, 20, 700, 660)) ;
    var xml:XML = monoslideshow_1.loadXML(xml_1) ;
}

function onLoadComplete_2(event:Event):void { 
    monoslideshow_2 = event.target.content ;
    monoslideshow_2.showLogo = false ;
    monoslideshow_2.setViewport(new Rectangle(730, 20, 700, 660)) ;
    var xml:XML = monoslideshow_2.loadXML(xml_2) ;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜