Yup, there's no good automatic way.  I would probably add clone()
methods to the display objects I was interested in cloning, so they can
intelligently reproduce themselves

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of ben.clinkinbeard
Sent: Monday, December 17, 2007 7:13 AM
To: [email protected]
Subject: [flexcoders] Re: How to copy display objects?

 

99% sure its not possible to duplicate display objects

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "aceoohay" <[EMAIL PROTECTED]> wrote:
>
> I have a couple of display objects such as a panel and an HBox which 
> have a number of children. I would like to make a copy of them into 
> another container such as a VBox.
> 
> Everything I have tried thus far has been akin to a move. How does 
> one go about making a copy of two objects into a new container, 
> leaving the original objects alone?
> 
> What I would like would be sort of like;
> 
> var myVBox:VBox = new VBox;
> myVBox.addChild(new HBox(myHBox));
> myVBox.addChild(new Panel(myPanel));
> 
> or
> 
> var myVBox:VBox = new VBox;
> myVBox.addChild(myHBox.copy());
> myVBox.addChild(myPanel.copy());
> 
> var myVBox:VBox = new VBox;
> myVBox.addChild(myHBox.source);
> myVBox.addChild(myPanel.source);
> 
> Where myHBox and myPanel are existing objects with some children. I 
> know none of the above syntax is supported but I was hoping it might 
> make clear what I am trying to do.
> 
> I would appreciate any/all help in finding this answer.
> 
> Paul
>

 

Reply via email to