1 Reply Latest reply on Sep 13, 2006 7:33 AM by kglad

    problem calling function in attached movie

      In my main timeline I'm attaching a movieclip from the library & then trying to call a function defined in frame one of the attached movieclip - however it does not run ? Can anyone see what is wrong with this code...

      var mcRef:MovieClip = _root.target5.attachMovie("menuBar", "MenuBar" + nDepth, nDepth);

      (mcRef has the following value - _level0.target5.MenuBar0)

      mcRef.createButtons(mcTgt, sPath, nButtons);

        • 1. Re: problem calling function in attached movie
          kglad Adobe Community Professional & MVP
          the code in frame 1 of mcRef does not complete execution until the code in the frame that contains your attachMovie() statement completes execution. you are, therefore, trying to use a function before it's defined.

          to remedy, you can wait any measurable (in flash) amount of time before executing mcRef.createButtons(). for example, setInterval() can be used with any time delay.