Make sure your holder Movie Clip has the instance name "holder" in the Properties panel... you're arrow_mc too... your code works for me...

----- Original Message ----- From: "Flash guru" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <[email protected]>
Sent: Tuesday, January 31, 2006 8:03 PM
Subject: [Flashcoders] scope question


Hey all,

Simple question that I just don't get. I have a simple movie clip of an
arrow and my code works fine when it's on stage. For some reason when i put
the movie clip in a holder clip my code doesn't work as it should. I know
it's a scope thing just don't know how to fix it. Delagate maybe?

any help would sweet thanks



//arrow_mc.onMouseMove = lookMouse;
holder.arrow_mc.onMouseMove = lookMouse;

//function that rotates any object that calls it toward the mouse position
function lookMouse(){
   updateAfterEvent();
   var xdiff:Number = _root._xmouse-this._x;
   var ydiff:Number = _root._ymouse-this._y;
   var angle:Number = Math.atan2(ydiff, xdiff);
   //Convert to degrees
   angle = angle*180/Math.PI;
   trace(angle);
   this._rotation = angle;
};
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to