So I'm writing the most basic of timeline preloaders and flash seems to have
a mind of its own.
My test.fla has two frames. Frame 1 has a text field and a progress bar
movieclip. Frame 2 has a very large image. There is no code what so over.
The document class is set to Test.as and is essentially:
package
{
import flash.display.MovieClip;
import flash.text.TextField;
import flash.events.*;
public class Test extends MovieClip
{
//stage instances
public var info_txt:TextField;
public var loadBar:MovieClip;
public function Test()
{
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS,
onProgress);
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);
}
private function onProgress(e:ProgressEvent):void
{
trace(e.bytesLoaded);
//on progress updates
}
private function onComplete(e:Event):void
{
//clean up
}
}
}
This all works fine except for the playhead activity. In my sample you'll
notice there are no stop(); commands so when do Control -> Test Movie, it
just loops over the timeline flickering between frames 1 and 2 as you would
expect. Oddly enough however, when I hit ctrl+enter again (Simulate
Download), it stops, outputs the traces and then proceeds to flicker. Wha!?
It gets weirder. Just add a stop(); as the first line in the document class
constructor right? Now Test Movie just sits on frame one and never
broadcasts any ProgressEvent's. Seems fine but now when I Simulate Download,
it stops, outputs the traces... AND THEN PROCEEDS TO FLICKER! My onComplete
does NOT tell the playhead to play() or gotoAndPlay() or anything. Who the
heck it telling the playhead to play?
--
--Joel Stransky
stranskydesign.com
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders