Skip to main content
June 14, 2006
Answered

need help with rollOver

I am trying to get an image to move when a user hovers over the image.
My movie is called ball_mc
i have added this code but get some errors. what am i doing wrong please?

myButton_btn.onRollOver = function() {
tweenBall(mx.transitions.easing.Bounce.easeOut);
};
function tweenBall(easeType) {
var begin = 20;
var end = 380;
var time = 20;
var mc = ball_mc;
ballTween = new mx.transitions.Tween(mc, "_x", easeType, begin, end, time);
}


cheers
jez
This topic is closed to new replies. Start a new post to keep the conversation going.
Peter LorentCorrect answer
Inspiring
June 15, 2006
>>which is a movie clip called myBall_mc
But in the code you refer to:
var mc = ball_mc;
So that line should be:
var mc = myBall_mc;
The code shouldn't generate errors when attached to the timeline. Please post the errors you are getting.

6 replies

Inspiring
June 14, 2006
You shure you are talking about the instanceName and not the symbol Name? ball_mc. Ore maybe the clip is not in the same timeline than you code
Translate
Inspiring
June 14, 2006
There are no errors in the code you are posting. Maybe you should show us the other code you have?
Translate
June 15, 2006
this is the only code i have at the moment. i have created a button and called it myButton_btn in the instance name and i have an image which is a movie clip called myBall_mc. if i attach the code to the movie clip i get no errors in script but when i preview it nothing happens apart from the cursor turns to a hand. when i add the code to the timeline i get the errors.
Translate
Peter LorentCorrect answer
Inspiring
June 15, 2006
>>which is a movie clip called myBall_mc
But in the code you refer to:
var mc = ball_mc;
So that line should be:
var mc = myBall_mc;
The code shouldn't generate errors when attached to the timeline. Please post the errors you are getting.
Translate