-
OnPress & duplicateMovieClip
On "layer 1" I have a button with the following code.
button1.onPress = function() {
duplicateMovieClip(_root.Circle_mov,"test1",2);
setProperty ("test1", _x, random(275));
setProperty ("test1", _y, random(275));
trace ("here I am");
};
In my libary I have a movieclip called "circle_mov"
I am expecting that when I click on the button an instance of "circle_mov" is created on layer 1. This does not happen.
Any clue as to why this does not work.
thanks in advance.
Last edited by star1210; 02-13-2006 at 03:28 PM.
Reason: did not complete
-
To put something in the your flash document from the library don't you use attachMovieClip()? What you're doing is trying to duplicating circle_mov but to duplicate it you need it somewhere on your Flash document, because it's where the duplicateMovieClip code looks at.
-
You are right, when I created an instance of circle_mov on my layer 1 , duplicateMovieClip worked. However, in my application I want to copy from the Libary.
I tried the following as suggested but it did not work, can someplease help.
button1.onPress = function() {
attachMovie("Circle_mov", "test1", 6);
test1._x = 50;
test1._y = 150;
trace ("here I am");
}
-
Do you have the correct linkage ID for the clip set in the library?
K.
-
K
I am new to this. How would I check ?
-
Right click the clip in the library and choose Properties or Linkage.
You need to give it a linkage ID that is the same as the first parameter in the attachMovie call...
K.
-
K
Thanks for throwing me the lifeline
that worked.
Mal
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|