|
|
 |
Re: FN-FORUM flash
date posted 1st October 2002 18:45
Thanks Guys
I'm a total newbie at flash, although I have used the simplest of actions,
where exactly do I insert that code!? is there somewhere in the actions
palette? :c)
Best Regards
D Thomas
-----------------------------------------------------------------
Web: http://www.twdmedia.com
Mail: [EMAIL REMOVED]
Tel / Fax: 07092 308437
-----------------------------------------------------------------
----- Original Message -----
From: "Aral Balkan" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Tuesday, October 01, 2002 3:36 PM
Subject: Re: FN-FORUM flash
frame 1 - label: "check"
if (this.getBytesLoaded() == this.getBytesTotal()) {
gotoAndPlay("start");
}
frame 2:
gotoAndPlay("check");
frame 3 - label "start"
// start your movie here
This is the simplest way. There are much more complicated ways and I have an
over 500-line movie loader class to prove it :)
If you'd like something a bit more advanced, use an enterFrame listener:
_root.onEnterFrame = function() {
if (this.getBytesLoaded() == this.getBytesTotal()) {
gotoAndPlay("start");
}
}
This will basically get rid of your frame loop and allow all the code to be
in one place. If you're feeling more adventurous, don't overwrite the
_root's onEnterFrame but either create an empty movie clip (Flash MX only)
or create an empty clip on the stage (lets call it frameEvent_mc) and have
its onClipEvent(enterFrame) call your load check function:
eg. on the frameEvent_mc movieClip:
onClipEvent (enterFrame) {
_root.testLoaded();
}
_root.testLoaded = function() {
if (this.getBytesLoaded() == this.getBytesTotal()) {
gotoAndPlay("start");
}
}
Of course the best way, is to have a frame event engine of some sort (FLEM
is overkill for MX but good for Flash 5, as is ACK!) and load your movies
into movie clips instead of _levels or the main timeline and preload that
way. I'm going to be releasing my Flash MX ActionScript library soon that
has classes that handle all this very elegantly. If you'd like me to send
you a copy beforehand, let me know.
hth,
Aral :)
--
Aral Balkan
Director, Bits And Pixels Ltd.
http://www.BitsAndPixels.co.uk
24 Claremont Heights, 70 Pentonville Road,
London, N1 9PR, United Kingdom.
(t) +44 (0) 20.7278.1825 (m) +44 (0) 07986.124219
|
 |
|