Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Problem accessing nested MovieClips

New Here ,
Aug 02, 2013 Aug 02, 2013

Hi I'm trying to add an event Listener to a button that is nested inside a movieclip, and that movieclip is nested inside another movieclip, but I get a null object reference error where I add the event listener:

public function OptionsClass(model:GameModel, stage:Object) {

                              // constructor code

                              _gameModel = model;

                              _stage = stage;

                              _optionsClip = new Options();

                              _optionsClip.gotoAndStop(1);

                              addChild(_optionsClip);

                              _optionsClip.optionsMC.controlsBtn.addEventListener(MouseEvent.MOUSE_DOWN, onControlsBtnDown); -->ERROR

                              _optionsClip.optionsMC.backBtn.addEventListener(MouseEvent.MOUSE_DOWN, onBackBtnDown);

                    }

all the instances are named correctly on the movieclips so I don't know what the problem is. If anyone knows what I'm doing wrong please let me know, thank you.

TOPICS
ActionScript
356
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 02, 2013 Aug 02, 2013
LATEST

NEVERMIND I FIXED IT, I HAD THE LABELS WRONG, SORRY

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines