0
votes

I've searched endlessly for an answer but can't seem to find one.

I'm building a flash presentation for a client. It's got about 15 scenes, the .fla file is 200MB before publishing (26MB afterward). It's a pretty simple operation; I'have a pause/play & replay button, and once the scene is completed a next & replay button appears in the center of the stage.

My issue is when I get to about the 8th scene, halfway through. All my tweens and buttons stop working. Simple fade-in text doesn't come up and my pause/play & replay no longer function. I've tried shifting around scenes to see if it was anything in particular, but no matter what order and what scenes it always stops halfway through the 8th. I don't get any error notifications before, after or during the play. Tracing tells me that the button has been clicked and it's moved to the next scene but it simply will not play. Adding a play(); comment at the first frame of the next scene has not helped either.

Here are my functions that are on Scene 1 Frame 1

function pause_movie(event:MouseEvent):void {
    stop();
    playBtn.visible = true;
    pauseBtn.visible = false;
}

function play_movie(event:MouseEvent):void {
   play();
   playBtn.visible = false;
   pauseBtn.visible = true;
}

function replay_movie(event:MouseEvent):void {
   gotoAndPlay(1);
}

function next_movie(event:MouseEvent):void {
    this.nextScene();
    trace("next_movie " + this.currentScene.name);
}

And then I just add event listeners when my buttons appear per scene

import flash.events.MouseEvent;

//Hide play button to start
playBtn.enabled = true;
pauseBtn.enabled = true;
playBtn.visible = false;

pauseBtn.addEventListener(MouseEvent.CLICK, pause_movie);
playBtn.addEventListener(MouseEvent.CLICK, play_movie);
replayBtn.addEventListener(MouseEvent.CLICK, replay_movie);

Any help is appreciated! Thank you!


I've created a new flash file with a blank canvas (just page number and next button). I'm loading the audio externally now as per @VC.One 's comment and the program stops working at the same scene regardless of which audio file I put in there.

Here is my updated code:

import flash.events.Event;
import flash.media.Sound;
import flash.net.URLRequest;
import flash.media.SoundChannel;

var channel:SoundChannel = new SoundChannel;
var s:Sound = new Sound();

function newSound() {
    s.removeEventListener(Event.COMPLETE, onSoundLoaded);
    s = new Sound();
    s.addEventListener(Event.COMPLETE, onSoundLoaded);
}

function onSoundLoaded(e:Event):void
{
    channel = s.play();
}

function next_movie(event:MouseEvent):void
{
    channel.stop();
    try {
        s.close();
    }
    catch(e:Error) {
        trace("File already loaded");
    }
    this.nextScene();
    trace("next_movie " + this.currentScene.name);
}

and each scene starts with:

pageNum.text = this.currentScene.name;
skipBtn.addEventListener(MouseEvent.CLICK, next_movie);
newSound();
s.load(new URLRequest('audio/ISB page 17 tk 1.mp3'));
1
Open console while debugging and check if there's an 1009 error popping from somewhere. This behavior is known to happen in release mode, if an error happens somewhere in your timeline script, that script gets disabled.Vesper
Memory issue? Get a trial version of Adobe Scout and profile the project – adobe.com/devnet/scout/articles/scout-memory-profiling.htmlspring
@Vesper Just tried, the debug console didn't report anything..Thomas Pimentel
@1202 Program Alarm I ran scout CC I'm not to familiar with this program but nothing occurs that seems out of the ordinary in terms of memory. It shows that the frames keep running but no rendering is done after reaching that point halfway point of the entire file.Thomas Pimentel
How much memory is being used at the point of failure? It may not be a memory issue but that is always the first thing to check. Is it failing in the browser? In the Flash Player? Fwiw, I haven't used Flash is years but recall being warned off the "scenes" feature.spring

1 Answers

0
votes

Finally solved this issue. The scenes added together were more than the 16k frames Flash is apparently limited to. I had to convert each scene into a movieclip and put them in each of their own frame all in one scene with a bit of coding to play each one after the previous one finished. Everything works fine now. Thanks guys!