[Flashcoders] DuplicateMovieClip - type mismatch error

2006-04-18 Thread David Farrell

Hi all,

I'm trying to duplicate a clip and I'm getting a type mismatch error.  
Undoubtedly it's something silly but I'm not getting anywhere fast.


I have a flash movie with a .as file attached.  In the .as file, I want 
to copy a movie clip.

Inside the _customerArt array are two MovieClips

This is the code here:

   *_currentCustomer = _customerArt[customerType];
   createEmptyMovieClip(_newCustomer, getNextHighestDepth());
   //duplicateMovieClip(_currentCustomer, _newCustomer,  
this.getNextHighestDepth());
  
   trace(_currentCustomer = [+_currentCustomer+] and 
_newCustomer = [+_newCustomer+]);

*
two things, the duplicate line is only commented out to allow the trace 
to work (the mismatch stops execution) the trace outputs the following:


   *   _currentCustomer = [_level0.mcDavid] and _newCustomer = 
[_level0.mcSalesScreen._newCustomer]*


I have tried creating the empty clip and not creating it - no 
difference.  Both _currentCustomer and _newCustomer are vars declared at 
the top of the class.


Any idea why I'm getting a type mismatch?

Docs say:

   *duplicateMo**vieClip(target:String, newname:String, depth:Number) : 
Void *


looks to me like I'm using two strings and a number.

i have tried this definition:

*duplicateMovieClip(target:MovieClip, newname:String, depth:Number) 
: Void*


and I have also tried

*_newCustomer = this.duplicateMovieClip(_currentCustomer, 
this.getNextHighestDepth());*


But that's not working either.

Any ideas?

Cheers

David
___
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] DuplicateMovieClip - type mismatch error

2006-04-18 Thread David Farrell

Hi all,

I'm looking into this further and although I don't have a solution - I 
have a bit more info.


The following code creates a duplicate of my movie clip:

   *var testClip:MovieClip;
   var david:MovieClip = _customerArt[0];
   testClip = david.duplicateMovieClip(testClip, 
getNextHighestDepth());*


when I put it on frame 0 of my movie

But when I move it to an actionscript file it stops working.

now, I know my _customerArt[0] movie clip IS being loaded into 'var 
david' because when I move it's _x around, it behaves accordingly.


So, why is it that the movie clip doesn't create a duplicate when inside 
a function in an actionscript file?


David
  
___

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] DuplicateMovieClip - type mismatch error

2006-04-18 Thread p G
Try doing this ..

var testClip:MovieClip;
var david:MovieClip = _customerArt[0];
testClip = david.duplicateMovieClip(testClip, this.getNextHighestDepth());





On 4/18/06, David Farrell [EMAIL PROTECTED] wrote:

 Hi all,

 I'm looking into this further and although I don't have a solution - I
 have a bit more info.

 The following code creates a duplicate of my movie clip:

*var testClip:MovieClip;
var david:MovieClip = _customerArt[0];
testClip = david.duplicateMovieClip(testClip,
 getNextHighestDepth());*

 when I put it on frame 0 of my movie

 But when I move it to an actionscript file it stops working.

 now, I know my _customerArt[0] movie clip IS being loaded into 'var
 david' because when I move it's _x around, it behaves accordingly.

 So, why is it that the movie clip doesn't create a duplicate when inside
 a function in an actionscript file?

 David

 ___
 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@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] DuplicateMovieClip - type mismatch error

2006-04-18 Thread David Farrell

It does nothing.

I don't see what you suggested differently to what I was already doing?  
The asterix in my code was my email client's way of demonstrating bold.



___
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