duplicateMovieClip problem

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default duplicateMovieClip problem

    - I have a clip collection somewhere in my movie, adress stired in
    _global.Album
    - I have a clip elsewhere in the same movie where I want a copy of a clip
    inside the "collection" clip.

    I put traces. As I can see, the adress of the origine clip is fine, but it
    seems the new duplicated clip isn't instanced.

    Any help ?

    thanks

    ====== code ========
    function affiche( N ){
    removeMovieClip(1);
    duplicateMovieClip( Album+".Contenu"+N, "Photo", 1 );
    trace( N + " -> " + eval(Album+".Contenu"+N) );
    trace( N + " -> " + eval( "Photo" ) );
    }
    ==================

    ======output========
    0 -> _level0.instance1.Collection.Contenu0
    0 ->
    ==================

    --

    Pierre Alain

    [email]pie@lifnet.com[/email]



    PierreAlain Guest

  2. Similar Questions and Discussions

    1. DuplicateMovieClip in for() loop
      I've got a problem with DuplicateMovieClip in a loop : This code does not work : for(var i=0;i<result.length;i++){...
    2. duplicateMovieClip question
      Hi everybody, Sorry if this is a basic question, but I'm having issues with the duplicateMovieClip command. Using MX 2004 professional. The...
    3. duplicateMovieClip {help please}
      hello all, here is what i am tring to do. i want take the value of an array(value1) and apply that value to a movieClip(square) then duplicate the...
    4. Problem with stopDrag for DuplicateMovieClip
      Hi. This is my first time posting. I will appreciate any help given. I am currently working on a flash application to help train users for an...
    5. DuplicateMovieClip
      im trying to reference my duplicatemovieclips that i created and give them an "onpress" function. i am able to change the duplicates alpha and...
  3. #2

    Default Re: duplicateMovieClip problem

    Hi,

    just a quick look at your code and one thing that is obviously missing is a
    unique depth for each instance of the duplicated movieClip.

    also your format is possibly incorrect... it should be target,newInstance,depth

    try:

    function affiche( N ){
    uniqueDepth++; // or use N if that is a unique integer being passed to the
    function
    removeMovieClip(1);
    duplicateMovieClip( "Photo", Album+".Contenu"+N, uniqueDepth); //or N
    trace( N + " -> " + eval(Album+".Contenu"+N) );
    trace( N + " -> " + eval( "Photo" ) );
    }

    where Photo is the instance you are duplicating

    if this isn't what you want, let me know further... otherwise, you probably
    aren't needing a duplicateMovieClip more an attachMovie

    hope that helps,

    mandingo Guest

  4. #3

    Default Re: duplicateMovieClip problem

    Thanks for the reply, but it's not that :-(

    - I have a unique depth as this clip kind can only have one onject in it. I
    tried changing that but as I guessed, no better result.

    ====== code ========
    function affiche( N ){
    removeMovieClip(1);
    duplicateMovieClip( Album+".Contenu"+N, "Photo", 1 );
    trace( N + " -> " + eval(Album+".Contenu"+N) );
    trace( N + " -> " + eval( "Photo" ) );
    }
    ==================

    Album is a clip on another branch of the tree on level 1. It contains 10
    clips witch contains photos loaded with loadMovie. Those clips are named
    contenu0 up to Contenu9.

    The clip where the function is has to show one of the photos, which index it
    received as parameter.

    I don't use attachMovie as I have several clips in the movie which may need
    to show those pictures, and that those pictures may change. I have
    Photo0.jpg up to Photo9.jpg in the same directory. The loadMovie let me also
    have the first pictures loaded at the start of the movie, other ones (wich
    could then be numerous) have time to be loaded during the time the user look
    at the first ones.

    Anyway I don't understand why the object "Photo" isn't created as the trace
    shows as I even tried creating a clip "test" on _root, and tried

    duplicateMovieClip( _root.test, "photo", 1 );

    without success.

    --

    Pierre Alain

    [email]pie@lifnet.com[/email]


    "mandingo" <webforumsuser@macromedia.com> a écrit dans le message de
    news:c23527$16l$1@forums.macromedia.com...
    > Hi,
    >
    > just a quick look at your code and one thing that is obviously missing is
    a
    > unique depth for each instance of the duplicated movieClip.
    >
    > also your format is possibly incorrect... it should be
    target,newInstance,depth
    >
    > try:
    >
    > function affiche( N ){
    > uniqueDepth++; // or use N if that is a unique integer being passed to
    the
    > function
    > removeMovieClip(1);
    > duplicateMovieClip( "Photo", Album+".Contenu"+N, uniqueDepth); //or N
    > trace( N + " -> " + eval(Album+".Contenu"+N) );
    > trace( N + " -> " + eval( "Photo" ) );
    > }
    >
    > where Photo is the instance you are duplicating
    >
    > if this isn't what you want, let me know further... otherwise, you
    probably
    > aren't needing a duplicateMovieClip more an attachMovie
    >
    > hope that helps,
    >

    PierreAlain Guest

  5. #4

    Default Re: duplicateMovieClip problem

    okay,

    the duplicateMovieClip action is placing your instance of "Photo" on your
    timeline (hopefully) but you need to reference the location of this instance...
    try :

    trace(this);
    trace( N + " -> " + eval(this["Photo"]));

    see what you get...



    mandingo Guest

  6. #5

    Default Re: duplicateMovieClip problem

    I turn mad with that, and I bet it's just some stupid stuff.

    ok.
    - I set many traces
    - I display on screen the original clips, they are there
    - and it still doesn't work

    ===== code ====
    function affiche( N ){
    removeMovieClip(1);
    duplicateMovieClip( Album+".Contenu"+N, "Photo", 1 );

    trace( N + " orig -> " + eval(Album+".Contenu"+N) ); //####
    trace ( "this => " + this ); // ####
    trace( N + " dest -> " + eval( this[Photo] ) ); // ####
    trace( N + " existing -> " + eval( LaPhoto ) ); // ####
    }
    =============
    ==== trace =====
    3 orig -> _level0.instance1.Collection.Contenu3
    this => _level0.instance1.pages.p4.SupportPage.PagePhoto
    3 dest ->
    3 existing -> _level0.instance1.pages.p4.SupportPage.PagePhoto.L aPhoto
    ==============

    note: "LaPhoto" is a "normal" clip , not an actionScript one. It is used to get _x and _y for created ones.

    so "photo" isn't instanced :-(

    Thanks for your help !
    --

    Pierre Alain

    [email]pie@lifnet.com[/email]


    "mandingo" <webforumsuser@macromedia.com> a écrit dans le message de news:c23fci$det$1@forums.macromedia.com...
    > okay,
    >
    > the duplicateMovieClip action is placing your instance of "Photo" on your
    > timeline (hopefully) but you need to reference the location of this instance...
    > try :
    >
    > trace(this);
    > trace( N + " -> " + eval(this["Photo"]));
    >
    > see what you get...
    >
    >
    >
    PierreAlain Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139