msukow
asked on
AS3 Target an active Movieclip / Sprite
I have been able to dynamically add a textfield to the stage and can drag / drop. I have a button on the stage that when clicked, should center the MovieClip / Sprite horizontally. The problem is that the following code targets the button clicked (which makes sense):
private function centerHorizontally(e:Mouse Event):voi d {
var thisSprite:Sprite = e.target.parent;
trace(thisSprite.x);
}
private function centerHorizontally(e:Mouse
var thisSprite:Sprite = e.target.parent;
trace(thisSprite.x);
}
ASKER
My document class name is CoreModule.as.
I tried the following but no good:
CoreModule.root.movieclipn ame.x;
and
(CoreModule).root.moviecli pname.x;
I tried the following but no good:
CoreModule.root.movieclipn
and
(CoreModule).root.moviecli
can you upload your files. will be easier to debug and check it that way.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is incomplete because the project is now on hold.
do you have a document class?
if so you can do the following
(DocumentClassName)root.mo