A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: duplicatemovieclip to popup window problem

  1. #1
    Junior Member
    Join Date
    Nov 2002
    Posts
    4

    duplicatemovieclip to popup window problem

    let me start off by saying im fairly new to actionscript.

    im trying to use the duplicatemovieclip function to allow the user to open up a draggable window when the button is released and it isnt working. i followed the instructions on a tutorial here: http://www.flashkit.com/tutorials/In...-596/index.php

    i was able to successfully create the dragging window, but i cant get the thing to popup when the button is clicked. the movieclip is called "window", the linkage is set up to export for actionscript and to export in first frame. i used the actionscript given in the tutorial:

    On (Release)
    Duplicate Movie Clip ("/window", "/window" & x, x)
    Set Variable: "x" = x + 1
    End On

    but that didnt work. so i tried this:

    on (release) {
    duplicateMovieClip("_root.window", "window", 1);
    }

    still no dice. not suprising considering i dont really know what im doing

    any assistance would be GREATLY appreciated. Thanks in Advance!

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Try

    on (release) {
    i = 1;
    _root.window.duplicateMovieClip("window" + i, i);
    i++; // add 1 to i
    }

    this will create clips named window1, window2 etc which are copies of an original clip with the instance name window which was placed on the main timeline each time it is pressed.

    Cool name btw

  3. #3
    Junior Member
    Join Date
    Nov 2002
    Posts
    4
    thanks for the compliment on the name, catbert!

    unfortunately, the code you gave me didnt work, and i know it should have. i wondered if i didnt have my button set up correctly so i dropped my movieclip "window" into its own scene and told the button to go to that scene when clicked. that worked. then i thought, ok, maybe the movieclip has to be on the stage somewhere for it to be duplicated. so i put it on the stage of my main scene on the end where the playhead never goes. that didnt work either.

    this is driving me nuts!!! help!!!

  4. #4
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    The movie clip you are trying to duplicate needs to be on the stage at the time you duplicate it (the same frame) note this can be off the edge of the visible area, so it doesn't have to be visible to the user.

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