I am having some trouble with Scenes in CS4. Below is my preloader which is in a separate scene. The preloader works great, it loads and continues onto the next scene. The problem occurs after. All my gotoAndStops and/or gotoAndPlays seem to have some wonky behavior. When I remove the scene everything plays normally as before. But when I put the scene back it messes up again.
I have selectively gone and tried putting on those certain links that don’t seem to work: I have not done this for all of them. Should I? I usually just put gotoAndStop… without anything in front of it. Is that a problem with scenes. Anyways the below don’t seem to make any difference. I tried to make sure my timeline layers were all still aligned appropriately and they seem fine to me.
this.gotoAndStop("frame", "scene");
this.gotoAndStop("frame");
MovieClip(root).gotoAndStop("frame");
MovieClip(root).gotoAndStop("frame", "scene");
For example when I click on the credits button that points to the credits frame it goes instead to the game frame and the game is playable. When I click the game button it says that frame doesn’t exist.
From the game frame that I got to by clicking the credits button, if I click the quit button I go to the last instructions page instead of the main menu. I don’t see any pattern to this.
I found a potential solution that does not appear to work. A website said make sure there is no actionscript on the page you are linking to from the other scene. So I have removed the actionscript from that frame and started it on the next frame. Still no go.
I have a couple more things to try, any advice is appreciated.
Preloader:
stop();
import flash.media.Sound;
import flash.media.SoundChannel;
addEventListener(Event.ENTER_FRAME, preloaderListener);
var sndCat:catmeow3 = new catmeow3();
var sndCatChannel:SoundChannel = sndCat.play(10);
function preloaderListener(evt:Event):void {
var percent = loaderInfo.bytesLoaded/loaderInfo.bytesTotal;
preLoad.scaleX = percent;
//trace(percent);
if (percent == 1) {
continueOn();
}
}
function continueOn():void {
removeEventListener(Event.ENTER_FRAME, preloaderListener);
gotoAndPlay("intro", "Poe");
}