Hi there, I have a problem I can´t resolve, in the attached file there are 2 MC, I want to activate the ball_mc only when I´m over other MC. I tried multiple things but I can´t manage to find what is the problem, can you of the gurus take a look at it please.
thanks
//jagunco boy
system
March 4, 2003, 10:49pm
2
I don’t understand your code:
meover.onEnterFrame = function() { // WHAT IS MEOVER??
trace("olá");
var acceleration = 10;
var friction = .80;
maxX = 760;
minX = 0;
ball_mc.moveToMouse = function() { // BAD IDEA TO DECLARE A FCT LIKE THAT
var xdif = this.targetX-this._x;
this.xspeed += xdif/this._parent.acceleration;
this.xspeed *= this._parent.friction;
this._x += this.xspeed;
this.checkDistance();
};
ball_mc.checkDistance = function() {
if (Math.abs(this.targetX-this._x)<0.2) {
this._x = this.targetX;
}
};
ball_mc.onMouseMove = function() {
if ((_root._xmouse>=minX) && (_root._xmouse<=maxX)) {
//trace("olá");
this.targetX = this._parent._xmouse;
this.onEnterFrame = this.moveToMouse;
} else {
this.targetX = this._parent._x;
}
};
};
Can you explain a bit?
system
March 5, 2003, 8:22am
3
Hi there, I rebuild the file. I want to have the effect on the red square only happens when the mouse hits the blue square.
thanks for trying to help me
// jagunco