0
votes

Scene 3, Layer 'AS', Frame 1, Line 1 1119: Access of possibly undefined property onEnterFrame through a reference with static type flash.display:DisplayObject. Scene 3, Layer 'AS', Frame 1, Line 2
1119: Access of possibly undefined property _ymouse through a reference with 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 a reference with 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 a reference with 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 a reference with 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 a reference with static type flash.display:DisplayObject. Scene 3, Layer 'AS', Frame 1, Line 24 1119: Access of possibly undefined property _xmouse through a reference with static type flash.display:DisplayObject. Scene 3, Layer 'AS', Frame 1, Line 24
1119: Access of possibly undefined property _xmouse through a reference with 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();

    }
    }
1
Sure, the code is for AS2, while you attempt to compile for AS3.Vesper

1 Answers

2
votes

Your code is in AS2. in AS3, objects use the addEventListener property instead of constructs like onEnterFrame.

Change the targeting of your project to AS2, or you can just revise the top line of code like so:

root.addEventListener(Event.ENTER_FRAME, function() {

   ... // your code

 })