PDA

View Full Version : whats wrong with this please?



G
January 10th, 2004, 04:44 PM
Below is the code which is used to trigger the transitions. For reference 'home' is movieclip and 'homestate' is a button in the movieclip.

home.homestate.onRelease=function(){
if(_root.section!="home.swf"){
_root.section="home.swf";
_root.transition.gotoAndPlay("closing");
}
};

I'm happy with the code because I understand it. However my problem is that I want to include to more actions to this script

on(rollOver){
gotoAndPlay("rollover);
}

and

on (rollOut){
gotoAndPlay("rollout");
}

I try incorporating these actions into the first script but I get an error.

home.homestate.onRelease=function(){
if(_root.section!="home.swf"){
_root.section="home.swf";
_root.transition.gotoAndPlay("closing");
}
};
home.homestate.on(rollOver){
_root.home.gotoAndPlay("rollover");
}
home.homestate.on(rollOut){
_root.home.gotoAndPlay("rollout");
}

whats wrong with the code some please help me its driving me nuts.

claudio
January 10th, 2004, 04:53 PM
home.homestate.onRollOver = function{
_root.home.gotoAndPlay("rollover");
}
home.homestate.onRollOut = function(){
_root.home.gotoAndPlay("rollout");
}

G
January 10th, 2004, 04:59 PM
cheers claudio I haven't tested the whole script yet with the transitions but the script you gave me is working like a treat.

Cheers

claudio
January 10th, 2004, 04:59 PM
welcome :)

G
January 10th, 2004, 05:00 PM
claudio can I ask you how did you learn actionscript, what books etc. I know enough to get by but sometimes (well all the time) I get stuck or dig a hole for myself.

claudio
January 10th, 2004, 05:08 PM
Well, ive learned most by myself, experimenting, much with this forum and a lot with the most powerful teacher out there: google.
Ive never tried books, but i think they should offer good support.