|
-
[F8] button script problem
Hi Flashkit members,
Here is the file to look at
Please note that only the top button is the one I'm working on at the moment so disregard the other images.
I'm new here but I've been using flashkit for a while now just haven't ventured into the boards.
I've run across a problem which I'm sure will be answered swiftly as it wouldn't seem complicated for most but I'm new to the game.
I'm currently using a button that triggers an animation.
I've got it set up so when the mouse is over the button it starts to play and if the user pulls back before it has finished it works out where to jump to play back smoothly.
This is my current code:
on(rollOver){
if (bar._currentframe <50){
bar.play();
}
else if (bar._currentframe >50){
bar.gotoAndPlay(_currentframe - 100);
}
}
on(rollOut){
if(bar._currentframe <100){
bar.gotoAndPlay(100 - bar._currentframe);
}
}
The animation is 100 frames long and the midpoint is 50 frames. There is a stop action at 50 frames so if they mouse stays over the button it will stay at the end.
Now here is my problem, if I put the mouse over and then pull it away at any time then it plays fine but if while it is going towards the end of the animation and I put my mouse back over the button then it doesn't start playing the other way, it just finishes where it was up to.
If anybody could please give me some advice I would greatly appreciate it.
I will be watching this intently to see what people can advise
Last edited by drew3d; 08-19-2007 at 10:19 PM.
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
|