jeudi 30 mars 2017

Using .stage not giving desired result

I make a global variable equal to a movieclip

A function gets run with an if statement checking if [x] movieclip exists, if it doesn't add it. Despite the MovieClip being on the stage it continues using the if statement.

Document class

public static var skinHolder:MovieClip = new test;

Seperate Class

    function animHandler():void
    {
        if (! Game.skinHolder.stage)
        {
            // if its not on the stage we add it to the stage
            addChild(Game.skinHolder);
        }
        switch (Game.charSkin)
        {
            case 1 :
                Game.skinHolder = new mc_P1Anim;
                break;
        }

    }

Aucun commentaire:

Enregistrer un commentaire