<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; layout="absolute">
 
 <mx:Script>
  <![CDATA[
   
   private function origCompleteHandler(evt:Event):void {
    trace("Application ::: origCompleteHandler")
    var target:Image = evt.currentTarget as Image;
    trace("    - target: "+target);
    // grab image
    var bmp:Bitmap = target.content as Bitmap;
    // grab image bitmapdata
    var bmd:BitmapData = bmp.bitmapData;
    // use bitmapdata as source of Image component
    copyImg.source = new Bitmap(bmd);
   }
   
  ]]>
 </mx:Script>
 
 <mx:HBox>
  <mx:Image id="origImg" source="images/risotto010.jpg" 
complete="origCompleteHandler(event);" />
  <mx:Image id="copyImg" />
 </mx:HBox>
 
</mx:Application>

----- Original Message ----- 
From: "dorkie dork from dorktown" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, November 08, 2007 10:51 PM
Subject: [flexcoders]Duplicate Image


> I'm having a hard time figuring out how to duplicate an Image. Not a bitmap.
> 
> 
> I have an image tag like this:
> <mx:Image x="10" y="10" source="images/resizeGrip.png" id="resizeGrip"/>
> 
> How would I make duplicates, their own instances, of this image in code?
>


--
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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> 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