Mouseover Action Script 2.0 issue

Mouseover Action Script 2.0 issue

Post by richfergu » Sun, 07 Aug 2005 01:22:42


I hope someone can help:

In an old menu I have this AS 1.0 to fade in and out of items on the menu. How
do I get the same effect in AS2.0

here is the Actions Script for the menu:

if (Number(_level0:x) == 1 and Number(al)<100) {
al = Number(al)+5;
} else if (Number(al)>0) {
al = al-5;
}
gotoAndPlay(2);

___________________

the var "x" is from the button instance with this Action Script:

on (rollOver) {
x = 1;
}
on (rollOut) {
x = 0;
}
TextText


Thanks for your help!
 
 
 

Mouseover Action Script 2.0 issue

Post by NSurveyo » Sun, 07 Aug 2005 01:41:28

Three things. _level0:x is incorrect syntax. Should be: _level0.x. Secondly,
you need to define al first before you can use it. Lastly, you don't need to
keep converting everything if they are numbers. I simplified script a bit

if ((_root.x) && (al<100)) {
al+=5;
} else if (!(_root.x) && (al>0)) {
al -=5;
}
gotoAndPlay(2);

 
 
 

Mouseover Action Script 2.0 issue

Post by richfergu » Sun, 07 Aug 2005 02:10:23

NSurveyor ,

Thankyou very much!!! Very good info!
Rich
 
 
 

Mouseover Action Script 2.0 issue

Post by NSurveyo » Sun, 07 Aug 2005 03:01:48

You're welcome.