5 Replies Latest reply on Sep 16, 2017 10:59 AM by kglad

    Adobe Air Error with AS3 'MovieClip(root).stopAllMovieClips();'

    SSSSSSBenay Level 1

      Hello Everyone,

      I am creating a very simple interactive program using Animate CC and AS3. The program consists of 10 frames (each frame contains various animating movieclips and graphics) and navigation arrow buttons which the user clicks to advance through the 10 frames.

       

      I control the navigation buttons through this code placed on the main timeline (the buttons are called 'forward2' and 'backward2'):

       

      import flash.events.Event;

      stop();

      forward2.addEventListener(MouseEvent.CLICK, goForward2);

      function goForward2(e:Event):void

      {

        MovieClip(root).stopAllMovieClips();

        SoundMixer.stopAll();

        play();

      }

      backward2.addEventListener(MouseEvent.CLICK, goBack2);

      function goBack2(e:Event):void

      {

        MovieClip(root).stopAllMovieClips();

        SoundMixer.stopAll();

        prevFrame();

      }

       

      This all works perfectly in the .fla document, and also when published as .swf, .html, .exe. and Mac Application.

       

      However, I am getting an error regarding this code:

      'MovieClip(root).stopAllMovieClips();'  when I try to compile the project into the desktop app using Adobe Air. The error says:

       

      'Type Error: Error #1006: stopAllMovieClips is not a function'

       

      Does anyone have any idea why this is happening? Is that line of code incorrect, although it works in the .swf, .html, and application files?

       

      Thank you in advance!!