1009 Error for a Character Skin Symbol in AS3

43 Views Asked by At

I have 2 errors for the character skin, when I clicked the home button for both single and double play, it gives me an error:

    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at BlowfishPong_fla::MainTimeline/playerSkin()[BlowfishPong_fla.MainTimeline::frame22:352]

    at BlowfishPong_fla::MainTimeline/frame47()[BlowfishPong_fla.MainTimeline::frame47:176]
    at flash.display::MovieClip/gotoAndStop()
    at BlowfishPong_fla::MainTimeline/doubleGame()[

Here is the code for in a character symbol:

character.addEventListener(Event.ENTER_FRAME, playerSkin);
    function playerSkin(e: Event): void {
        if (Kirara_selected == true && Kirara_skinSelected == true) {
            if (Kirara_OnePieceSS_Selected == true) {
                character.gotoAndStop(11);
            } else if (Kirara_BeachS_Selected == true) {
                character.gotoAndStop(10);
            } else if (Kirara_Wetsuit_Selected == true) {
                character.gotoAndStop(9);
            }
        } else if (Towa_selected == true && Towa_skinSelected == true) {
            if (Towa_OnePieceSS_Selected == true) {
                character.gotoAndStop(12);
            } else if (Towa_Wetsuit_Selected == true) {
                character.gotoAndStop(13);
            }
        } else if (Yui_selected == true && Yui_skinSelected == true) {
            if (Yui_BeachS_Selected == true) {
                character.gotoAndStop(14);
            } else if (Yui_SwimClubSS_Selected == true) {
                character.gotoAndStop(15);
            } else if (Yui_OnePieceSS_Selected == true) {
                character.gotoAndStop(16);
            }
        } else if (Peach_selected == true && Peach_skinSelected == true) {
            if (Peach_LeotardSS_Selected == true) {
                character.gotoAndStop(18);
            } else if (Peach_Wetsuit_Selected == true) {
                character.gotoAndStop(17);
            } else if (Peach_OnePieceSS_Selected == true) {
                character.gotoAndStop(19);
            }
        } 
        else {
            if(Minami_selected == false && Minami_skinSelected == false){
            character.gotoAndStop(1);
            }
            else if(SwimsuitCiel_selected == true){
                character.gotoAndStop(33);
            }
            else if(IrisAnother_selected == true){
                character.gotoAndStop(26);
            }
            else if(SaintGermain_selected == true){
                character.gotoAndStop(34);
            }
            character.removeEventListener(Event.ENTER_FRAME, playerSkin);
        }
    }

There are too long for the scripts and can anyone can fix this error?

0

There are 0 best solutions below