actionscript 3 - I'm trying to create a sliding gallery in AS3 in Flash CS5, but I get these errors: does it have something to do with AS3 ? -
scene 3, layer 'as', frame 1, line 1 1119: access of possibly undefined property onenterframe through reference static type flash.display:displayobject. scene 3, layer 'as', frame 1, line 2
1119: access of possibly undefined property _ymouse through reference static type flash.display:displayobject. scene 3, layer 'as', frame 1, line 3 1120: access of undefined property myvar. scene 3, layer 'as', frame 1, line 5 1119: access of possibly undefined property _ymouse through reference static type flash.display:displayobject. scene 3, layer 'as', frame 1, line 6
1120: access of undefined property myvar. scene 3, layer 'as', frame 1, line 8 1119: access of possibly undefined property _xmouse through reference static type flash.display:displayobject. scene 3, layer 'as', frame 1, line 8 1120: access of undefined property myvar. scene 3, layer 'as', frame 1, line 17 1119: access of possibly undefined property _xmouse through reference static type flash.display:displayobject. scene 3, layer 'as', frame 1, line 17 1120: access of undefined property myvar. scene 3, layer 'as', frame 1, line 24 1119: access of possibly undefined property _xmouse through reference static type flash.display:displayobject. scene 3, layer 'as', frame 1, line 24 1119: access of possibly undefined property _xmouse through reference static type flash.display:displayobject. scene 3, layer 'as', frame 1, line 24
1119: access of possibly undefined property _xmouse through reference static type flash.display:displayobject.**
the code is:
enter code here root.onenterframe = function() { if(root._ymouse<601){ myvar=false; } if(root._ymouse>600){ myvar=true; } if(root._xmouse<100 && myvar==true) { imgbar.prevframe(); imgbar.prevframe(); imgbar.prevframe(); } else{ imgbar.play; } if(root._xmouse>600 && myvar==true){ imgbar.nextframe(); imgbar.nextframe(); } else{ imgbar.play; } if(root._xmouse>100 && root._xmouse<600 && myvar==true){ imgbar.stop(); } }
your code in as2. in as3, objects use addeventlistener property instead of constructs onenterframe.
change targeting of project as2, or can revise top line of code so:
root.addeventlistener(event.enter_frame, function() { ... // code })
Comments
Post a Comment