InvaderPiotr
02-19-2003, 07:35 PM
Hello everyone, this is my first post.
I'm a bit of a Flash n00b... :)
I'm trying to make a set of buttons out of MCs that I am duplicating on the screen using the attachMovie command. They show up fine except for when I try and use a dynamic text field inside the MC to number them (so they show up as 1, 2, 3, 4, etc...) This is going to eventually be a slideshow, but I'm starting small (I'm sure I'll be asking many questions along the way).
So, in my test-file, I have an MC named 'mc', which I specify in the linkage. Inside the MC, the dynamic text field is named "..:i" (not simply "i", which didn't work - why is that? Is there a different syntax for variable names inside the dynamic text field I have to use?) and the script that copies the MC on the stage is:
for (var i=0; i<=5; i++) {
this.attachMovie ("mc", "mc"+i, i);
this["mc"+i]._x = i * 50;
this["mc"+i]._y = 100;
trace (i);
}
...this makes five instances of the mc but they are all numbered '6'. The trace returns values of 1-5, so what am I doing wrong, and how could I get them to be numbered 1-5? And what's the deal with the ..: before the variable name (I got it from someone's .fla and the textfield wouldn't display anything without it)...
Many thanks in advance,
Piotr
I'm a bit of a Flash n00b... :)
I'm trying to make a set of buttons out of MCs that I am duplicating on the screen using the attachMovie command. They show up fine except for when I try and use a dynamic text field inside the MC to number them (so they show up as 1, 2, 3, 4, etc...) This is going to eventually be a slideshow, but I'm starting small (I'm sure I'll be asking many questions along the way).
So, in my test-file, I have an MC named 'mc', which I specify in the linkage. Inside the MC, the dynamic text field is named "..:i" (not simply "i", which didn't work - why is that? Is there a different syntax for variable names inside the dynamic text field I have to use?) and the script that copies the MC on the stage is:
for (var i=0; i<=5; i++) {
this.attachMovie ("mc", "mc"+i, i);
this["mc"+i]._x = i * 50;
this["mc"+i]._y = 100;
trace (i);
}
...this makes five instances of the mc but they are all numbered '6'. The trace returns values of 1-5, so what am I doing wrong, and how could I get them to be numbered 1-5? And what's the deal with the ..: before the variable name (I got it from someone's .fla and the textfield wouldn't display anything without it)...
Many thanks in advance,
Piotr