How to get instanceName/Object from MouseEvent.target
Hello friends,
See I got three MovieClips
mcPlanet
mcPlanetOuter
mcPlanetInner
They are in the following fashion
mcPlanet
----->instance of mcPlanetOuter : PlanetEarthOuter_mc
----->instance of mcPlanetInner : PlanetEarthInner_mc
----->PlanetInner_txt(instance of dynamic Textfield)
instance of mcPlanet : PlanetEarth_mc.buttonMode = true
So if I move mcPlanet both mcPlanetOuter and mcPlanetInner and the PlanetInner_txt (mcPlanetInner) should move propotionately, because all of them is under mcPlanet
I set event Target like this,
PlanetEarth_mc.addEventListener(MouseEvent.MOUSE_DOWN, startMoving);
function startMoving(EventReceived:MouseEvent):void {
EventReceived.target.startDrag();
}
When Mouse is down on PlanetEarth_mc, only PlanetEarthOuter_mc starts moving, leaving PlanetEarthInner_mc and PlanetInner_txt in the same existing place.
I want to call the parent of the target i.e. I want to move PlanetEarth_mc.
also,
EventReceived.target.parent.startDrag(); //Gives Error.
Plz tell me How can I achieve that from received MouseEvent Object
I hope u understand this. Plz help me. This is my first post.
Thanks
Venkat.