0

thanks to anyone who is able to give a helping hand with this situation...

So,

I've made a slideshow in flash, it was able to be previewed before i chose to debug movie. that was when an error appeared, regarding the class of MouseEvent...

The error states "The class or interface 'MouseEvent' could not be loaded". Gathered from what i have read, am i correct in my assumption that i need to import this MouseEvent?

To get an exact look at what i have, the following is my complete code as it is;

stop()

btn1.addEventListener(MouseEvent.CLICK,backward);
btn2.addEventListener(MouseEvent.CLICK,forward);

function forward(event:MouseEvent){
    if(this.currentFrame == this.totalFrames){
        gotoAndStop(1);
    }
    else{
        nextFrame();
    }
}

function backward(event:MouseEvent){
    if(this.currentFrame == 1){
        gotoAndStop(this.totalFrames);
    }
    else{
        prevFrame();
    }
}
Sam
  • 1,233
  • 1
  • 9
  • 16
  • Is this supposed to be AS2 or AS3? – Sam Mar 21 '11 at 17:39
  • Yes this is not AS2 this is AS3, that's your problem. If you want AS2 code, then @www0z0k has provided the correct answer for you below. –  Mar 22 '11 at 12:15

1 Answers1

0

this looks more like as2 but i might miss something:

btn1.onPress = function (event){
    if(this.currentFrame == 1){
        gotoAndStop(this.totalFrames);
    }
    else{
        prevFrame();
    }
}

btn2.onPress = function(event){
    if(this.currentFrame == this.totalFrames){
        gotoAndStop(1);
    }
    else{
        nextFrame();
    }
}
www0z0k
  • 4,444
  • 3
  • 27
  • 32