Ask a Question related to Macromedia Flash Actionscript, Design and Development.
-
PierreAlain #1
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
-
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++){... -
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... -
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... -
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... -
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... -
mandingo #2
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
-
PierreAlain #3
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...a> Hi,
>
> just a quick look at your code and one thing that is obviously missing istarget,newInstance,depth> unique depth for each instance of the duplicated movieClip.
>
> also your format is possibly incorrect... it should bethe>
> try:
>
> function affiche( N ){
> uniqueDepth++; // or use N if that is a unique integer being passed toprobably> 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> aren't needing a duplicateMovieClip more an attachMovie
>
> hope that helps,
>
PierreAlain Guest
-
mandingo #4
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
-
PierreAlain #5
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



Reply With Quote

