On 3/7/06, Richard Schutten <[EMAIL PROTECTED]> wrote:

> Here  is my example code,
>
> <?xml version="1.0"  encoding="utf-8"?>
> <mx:Application  xmlns:mx="http://www.macromedia.com/2005/mxml"; xmlns="*"  
> layout="absolute">
>  <mx:Script>
>   <![CDATA[
>    import  mx.controls.ProgressBar;
>    import  mx.controls.Image;
>    import  flash.events.*;
>    import  flash.display.*
>
>    private function  loadImage(url:String) : void  {
>
>     var  myloader:Loader = new  Loader();
>     addEventListeners(myloader);
>
>     var  myprogress:ProgressBar = new  ProgressBar();
>     myprogress.source =  myloader;
>     myvbox.addChild(myprogress);
>
>     var  myurlrequest:URLRequest = new  URLRequest(url);
>     myloader.load(myurlrequest);
>    }
>
>    private  function addEventListeners(ldr:Loader) : void  {
>     ldr.addEventListener(Event.COMPLETE,  handleComplete);
>    }
>
>    private  function handleComplete(event:Event) : void  {
>
>     var myimage:Image = new  Image();
>     var ldr2:flash.display.Loader =  flash.display.Loader(event.target);
>     myimage.load(ldr2.content);
>
>     myvbox.addChild(myimage);
>    }
>
>   ]]>
>  </mx:Script>
>
>  <mx:VBox  id="myvbox">
>   <mx:Button label="load"  click="loadImage(>>THE URL OF  IMAGE<<)"/>
>  </mx:VBox>
> </mx:Application>

Why are you doing this in 2 steps?  Why not just use Image directly
and assign its "source" property?

Anyway - no, Flex does not download the image again.  If the browser
has cached it, Flex gets the cached version.

Manish


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to