Skip to main content
SSSSSSBenay
Known Participant
September 12, 2017
Question

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

  • September 12, 2017
  • 1 reply
  • 499 views

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!!

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
September 13, 2017

you're using air<3.8?

SSSSSSBenay
Known Participant
September 15, 2017

Hi, thanks for your attention my this issue. It looks like I’m using version 23.0.0.257.

kglad
Community Expert
Community Expert
September 15, 2017

do you have a document class that extends sprite?