|
-
onRollOver on Buttons
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.
Code:
on (rollOut) {
if((!btnIntermediate.onRollOver)||(!btnExpert.onRollOver)){
gotoAndStop(1);
}
}
Regards,
E
Last edited by Ennair; 09-24-2006 at 11:54 AM.
-
 Originally Posted by Ennair
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.
Code:
on (rollOut) {
if((!btnIntermediate.onRollOver)||(!btnExpert.onRollOver)){
gotoAndStop(1);
}
}
Regards,
E
it's not supposed to be a space in the second part on the if statement 'onRollOver'.
Thanks.
-
Senior Member
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
Code:
myButton.addEventListener(MouseEvent.CLICK,onClickListener)
function onClickListener(e:MouseEvent){
//do stuff
}
don't mind the extra spaces, it adds them for some reason
-
 Originally Posted by ozmic66
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
Code:
myButton.addEventListener(MouseEvent.CLICK,onClickListener)
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?
-
Senior Member
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
}
}
- The right of the People to create Flash movies shall not be infringed. -
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
|