Flash Buttons
- Started
- Last post
- 15 Responses
- TResudek
Hey guys,
This seems like I am missing something but, thus far, all of my buttons have been scripted with an Over, Out and HIT state. All using MCs and action script to do this.The problem is that if I mouse in and out quickly the button jumps the animation so that it tends to look no-so-smooth.
Is there a smarter way to do this? Something that just plays one animation backwards and forward on mouse over/out?
Thanks,
TR
- autonoma0
Can you show some code you're using?
- TResudek0
on (rollOver) {
tellTarget ("Next") {
gotoAndPlay (2);
}
}
on (rollOut) {
tellTarget ("Next") {
gotoAndPlay (3);
}
}
on (press) {
tellTarget ("Next") {
gotoAndPlay (4);
}
}
on (release) {
tellTarget ("Next") {
gotoAndPlay (5);
}
}
on (release) {
getURL ("url.html");
}
- autonoma0
tellTarget is seriously outdated code. Using buttons is outdated as well. Instead, use a movie clip and the following code:
Next.onRollOver = function() {
gotoAndPlay(2);
}
Next.onRollOut = function() {
gotoAndPlay(3);
}
- unformatted0
in your mc put _up, _down, _over, labels. then you don't need to actionscript the rollover, rollouts.
- TResudek0
Can someone direct me to an FLA (Flash 5) using this code? Obviously I don't know what the hell I am doing.
Thanks,
TR
- autonoma0
What do you mean, unformatted?
- versa0
make a button MC, and give it several frames labeled according to the different button states ... then use code like below maybe
// ------------------------>
function onPressHandler ()
{
// actions here
}
function onOverHandler ()
{
this.gotoAndStop("over");
}
// ------------------------->
function onOutHandler ()
{
this.gotoAndStop("out");
// any other actions
}// Button State Assignments
//
fooBTMC.onRollOver = onOverHandler;fooBTMC.onRollOut = onOutHandler;
fooBTMC.onPressOut = onPressHandler;
- versa0
woops...typing fast
fooBTMC.onPressOut = ...
should be
fooBTMC.onPress = ...
- TResudek0
Thanks for the code but I don't even know how to use that.... I am relly just getting into using Flash so all of this stuff is over my head.
:(Thanks,
TR
- unformatted0
autonoma,
use movieclips as buttons like you said.
make frame labels "_up", "_down", "_over"
you need stop(); actions too. when you set this up, you dont' have to waste your time making the mouseevents because the _up, etc already does that for you.
- unformatted0
maybe hard to explain this..so....
view:
http://www.unformatted.net/_temp…source to see:
http://www.unformatted.net/_temp…
- TResudek0
Thanks but I am on Flash 5 so no could open.
What an incredible pain in the arse I can be....
TR
- drzoom0
is that a MX2004 thing, unformatted?
I've never knew anything about it, so I just tried it on MX and that didn't work.
- autonoma0
I tried it, too. It's for the latest version, I believe.
- unformatted0
maybe it is, can't remember. but yeah the file is for mx 2004.
guess if you have flash 5, you'll have to script it.
pain in the ass.