PDA

View Full Version : quick AS var name help



mlk
July 24th, 2003, 09:49 AM
function changephoto(photonumber) {
for (i=1; i<9; i++) {
_root.backgroundd.["im"+i].gotoAndStop(photonumber);
}
}


why doesn't this work ???
(ie the function is supposed to go to a special frame in each im1..im2..im3 of the backgroundd MC...

but the debuuger tells me:


Scene=Scene 1, Layer=Layer 5, Frame=1: Line 5: Expected a field name after '.' operator.
_root.backgroundd.["im"+i].gotoAndStop(photonumber);


thnx
mlk

pom
July 24th, 2003, 10:31 AM
There's no dot before the []:
function changephoto(photonumber) {
for (i=1; i<9; i++) {
_root.backgroundd["im"+i].gotoAndStop(photonumber);
}
}Theer's an excellent thread by Senocular about that, but I can't find it for the moment :-\

λ
July 24th, 2003, 10:45 AM
Ilyas, this wouldn't be the thread you were looking for would it?

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=12082#post85182

mlk
July 24th, 2003, 11:10 AM
thnx luv ya =)

pom
July 24th, 2003, 12:11 PM
Exactly, njs! This thread should definitely be turned into a tutorial...

thoriphes
July 24th, 2003, 12:29 PM
:bad:

pom
July 24th, 2003, 12:31 PM
:crazy: yes?

thoriphes
July 24th, 2003, 12:36 PM
:whistle: