PDA

View Full Version : rollover action on moving object/button


boycetown
11-16-2007, 02:19 AM
hey everyone, i have a question, i have several moving objects on the stage. what i want to happen is that when i rollover a moving object, it stops and text/data appears below the object. when i roll off, it goes back to moving. i have everything down except for the data appearin below. what i've tried is converting the object into a button and a movie and have gotten none to work.

when i converted it to a button, i added the data/text on the over state of the button. it never appears when previewing the movie.

when i converted it to a movie, i placed the following script onto it:

on (rollOver) {
gotoAndPlay(2);
}

raskolnikov
02-29-2008, 08:10 AM
make an movie clip and name it "moveClip"
put code below on frame one as well as your movieclip


//on load
speed = 5;
startPos = -10;
moveClip._x = startPos;
moveObject=1;

//on enterframe
moveClip.onEnterFrame = function() {

if(moveObject==1){
moveClip._x += speed;
if (moveClip._x>=Stage.width) {
moveClip._x = startPos;
}
}
};

moveClip.onRollOver=function(){
moveObject=0;
}
moveClip.onRollOut=function(){
moveObject=1;
}


basically the button toggles on and off of movement like what u asked for.
good luck

raskol

raskolnikov
02-29-2008, 08:13 AM
with text on/off