this ex. .fla controls the mc from itself but i would like to control it from the main timeline, ive tried a number of things but cant seam to get it to work
the .fla is here.
and the code is here if you dont dl the .fla:
onClipEvent (load)
{
var speed = new Number(0);
_root.createEmptyMovieClip("drawing", 1);
this.swapDepths(_root.drawing);
_root.clearBtn.swapDepths(this);
hi = Math.sin(_rotation * 1.745329E-002) * 10;
ip = Math.cos(_rotation * 1.745329E-002) * 10;
iks = _x - ip;
ips = _y - hi;
iks2 = _x + ip;
ips2 = _y + hi;
}
onClipEvent (enterFrame)
{
if (Key.isDown(38) & !Key.isDown(17))
{
speed = speed + 1.500000E+000;
} // end if
if (Key.isDown(40) & !Key.isDown(17))
{
speed = speed - 7.500000E-001;
} // end if
if (Key.isDown(17))
{
speed = speed - speed / 10;
if (Key.isDown(39))
{
setProperty("", _rotation, _rotation + speed / 2);
} // end if
if (Key.isDown(37))
{
setProperty("", _rotation, _rotation - speed / 2);
} // end if
} // end if
if (Key.isDown(39))
{
if (speed < 5 && speed >= 0)
{
setProperty("", _rotation, _rotation + 2 * speed);
}
else if (speed < 0)
{
setProperty("", _rotation, _rotation + 7.500000E+000 * speed / 15);
}
else
{
setProperty("", _rotation, _rotation + 7.500000E+000);
} // end else if
speed = speed * 9.500000E-001;
} // end if
if (Key.isDown(37))
{
if (speed < 5 && speed >= 0)
{
setProperty("", _rotation, _rotation - 2 * speed);
}
else if (speed < 0)
{
setProperty("", _rotation, _rotation - 7.500000E+000 * speed / 15);
}
else
{
setProperty("", _rotation, _rotation - 7.500000E+000);
} // end else if
speed = speed * 9.500000E-001;
} // end if
if (Math.abs(speed) > 20)
{
speed = 20;
} // end if
if (speed < -10)
{
speed = -10;
} // end if
speed = speed * 9.800000E-001;
g = Math.sin(_rotation * 1.745329E-002) * speed;
m = Math.cos(_rotation * 1.745329E-002) * -speed;
setProperty("", _x, _x + g);
setProperty("", _y, _y + m);
hi = Math.sin(_rotation * 1.745329E-002) * 10;
ip = Math.cos(_rotation * 1.745329E-002) * 10;
_root.k1 = hi;
_root.k2 = ip;
if (Key.isDown(17))
{
_root.drawing.lineStyle(3, 14540253, 100);
}
else
{
_root.drawing.lineStyle(3, 15658734, 100);
} // end else if
_root.drawing.moveTo(iks, ips);
_root.drawing.lineTo(_x - ip, _y - hi);
_root.drawing.moveTo(iks2, ips2);
_root.drawing.lineTo(_x + ip, _y + hi);
iks = _x - ip;
ips = _y - hi;
iks2 = _x + ip;
ips2 = _y + hi;
}
thank you
-joey