I am guessing you need to do a deep copy
private function clone(source:Object):* {
        var copier:ByteArray = new ByteArray();
        copier.writeObject(source);
        copier.position = 0;
        return(copier.readObject());
        }
or use the ObjectUtil, if i understand you correctly. 


----- Original Message ----
From: flexawesome <[EMAIL PROTECTED]>
To: [email protected]
Sent: Saturday, May 17, 2008 5:16:15 PM
Subject: [flexcoders] Re: a simple question of BitmapData



Hi there, I have updated the code ( enabled line5 ) and get the 
duplicate copy of gif file. 

Is there a way to prevent to use addChild but still can get the copy 
of the image?

Cheers

http://www.privatep aste.com/ 29lCTCERRY

--- In [EMAIL PROTECTED] ups.com, "flexawesome" <flexawesome@ ...> 
wrote:
>
> Hi there,
> 
> do you know how can I use it to duplicate the image? It seems 
doesn't 
> work. any ideas?
> 
> Thank you
> 
> loader = new SWFLoader();
> loader.addEventList ener(Event. COMPLETE, Bitmapdata) 
> 
> loader.source 
= "http://us.i1. yimg.com/ us.yimg.com/ i/us/nt/ma/ ma_tech-
> grp_1.gif"
> //addChild(loader) ;
> 
> 
> private function oBitmapdata( e:Event): void
> {
> 
>       var img:Image = new Image();
>       var data:BitmapData = Bitmap(loader. content). bitmapData;
>       var bitmap:Bitmap = new Bitmap(data) ;
> 
>       img.addChild( bitmap)
> 
>       addChild(img) ;
> 
> }
>

    


      

Reply via email to