AS syntax problem
- Started
- Last post
- 4 Responses
- goygoygoy
hi,
I 've that code :listeLettre = new Array("a", "b", "c", "d", "e", "f", "g");
for (i=0; i<7; i++) {
mask.duplicateMovieClip("mask"+i... i*100);
mcMask = eval("mask"+i);
mcMask.i = i;
mcMask._x = i*40;
mcMask.lettre = listeLettre[i];
}on a button in the duplicated mc I've:
on (rollOver) {
_parent.photo.a.setMask(_parent... }the ? is:
how can I replace the occurence _parent.photo.a
by a letter from the array?
so that each copy replace the "a" with the value of i in the array.note: the variable "lettre" takes a,b,c,d on each copy but I can't use it in the path _parent.photo.a
hum, can send the .fla if it's not clear
thanks in advance.
peace
- lostnation0
this.listeLettre = new Array("a", "b", "c", "d", "e", "f", "g");
for (i=0; i<7; i++) {
this.mask.duplicateMovieClip("ma... i*100);
this.mask["mask"+i].i = i;
this.mask["mask"+i]._x = i*40;
this.mask["mask"+i].l = this.listeLettre[i];
this.mask["mask"+i].onRollOver = function() {
_parent.photo[this.l].setMask(_p...
};
}
- goygoygoy0
thks for the help lostnation,
but apparently doesn't work.
>> the "this.mask["mask"+i] seems uncorrect....I keep trying with your method which surely is better than mine.
- lostnation0
>> the "this.mask["mask"+i] seems uncorrect.
that part of it should be right. its a relative reference to the dynamically generated mc for each iteration of the for loop. im just not sure what you're trying to do with the rollover?
send me the fla if you like.
- goygoygoy0
okay very kind, I send it when i've the explanation done of what i'm trying .