Re: [Flashcoders] Copy and paste a movieClip?

2007-09-08 Thread EECOLOR
Yes in AS3 you can move DisplayObjects to other parents without problems.
One thing to note is that you need to remove it from the current display
list before you add it to the other.

Something like this:

parent1.removeChild(theClip);
parent2.addChild(theClip);


Greetz Erik


On 9/6/07, T. Michael Keesey [EMAIL PROTECTED] wrote:

 On 9/6/07, Mendelsohn, Michael [EMAIL PROTECTED] wrote:
  Just as I suspected, Julian.  Thanks for your reply.  Doesn't this
  feature exist in AS3?  (I have no experience with it yet.)

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Copy and paste a movieClip?

2007-09-06 Thread Mendelsohn, Michael
Hi list...

[AS2]  I'm trying to figure out how to copy a movieClip from inside a
scroll pane component and paste that copy on the _root.  The movieclip
version of duplicateMovieClip doesn't seem to work because I can't
target the clip inside the scroll pane.  The global version of
duplicateMovieClip doesn't seem to work because I can't say
_root.duplicateMovieClip(target).  Am I missing something?

- Michael M.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Copy and paste a movieClip?

2007-09-06 Thread JulianG

Yes.
As far as I know you can't duplicate movieclips into a container other 
than the original one.
You could try attachMovie if you need to use the same movieclip symbol 
in different places.


In any case, when you duplicate a movieclip, you don't get a clone of 
the current state of the object. You get a new instance of the same 
symbol. This means (for instance) that it doesn't matter if your 
movieclip-to-be-cloned was playing around frame #30, your duplicated MC 
will always start from frame 1. And if you had set any variables on the 
first MC, the duplicated won't keep those values either.


I hope this helps,
JulianG



Mendelsohn, Michael wrote:

Hi list...

[AS2]  I'm trying to figure out how to copy a movieClip from inside a
scroll pane component and paste that copy on the _root.  The movieclip
version of duplicateMovieClip doesn't seem to work because I can't
target the clip inside the scroll pane.  The global version of
duplicateMovieClip doesn't seem to work because I can't say
_root.duplicateMovieClip(target).  Am I missing something?

- Michael M.
___
  

___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Copy and paste a movieClip?

2007-09-06 Thread Mendelsohn, Michael
Just as I suspected, Julian.  Thanks for your reply.  Doesn't this
feature exist in AS3?  (I have no experience with it yet.)

- MM




 As far as I know you can't duplicate movieclips into a container other

than the original one.
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Copy and paste a movieClip?

2007-09-06 Thread T. Michael Keesey
On 9/6/07, Mendelsohn, Michael [EMAIL PROTECTED] wrote:
 Just as I suspected, Julian.  Thanks for your reply.  Doesn't this
 feature exist in AS3?  (I have no experience with it yet.)

As I recall, duplication in AS2 wasn't really duplication--just
instantiation of the same symbol and its associated class. In AS3 you
can do the same thing a bit differently:

import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.utils.getDefinitionByName;
import flash.utils.getQualifiedClassName;

function duplicateDisplayObject(original:DisplayObject,
parent:DisplayObjectContainer, name:String):DisplayObject {
var originalClass:Class =
getDefinitionByName(getQualifiedClassName(original));
var duplicate:DisplayObject = new originalClass() as DisplayObject;
duplicate.name = name;
parent.addChild(duplicate);
return duplicate;
}

NOTE: I haven't tested this.
-- 
T. Michael Keesey
Director of Technology
Exopolis, Inc.
2894 Rowena Avenue Ste. B
Los Angeles, California 90039
--
The Dinosauricon: http://dino.lm.com
Parry  Carney: http://parryandcarney.com
ISPN Forum: http://www.phylonames.org/forum/
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com