-
i made a simple preloader for a site with flash mx. and i don't think i done anything wrong but...
it loads ok, the percentage bar works fine but when it reaches 100% it doesn't go to the next scene where the site is located. i've checked if i mistyped the name of the scene, i checked if the scene where the preloader is is over the site scene...and nothing!!!
can anyone tell me where my mistake is?
-
Could you post your code please??
-
there are three frames in the preloader scene
on the third frame there's an action. this is it:
gotoAndPlay("da_site", 1);
on the second the frame the action is:
if (_root.getBytesLoaded() != _root.getbytestotal) {
gotoAndPlay(1);
}
and of course there's an action in the preload bar instance but it's working so i doubt the error is there, but just in case:
setProperty(this, _xscale, (_root.getBytesLoaded()/_root.getBytesTotal())*100);
thanks in advance
-
I think I miss something like this:
Code:
if (_root.getBytesLoaded() == _root.getbytestotal) {
gotoAndPlay("da_site");
}
-
i think it's the same...but anyways i tried it and the result is the same...it just won't go to the next scene!!!
-
instead of
gotoAndPlay("da_site", 1);
you can use
nextScene();
-
Originally posted by dennie
I think I miss something like this:
Code:
if (_root.getBytesLoaded() == _root.getbytestotal) {
gotoAndPlay("da_site");
}
instead of another if (make it an else) you can put an else on the second frame
-
Think you're continually looping this the wrong way.
My usual "that kind of preloader" also holds 3 frames.
--------------------------------------
Frame 1:
(Be carefull of CAPS!)
if (_root.getBytesLoaded() >= _root.getBytesTotal() {
gotoAndPlay("da_site"); // if "da_site" is the frame label of the targeted scene!
// Otherwise it would be the scene name...
gotoAndPlay("Scene 2", 1);
}
This frame should be blank & cleared of any displays, bars etc... And is only aimed at avoiding seeing a flash frame of the preloader if the file is already cached on the user's machine.
Frame 2:
(Really the same as frame 1!)
(Be carefull of CAPS!)
if (_root.getBytesLoaded() >= _root.getBytesTotal() {
gotoAndPlay("da_site"); // if "da_site" is the frame label of the targeted scene!
// Otherwise it would be the scene name...
gotoAndPlay("Scene 2", 1);
}
Frame 3:
(The loop...)
gotoAndPlay(2);
--------------------------------------
On another layer(s), you can add textfields displays and bars or whatever visuals, but only on frames 2 & 3. Keep frame 1 clear of anything but the code!
[Edited by oldnewbie on 04-17-2002 at 10:45 AM]
-
Originally posted by zbrox
if (_root.getBytesLoaded() != _root.getbytestotal) {
gotoAndPlay(1);
}
If that is truly your code verbatim, then you are missing the () for the _root.getBytesTotal in addition to the previously noted capitalization issue.
so:
Code:
if ( _root.getBytesLoaded() != _root.getBytesTotal() )
{
gotoAndPlay(1);
}
Otherwise you're trying to compare the integer return value of _root.getBytesLoaded() with an [object][Function] value.
skip
-
yes...i eventually found by accident that i've missed the brackets...such a stupid mistake!
so sorry!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|