A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [f8] is it possible to duplicate to a specific frame?

  1. #1
    Junior Member
    Join Date
    Aug 2005
    Posts
    22

    [f8] is it possible to duplicate to a specific frame?

    i apologize in advance if this has already been answered. i have done about 20 minutes of searching and found nothing.

    i have a movieclip (called mistletoeinstance) that i want to duplicate on my stage. however the first frame of this mc is blank, so when it duplicates you can't see it. is it possible to duplicate a mc and have it start on frame 2?

    this is the code i'm using:
    Code:
    on (release) {
    
    	//Duplicate Movieclip Behavior
    	//Requires Flash Player 7 or later
    	var newdepth = this.mistletoeinstance._parent.getNextHighestDepth();
    	var newname = "copy" + newdepth;
    	var prevname = "copy" + (newdepth-1);
    	if (this.mistletoeinstance._parent[prevname] == undefined) this.mistletoeinstance._parent[prevname] = this.mistletoeinstance;
    	this.mistletoeinstance.duplicateMovieClip(newname,newdepth);
    	this.mistletoeinstance._parent[newname]._x = this.mistletoeinstance._parent[prevname]._x + 10;
    	this.mistletoeinstance._parent[newname]._y = this.mistletoeinstance._parent[prevname]._y + 10;
    	//End Behavior
    
    }

  2. #2
    Registered User greenham's Avatar
    Join Date
    Mar 2005
    Location
    Australia
    Posts
    555
    Try adding this to your code:

    Code:
    this.mistletoeinstance._parent[newname].gotoAndPlay(2);

  3. #3
    Junior Member
    Join Date
    Aug 2005
    Posts
    22
    Thanks Greenham!
    i was all set to write back "of course i've already tried that *smirk*" but i was trying to change the existing code. Dropping that line just before the last two lines of code did the trick. Now i just have to try to figure out WHY it worked, and i'll be ahead of the game : )

    thanks again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center