[Flashcoders] DuplicateMovieClip - type mismatch error
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
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
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
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
Re: [Flashcoders] duplicateMovieClip() ?
I can invoke this function in my Scene. function alot(max) { var basename:String = circle_mc; for (var i = 0; imax; i++) { _root.it_mc.duplicateMovieClip(basename+i, this.getNextHighestDepth ()); _root[basename+i]._x = 100+i*5; _root[basename+i]._y = 100+i*5; } } alot(5); it_mc is a MovieClip on the Scene. 2006/3/13, Edward Hotchkiss [EMAIL PROTECTED]: hmm ... // begin code function alot(max) { var basename:String = circle_mc; for(var i = 0; i max; i++) { _root.it_mc.duplicateMovieClip(basename+i, this.getNextHighestDepth() ); _root[basename+i]._x = 100 + i*5; _root[basename+i]._y = 100 + i*5; } } the trace returns 0. why are my dynamically duplicated movieclips not showing up on the stage??? -eddie ___ 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 -- 亲爱的朋友,祝你天天快了! http://www.flashpixy.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
[Flashcoders] duplicateMovieClip() ?
hmm ... // begin code function alot(max) { var basename:String = circle_mc; for(var i = 0; i max; i++) { _root.it_mc.duplicateMovieClip(basename+i, this.getNextHighestDepth() ); _root[basename+i]._x = 100 + i*5; _root[basename+i]._y = 100 + i*5; } } the trace returns 0. why are my dynamically duplicated movieclips not showing up on the stage??? -eddie ___ 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] duplicateMovieClip question
The snippet below takes one clip and duplicate it in rows and columns - simple stuff. _root.attachMovie(seat,seat_mc,_root.getNextHighestDepth(),{_x:-1000,_y:0}); function createSeats (xSpacing:Number,ySpacing:Number,rows:Number,cols:Number) { var xSpacing:Number = xSpacing; var ySpacing:Number = ySpacing; var xStart:Number = 10; var yStart:Number = 30; var v:Number = 0; var i:Number = -1; // specified by the user var rows:Number = rows; var cols:Number = cols; while (++i cols) { var j:Number = -1; while (++j rows) { ++v; var name:String = seat + v; _root[seats].duplicateMovieClip (name, v); _root[name]._x = xStart + i * xSpacing; _root[name]._y = yStart + j * ySpacing; } } } createSeats(10,10,7,20); Now rather than the final result being duplicated in rows and cols like a square or a box, I'd like to let the user decide the amount of angle to the left or right , so as to give it a perspective or skewed look - if that makes any sense. Please see the attached gifs for a better explanation. Any help appreciated. /Johan ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] duplicateMovieClip question
Johan, The list does not accept attachments, so your gifs didn't come through. It isn't clear to me what kind of rotation you're looking for -- the same applied to every clip, or something else. Please post the gifs to a URL, or send a more thorough description of what you need to happen. - Marc At 09:13 AM 1/4/2006, you wrote: The snippet below takes one clip and duplicate it in rows and columns - simple stuff. _root.attachMovie(seat,seat_mc,_root.getNextHighestDepth(),{_x:-1000,_y:0}); function createSeats (xSpacing:Number,ySpacing:Number,rows:Number,cols:Number) { var xSpacing:Number = xSpacing; var ySpacing:Number = ySpacing; var xStart:Number = 10; var yStart:Number = 30; var v:Number = 0; var i:Number = -1; // specified by the user var rows:Number = rows; var cols:Number = cols; while (++i cols) { var j:Number = -1; while (++j rows) { ++v; var name:String = seat + v; _root[seats].duplicateMovieClip (name, v); _root[name]._x = xStart + i * xSpacing; _root[name]._y = yStart + j * ySpacing; } } } createSeats(10,10,7,20); Now rather than the final result being duplicated in rows and cols like a square or a box, I'd like to let the user decide the amount of angle to the left or right , so as to give it a perspective or skewed look - if that makes any sense. Please see the attached gifs for a better explanation. Any help appreciated. /Johan ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders