Dave,
You can work around the problem by attaching a MovieClip and passing enough
information to the newly created clip to make a simple copy. It's not
perfect and depending on how complicated your clip is, you might want to
try;
var copy = copyMovieClip ( mc, mc, 'box', 'copy' );
copy.initializeCopy ();
You get the idea...
// ORIGINAL
var mc = this.attachMovie ( 'box', 'mc', this.getNextHighestDepth() );
mc._x = 50
mc._y = 50
mc.prop = 'this is a prop'
// COPY
var copy = copyMovieClip ( mc, mc, 'box', 'copy' );
// FUNCTION
function copyMovieClip ( mc, newParent, linkageID, newName )
{
var ini = {
_x: mc._x,
_y: mc._y,
_width: mc._width,
_height: mc._height,
_xscale: mc._xscale,
_yscale: mc._yscale
}
for(var i in mc) ini[i]=mc[i];
var newmc = newParent.attachMovie ( linkageID, newName,
newParent.getNextHighestDepth(), ini );
return newmc;
}
// OUTPUT
trace( 'mc: ' + mc )
for(var i in mc) trace('\tmc.' + i + ' = ' + mc[i]);
trace( '\ncopy: ' + copy )
for(var i in copy) trace('\tcopy.' + i + ' = ' + copy[i]);
//////////////////////////////////////////////////
mc: _level0.mc
mc.prop = this is a prop
mc.copy = _level0.mc.copy
copy: _level0.mc.copy
copy.prop = this is a prop
_____________________________
Jesse Graupmann
www.jessegraupmann.com
www.justgooddesign.com/blog/
_____________________________
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David Cohn
Sent: Wednesday, June 06, 2007 9:18 AM
To: [email protected]
Subject: Re: [Flashcoders] MovieClips and levels
Patrick,
Thanks-- that's what I thought.
I'd actually tried Bitmaps first, but they weren't working for me in
this case...
Time to move on to CS3!
Thanks again,
--Dave
> No. You can make a bitmap copy then attachBitmap.
>
> I'd suggest getting into Flash CS3 and/or Flex. Goodbye to the old
> movieclip levels. It was so difficult to manage.
>
> Cheers
> Patrick
> On Jun 5, 2007, at 6:13 PM, David Cohn wrote:
>
>> Hey all,
>>
>> Is there a way to "transfer", or copy, a movieClip between levels?
>> I'd like to do something like:
>>
>> var mc = somelevel.createEmptyMovieClip(..);
>>
>> ...and then have the root be able to access it:
>>
>> _root.copyMovieClip( mc ) or _root.attachMovieByReference( mc )
>>
>> ...is this possible? Or am I overlooking something simple?
>>
>> Thanks,
>> --Dave
_______________________________________________
[email protected]
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