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

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

Explorer ,
Sep 12, 2017 Sep 12, 2017

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

468
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
Community Expert ,
Sep 13, 2017 Sep 13, 2017

you're using air<3.8?

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
Explorer ,
Sep 15, 2017 Sep 15, 2017

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

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
Community Expert ,
Sep 15, 2017 Sep 15, 2017

do you have a document class that extends sprite?

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
Explorer ,
Sep 16, 2017 Sep 16, 2017

I am not using a document class, but rather adding code directly to the timeline. The above code is placed on the timeline.

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
Community Expert ,
Sep 16, 2017 Sep 16, 2017
LATEST

i can't think of any other reason for that to fail.

run a test by creating a new air app and use that code.  any problem?

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