Hi guys I’m trying to change this piece of code to AS3 and am having problems with the _root from AS2. The code changes the position of movie clip if there is no mouse movement for 20 sec’s. any help with translation would be greatly appreciated.
//BACK TO START TIMEOUT
function idleTime( ) {
// Play the attract animation
//trace(“playing the animation”)
var titleTween:Tween = new Tween (bigMc,"x", Strong.easeOut, bigMc.x, 600, 2, true);
var titleTween:Tween = new Tween (bigMc,"y", Strong.easeOut, bigMc.y, 400, 2, true);
//titleTween.onMotionFinished = function () {
//menuMC._y = 543;
//newx = 600;
//newy = 400;
//}
}
function idleS( ) {
// See if there has been any mouse movement in the last two seconds
if ((_root._xmouse + _root._ymouse) != mousePos) {
// If there has, restart the check for the idle timer
//trace("resetting");
clearInterval(idle);
idle = setInterval(idleTime, 20000);
//} else {
//trace("no movement this period");
}
// Store an integer representing the mouse position
mousePos = _root._xmouse + _root._ymouse;
}
function startIdle( ) {
mousePos = -100000; // Initialize it to a dummy value
idleSample = setInterval(idleS, 2000);
}
startIdle( );
stop( );
Thanks In Advance.