A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] Load external images from as class

  1. #1
    Junior Member
    Join Date
    Dec 2011
    Location
    Villefranche-sur-mer
    Posts
    8

    resolved [RESOLVED] Load external images from as class

    I cannot seem to "convert" the loadImage into a dynamic field. I am making an mp3 player and have added a cover art portion, I can only figure out how to call a single static image. However I want to to be able to call from this image from my xml file:
    items[currentID].art

    Here is the original single static image loading code.
    Actionscript Code:
    var tSm:String = "easeOutElastic";
                    var tIm:Number = 2;
                    var imageLoader:Loader;
                    function loadImage(Iurl:String):void
                    {
                        // Set properties on my Loader object
                        imageLoader = new Loader();
                        imageLoader.load(new URLRequest(Iurl));
                        imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading);
                        imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
                    }
                    loadImage("asset/Give Up.jpg");
             
                    function imageLoaded(e:Event):void
                    {
                        // Load Image
                        spectrumArea.coverArt.albumArt.addChild(imageLoader);
                        spectrumArea.coverArt.bufferClip.visible = false;
                        Tweener.addTween(spectrumArea.coverArt.albumArt, {width:64, time:tIm, transition:tSm});
                        Tweener.addTween(spectrumArea.coverArt.albumArt, {height:64, time:tIm, transition:tSm});
                    }
       
                    function imageLoading(e:ProgressEvent):void
                    {
                        spectrumArea.coverArt.bufferClip.visible = true;
                    }
    Please help.

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    None of that code deals with xml at all. How do you expect us to help?

    You will need to call loadImage with the desired URL when you have received it from the xml.

  3. #3
    Junior Member
    Join Date
    Dec 2011
    Location
    Villefranche-sur-mer
    Posts
    8

    resolved

    Actually I just solved it. Thank you for your help though.

Tags for this Thread

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