I used this tutorial to make a load bar. It works fine when preloading, say, an image file in the 3rd frame. However, when I try to make it show the loading status of a frame with the following attributes, it falters:
3 buttons (play, pause, stop)
an integrated audio clip (mp3) controlled by the 3 buttons
For some reason, the loadbar doesn’t work. It just displays a white block on the Web page the size of the .swf file, and remains that way until the file is loaded, and then displays frame 3 (the audio feature). It’s as if the load bar frames don’t exist.
I used the exact same file, but modified it so that I replaced the 3rd frame (the audio buttons and stuff) with a simple BMP image, and the loadbar works. So the problem lies with the 3rd audio frame I’m meaning to use.
Any ideas? I’m pretty new with Flash and can’t figure out a solution.
I’ll try it out, but here’s a little question I got in general about Flash: what does “_root” refer to? I see it all the time.
EDIT: I tried it and it doesn’t seem to work.
I have lots of experience in intermediate to advanced Java, so I’ll understand it pretty easily I think if you explain it to me sort of briefly. I tried Googling for it but didn’t really get any answers.
When you create a new movie, and you’re staring at the timeline. That’s the _root timeline. If you add a movie to that timeline named myMovie, for example, then you would access properties of myMovie as _root.myMovie. If you opened myMovie and dropped in yet another moview called myMovie2, you would access the properties of the new movie as _root.myMovie.myMovie2.
Just like last time, you don’t see any load bar or anything while it loads. You get a white block on the browser while it loads, and when it does load, it goes straight to frame 3, as if frames 1 and 2 don’t exist.
And it only happens when I use those audio buttons and junk for frame 3. Using an image file or something arbitrary as content in frame 3, the load bar works.
It looks like your trying to preload sound objects using the attach sound method, which will not work the way you’re trying to do it. Sound objects are exported on frame one (regardless of where they are declared). And, they are exported before your preloader code.
So, the solution is to save your sound objects are swf’s and preload those swf’s. To do this, define your sound objects in an new movie that will contain nothing but your sound objects. Define them like this:
music = new Sound(this);
music.attachSound(“audio”);
The word “this” is key. Create the swf.
Then, in your main movie, use loadMovie to load them into an empty mc. For example,