Function problem....Claudio?

Hi,

Let me set the scene for what i have:

In a button (nested within a movie clip):

on(release) {

openWin(70, 50, “about”);

}


In a frame on the main timeline:

MovieClip.prototype.openWin(locX, locY, winName) {

_root.winName._x = locX;
_root.winName._y = locY;

}


On the main timeline i have an instance of a MC called about_mc.
So when I click on the button i pass these values in the parameters:

openWin(70, 50, “about_mc”);

Therefore I thought that winName wouble be equal to the value about_mc.
And thus I thought _root.winName._x would work.
But it doesnt.

It works fine if I just put in _root.about_mc._x.
What seems to be happening is that winName isnt the object in the timeline. I used trace to look at the value and indeed it is about_mc.

So my question is how to pass an instance of a symbol in the parameters?

Thanks to anyone who read through, a bigger thanks to anyone who helps,

Viru.

Its ok, thanks to anyone who comes and has a look but i’ve fixed it.

Regards,
Viru.

did you do something like this…


MovieClip.prototype.openWin(locX, locY, winName) {

_root[winName]._x = locX;
_root[winName]._y = locY;

}

=) just curious =)

Yes.

Viru.