예제 #1
0
 public void addFrame(SMovieClip mFrame, String label)
 {
     mFrame.name = label;
     mFrames.Add(mFrame);
     addChild(mFrame);
     mJuggler.add(mFrame);
     if (mFramesCount++ == 1) {
         mCurrentLabel = label;
     } else {
         mFrame.visible = false;
     }
 }
예제 #2
0
    public MovieScene()
    {
        var frames = Game.assets.getTextures("flight");
        mMovie = new SMovieClip(frames, 15);

        // add sounds
        var stepSound = new Sound("wing_flap");
        mMovie.setFrameSound(2, stepSound);

        // move the clip to the center and add it to the stage
        mMovie.pivotX = mMovie.width * 0.5f;
        mMovie.pivotY = mMovie.height * 0.5f;

        mMovie.x = 260f;
        mMovie.y = 400f;

        addChild(mMovie);

        addEventListener(CEvent.ADDED_TO_STAGE, onAddedToStage);
        addEventListener(CEvent.REMOVED_FROM_STAGE, onRemovedFromStage);
    }