Hi,
How do I move a graphic symbol along a motion guide dynamically. The guide is on a lyer of an mc residing on the _root. The graphic symbol is just below on another layer. The effect is to have the graphic symbol (a ball) appear to move randomly from the start of the motion guide a random distance along the motion guide and then change directions randomly. So the symbol would move a random number of points in one direction along the path then change direction and move a random number of points in the other direction while never actually leaving the stage.
The motion guide is NOT to be removed or drawn dynamically as it is the exact shape of the landscape in an image I use in the background of the overall animation so either the timeline needs to be manipulated for that mc or the symbol that is moving along the motion guide needs to be directed along the path dynamically.
I tried the following code which I placed in the first frame of an action layer of the mc (mc resides _root) just above motion guide layer and it did not solve:(
_root.dot_ball_main_mc.onEnterFrame = function () {
var myVar:Number = Math.random()*(1-30)+30;
if (_root.dot_ball_main_mc._currentframe == myVar){
_root.dot_ball_main_mc.direction = “rev”;
}
}
I then tried placing the following code in the actions for the MC itself with not luck:(
onClipEvent (enterFrame) {
var myVar:Number = Math.random()*(1-30)+30;
if (_root.dot_ball_main_mc._currentframe == myVar){
_root.dot_ball_main_mc.direction = “rev”;
}
}
Any help solving is greatly appreciated as cant find any good examples of!!
JD - What envelope?