Click to See Complete Forum and Search --> : onRollOver on Buttons
Ennair
09-24-2006, 11:49 AM
Hi,
I wonder if anyone could check this for me and tell me why it's not working please?
I want the play head to go and stop in frame 1 only if the user is not hovering on btnIntermediate or btnExpert.
on (rollOut) {
if((!btnIntermediate.onRollOver)||(!btnExpert.onRo llOver)){
gotoAndStop(1);
}
}
Regards,
E
Ennair
09-24-2006, 11:55 AM
Hi,
I wonder if anyone could check this for me and tell me why it's not working please?
I want the play head to go and stop in frame 1 only if the user is not hovering on btnIntermediate or btnExpert.
on (rollOut) {
if((!btnIntermediate.onRollOver)||(!btnExpert.onRo llOver)){
gotoAndStop(1);
}
}
Regards,
E
it's not supposed to be a space in the second part on the if statement 'onRollOver'.
Thanks.
ozmic66
09-24-2006, 01:10 PM
I suppose you're trying to achieve this in as3
in that case you can't use on(...){ anymore you need to use event listeners.
see the docs for help on that because I'm not sure which events are used for rollover/out
for click, you can do this
myButton.addEventListener(MouseEvent.CLICK,onClick Listener)
function onClickListener(e:MouseEvent){
//do stuff
}
don't mind the extra spaces, it adds them for some reason
Ennair
09-24-2006, 01:24 PM
I suppose you're trying to achieve this in as3
in that case you can't use on(...){ anymore you need to use event listeners.
see the docs for help on that because I'm not sure which events are used for rollover/out
for click, you can do this
myButton.addEventListener(MouseEvent.CLICK,onClick Listener)
function onClickListener(e:MouseEvent){
//do stuff
}
don't mind the extra spaces, it adds them for some reason
Actually, I may have posted this question in the wrong section. I am using Flash 8 and I think I am using AS2.
How can I achieve the same effect using AS2 please?
cancerinform
09-25-2006, 09:27 AM
Wrong forum.
The answer to your question is:
1. Do not use scripts associated with buttons and MovieClips. In most part use scripts, which you place on the main timeline. Name your clips and buttons. You have more control.
2. the answer to your question. Create a variable which you put in the RollOver function.
var pressed:Boolean;
pressed = false;
myBut.onRollOver = function()
{
pressed = true;
}
myBut.onRollOut = function()
{
if(pressed)
{
d
//function here
}
}
flashkit.com
Copyright Internet.com Inc., All Rights Reserved.