PDA

View Full Version : Need some action script help


m1a2x3x7
07-05-2007, 04:21 PM
I'm creating a drop down menu using movie clips.

they roll over home and the links drop (movie clip one) (instance name nav)

home(roll over)
index
default
main page
splash page

on (rollOver) {
_root.nav.gotoAndPlay(2);
}
on (rollOut) {
_root.nav.gotoAndPlay(1);
}

Now i have a second movie clip that needs to run when they roll over index

home
index(roll over)
more info
more info
more info
default
main page
splash page

i try using the same code with the instance name nav1

on (rollOver) {
_root.nav1.gotoAndPlay(2);
}
on (rollOut) {
_root.nav1.gotoAndPlay(1);
}

nothing happens.

whats wrong?

Thanks for the help.

cocoonfx
07-05-2007, 10:11 PM
Do you get an error messages when you check the code?

Also have you used the target button to link to "nav1".

Could you upload the .fla file so i can have a look.

m1a2x3x7
07-06-2007, 02:15 AM
how do i go about making sure the target is linked.

m1a2x3x7
07-06-2007, 02:37 AM
here it is. let me know...thanks

paispais
07-08-2007, 02:16 AM
Try this code:

nameOfInstance.onRollOver = function() {
_root.nav.gotoAndPlay(2);
};
nameOfInstance.onRollOut = function() {
_root.nav.gotoAndPlay(1);
};

or do a search for function in the flash help, this manual is very helpful for AS.

BTW, are you using AS 2.0?

m1a2x3x7
07-08-2007, 05:26 AM
yes im using as 2.0 but turns out that you cant have a on() handle on a movie clip inside of a movie clip that also has an on() handle