Quick AS var name help


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

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 :-\

Ilyas, this wouldn’t be the thread you were looking for would it?

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

thnx luv ya =)

Exactly, njs! This thread should definitely be turned into a tutorial…

:bad:

:crazy: yes?

:whistle: