开发者

I am having an error trying to configure a slideshow in flash actionscript 2.0

开发者 https://www.devze.com 2023-02-18 00:21 出处:网络
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 appe

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?

开发者_Go百科

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();
    }
}


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();
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消