Expected a field name after '.' operator.
I am trying to make an animation (transition) on a button useing actionscript and calling the MC from the library to the button. Problem is I get an error when I run it
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Expected a field name after '.' operator.
myButton.on(rollOver)=function(){
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 4: Expected a field name after '.' operator.
myButton.on(rollOut)=function(){
Total ActionScript Errors: 2 Reported Errors: 2
I dont understand what this meens.
my code on the frame is:
myTargetSwitch1 = "off";
_root.mcFadein.onEnterFrame=function(){
if(myTargetSwitch=="off"){
this.gotoAndStop('stopped');
}else{
this.gotoAndPlay('fadein');
}
}
and the code on the button is:
myButton.on(rollOver)=function(){
myTargetSwitch1="on";
}
myButton.on(rollOut)=function(){
myTargetSwitch1="off";
_root.mcFadein.gotoAndPlay('fadeout');
}
does anyone have any suggestions?
Must appear within on handler
Ok I switched the code on the button and now I get the following error;
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Statement must appear within on handler
myButton.onRollOver=function(){
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 4: Statement must appear within on handler
myButton.onRollOut=function(){
Total ActionScript Errors: 2 Reported Errors: 2
:confused: