|
-
Duplicating variables, how?
Hi,
I'm trying to make copies of something, but all I manage to do is make a reference (which is most annoying).
For example, with the following code:
var sprite1:Sprite = new Sprite();
var sprite2:Sprite = sprite1;
var sprite3:Sprite = sprite1;
As you all know, since it only makes references rather then make copies, fiddling with sprite2 will chance sprite1 & 3... so how can I make new instances of an existing variable and not mere references? So that when I change something to sprite2, it doesn't affect sprite1&3?
Thanks in advance, Sid1120
-
Senior Member
The short answer is there's no easy way. You really have to invoke whatever drawing function you're using every time you create a new Sprite. See this thread for more details:
http://www.actionscript.org/forums/a.../t-113072.html
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|