Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

preloader only recycles, never get to main show

Engaged ,
Feb 12, 2009 Feb 12, 2009
Dear folks, suddenly I have a preloader that will not work.

I dont know code enough to troubleshoot.
Would someone kindly comment perhaps to help?

The preloader is Scene 1.
The Main show follows as Scene 2, Scene 3.
That is the order in "Scenes".

The preloader is 3 frames.
The load bar is a Movie clip called "bar", which has a simple bar, register point left, on frame one.
There is the appropriate dynamic text (%loaded, etc) in frame one.
Here is the code frame one:

lBytes = _root.getBytesLoaded();
tBytes = _root.getBytesTotal();
pctLoaded = Math.floor((lBytes/tBytes)*100);
bar._xscale = pctLoaded;
loaded._xscale = pctLoaded;
percentText.text = "loading... "+pctLoaded+"%";
statusText.text = "("+Math.floor(lBytes/1024)+"kb of"+Math.floor(tBytes/1024)+"kb)";

and here is the code frame 3:

if (_pctLoaded>10) {
gotoAndPlay("Scene 2", "start");
} else {
gotoAndPlay(1);
}

the idea is to start the show, Scene 2, frame "start", after 10% is loaded,
and we should see the progress bar, and kb's read out.
But now, only the preloader continuously cycles.

Thanks for any tips !!


OK how about this?
I bet frame 3: percent loaded refers only to the preloader.
How do I get it to count scene 2?


ignore extra attachment:
TOPICS
ActionScript
380
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 12, 2009 Feb 12, 2009
use the same variable in frame 1 and frame 3: either both pctLoaded or both _pctLoaded.

and you shouldn't use scenes to navigate and don't use the goto functions. use frame labels and the goto methods:

_root.gotoAndPlay("scene2_start"); // <- label that frame.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Feb 12, 2009 Feb 12, 2009
thanks I'll try this.

OK it all worked great.
I wonder why it did not prior?
those items did not seem like "deal breakers"
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 12, 2009 Feb 12, 2009
LATEST
pctLoaded and _pctLoaded might look the same to you and me but to a computer language they're totally different. that was a deal breaker.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines