samedi 11 juin 2016

why my code dosn't work after prevFrame() Method?

I have on the timeline 07 symbols , and two Buttons (nextBtn & prevBtn) to move between frames . and my fla is linked to a class named AppClass his mission is to Make the each 07 symbols invisible on click , so my code perfectly work in the begin . but after moving forward using the nextFrame() and back using the prevFrame() . my class stop working . i don't understand why !!

codes : Buttons Class

package 
{
    import flash.display.*;
    import flash.events.*;

    public class ButtonsClass extends MovieClip
    {
        public function ButtonsClass()
        {
            // constructor code
            this.addEventListener(MouseEvent.CLICK,listenToEvent);

        }
        private function listenToEvent(e:MouseEvent):void
        {
            switch (e.currentTarget.name)
            {

                case "prevBtn" :
                    MovieClip(parent).prevFrame();
                    break;

                case "nextBtn" :
                    MovieClip(parent).nextFrame();
                    break;
            }
        }
    }

}

Code Base Class :

package 
{

    import flash.display.*;
    import flash.events.MouseEvent;

    public class AppClass extends MovieClip
    {
        private var pauseBtns:Array;
        private var playBtns:Array;

        public function AppClass()
        {
            // constructor code
            stop();
            playBtns = new Array(playBtn0,playBtn1,playBtn2,playBtn3,playBtn4,playBtn5,playBtn6,playBtn7);
            PalyBtns();
        }

        // _____ Listen To Play Btns ,
        private function PalyBtns():void
        {
            for (var i:int; i < playBtns.length; i++)
            {
                playBtns[i].addEventListener(MouseEvent.CLICK,PlayClick);
            }
        }
        private function PlayClick(e:MouseEvent):void
        {
            e.currentTarget.visible = false;

        }
    }

}

Aucun commentaire:

Enregistrer un commentaire