-
What's the matter with this code
This is REALLY weird. This code works in the original movie but not in a new one if I copy and paste the frames. The original was not in MX....thoughts???
//frame one
Xpos = _xmouse;
Ypos = _ymouse;
circX = circle._x;
circY = circle._y;
x = Xpos-circX;
y = Ypos-circY;
radius = "60";
angle = speed;
speed = angle+(x/3000);
dot._x = ((radius)*Math.tan(speed))+circX;
dot._y = ((radius)*Math.cos(speed))+circY;
//frame two
gotoAndPlay(1);
Makes a number of rectangles move in a wave pattern when the mouse moves.
thoughts???
Blue
-
Professional Air Guitarist
This probably won't solve it, but for simplicity's sake, remove the parentheses around radius in dot._x = ((radius)*Math.tan(speed))+circX; and dot._y = ((radius)*Math.cos(speed))+circY;
Also, instead of having two frames, try this:
code:
_root.onEnterFrame = function () {
Xpos = _xmouse;
Ypos = _ymouse;
circX = circle._x;
circY = circle._y;
x = Xpos-circX;
y = Ypos-circY;
radius = "60";
angle = speed;
speed = angle+(x/3000);
dot._x = ((radius)*Math.tan(speed))+circX;
dot._y = ((radius)*Math.cos(speed))+circY;
}
Please inform on the results
-
Have you given speed a value? Othjerwise it will be undefined and your script will fail.
angle = speed;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|