I extarcted a number that I want to add on to a instance name to find the x of that mc
function checkHomePos() {
if (_root.pannelDrag) {
this.whatPanel = _root.currentPanelView;
n = Number(this.whatPanel.substring(1));
this.homeX=_root["bgP"+n]._x;
trace("BGP :" +_root["bgP"+n]);
trace("N :"+n);
trace("HOMEX :" +this.homeX);
}
}
_root.createEmptyMovieClip("menuChecker1", _root.depth++);
menuChecker1.onEnterFrame = checkHomePos;
Ok I have a variable [COLOR=red]n[/COLOR] which holds a number. Now I want to find the x position of the mc [COLOR=red]bgPn[/COLOR]
All my bgP clips are named bgP1 to bgP20 so I want to be able to us the number in [COLOR=red]n[/COLOR] to add on to the end of bgP so it will represent the bgP clip I need.