A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Possible to transition XML-Loader Images?

  1. #1
    Senior Member
    Join Date
    Oct 2002
    Location
    Newfoundland
    Posts
    131

    Possible to transition XML-Loader Images?

    Hello,

    I have images loading in, with their location data stored in an XML file. Is it possible to transition (i.e. fade) these images into one another on the timeline?

    Also, as an alternative if I can't accomplish the above... if I created the images and transitions in their own flash movie and exported them so I could import that movie into another movie, would it be best to export the image slides as an FLV or SWF?

    Thanks for any help!

  2. #2
    Senior Member
    Join Date
    Oct 2002
    Location
    Newfoundland
    Posts
    131
    I've managed to figure this one out, in some sort of roundabout way... (I'll post the code below) ...but is there any way I can preload the images from an XML file as the first one is showing?






    ------------------------------
    stop();
    var loader:URLLoader = new URLLoader();
    var mainXML:XML = new XML();
    loader.addEventListener(Event.COMPLETE, onComplete);
    loader.load(new URLRequest("thePix.xml"));


    function onComplete(event:Event):void
    {
    mainXML = new XML(loader.data)
    process(mainXML);
    }
    function process (pixXML:XML):void{
    var newPicInt:int = 100;
    var newPic:Timer= new Timer (5000);
    newPic.start();
    newPic.addEventListener(TimerEvent.TIMER, newPix);
    var i:int= Math.floor (Math.random()*pixXML.path.length())
    var imageRequest:URLRequest = new URLRequest(pixXML.path[i].text());
    var imageLoader:Loader = new Loader();
    imageLoader.load(imageRequest);
    imageLoader_mc.addChild(imageLoader);
    imageLoader.y = 27;
    function newPix(event:TimerEvent):void {


    var i:int= Math.floor (Math.random()*pixXML.path.length());

    var imageRequest:URLRequest = new URLRequest(pixXML.path[i].text());
    var imageLoader:Loader = new Loader();
    imageLoader.load(imageRequest);
    imageLoader_mc.addChild(imageLoader);
    imageLoader.y = 27;


    var blurRate:int = 100;
    var timer:Timer= new Timer (30);
    timer.start();
    timer.addEventListener(TimerEvent.TIMER, lowblur);

    function lowblur(event:TimerEvent):void{
    blurRate -= 5;
    imageLoader.filters = [new BlurFilter(blurRate,1,1 )];
    }
    }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center