Artanist
08-07-2006, 12:52 AM
Hello guys, I'm new to this forum and I'm trying to learn the actionscript via youre great tutorials. Sorry if my english is bad, it just that I am from Quebec and it's a french province of Canada (the only one too thought ...).
So my problem is that I'm trying to duplicate a MC via a button and make them start at the frame number 2 when they appear. So I use a variable named "count" to make multiple duplication, but they only appear at the frame one even thought I use a relative path.
on(release) {
count = count + 1;
setProperty("Box",_alpha,50);
duplicateMovieClip("Box","Box" add count, count);
setProperty("Box" add count,_x,random(400));
setProperty("Box" add count,_y,random(400));
setProperty("Box" add count,_xscale,random(100));
setProperty("Box" add count,_yscale,random(100));
_level0.Box add count.gotoAndPlay(2)
}
My path work perfectly, because I try this code "_level0.Box1.gotoAndPlay(2)" and it worked with the first dupplication. So my question is, is it possible to make a path with an instance name who is generate with a variable linked with a concatenation value ?
Thank you for answering and I hope you understand me even if I'm not perfectly bilingual.
So my problem is that I'm trying to duplicate a MC via a button and make them start at the frame number 2 when they appear. So I use a variable named "count" to make multiple duplication, but they only appear at the frame one even thought I use a relative path.
on(release) {
count = count + 1;
setProperty("Box",_alpha,50);
duplicateMovieClip("Box","Box" add count, count);
setProperty("Box" add count,_x,random(400));
setProperty("Box" add count,_y,random(400));
setProperty("Box" add count,_xscale,random(100));
setProperty("Box" add count,_yscale,random(100));
_level0.Box add count.gotoAndPlay(2)
}
My path work perfectly, because I try this code "_level0.Box1.gotoAndPlay(2)" and it worked with the first dupplication. So my question is, is it possible to make a path with an instance name who is generate with a variable linked with a concatenation value ?
Thank you for answering and I hope you understand me even if I'm not perfectly bilingual.