Copy link to clipboard
Copied
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!!
Copy link to clipboard
Copied
you're using air<3.8?
Copy link to clipboard
Copied
Hi, thanks for your attention my this issue. It looks like I’m using version 23.0.0.257.
Copy link to clipboard
Copied
do you have a document class that extends sprite?
Copy link to clipboard
Copied
I am not using a document class, but rather adding code directly to the timeline. The above code is placed on the timeline.
Copy link to clipboard
Copied
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?