Naser Sultan
Naser Sultan

Reputation: 3

XML Banner Rotator in flash

XML Code file Slider.xml

<?xml version="1.0" encoding="utf-8"?>
<slide DELAY="2">
    <image URL="SliderImages/1.jpg" links="http://www.link1.com" />
    <image URL="SliderImages/2.jpg" links="http://www.link2.com" />
</slide>

Here is my actionScript3 Code.

function Complete(e:Event):void {
    var _xml:XML=new XML(e.target.data);
    _loader.removeEventListener(Event.COMPLETE, Complete);
    _loader=null;
    _delay=_xml.@DELAY;
    _images=_xml.image;
    _total=_images.length();
    LoadImages();
}

function LoadImages():void {
    for (var i:int = 0; i < _total; i++) {
        var _url:String=_images[i].@URL;
        _linked=_images[i].@links;
        var _loader:Loader = new Loader();
        _loader.load(new URLRequest(_url));
        my_link.push(_linked);
        _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, ImageLoaded);
        _loaders.push(_loader);

        _loader.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);
    }
}

function fl_ClickToGoToWebPage(event:MouseEvent):void { 
    navigateToURL(new URLRequest(_linked)); 
}

My code is working fine, but the Hyper link is not working correctly.

How can I add hyper link in the loop so navigateToURL user starts to work?

Upvotes: 0

Views: 32

Answers (0)

Related Questions