PDA

View Full Version : I'm a noob trying to Preloading a swf & attachsound


jiggaracci
07-21-2003, 04:34 PM
Here's the deal.
I made a nice media interface using flash 5 and I use the attachsound method when doing so. I am aware that everything loads at the beginning of the movie so I can't put a preloader anywhere. I have read all of the fixes about creating another movie clip and insert the sound in there. I don't need a fancy preloader with get byte results, I just want a bar that grows as it goes. Can someone pleaseeeeeeeeeeeeeeee, explain this to me in laymen terms. I am somewhere in between the beginners and intermediate level, simply cuz I've been working with Flash 5 for over 2 years, I guess I can't be called a beginner. These swf files are around 3-5mbs and I really don't want to have to stream because the quality is reduced drastically. I know somewhere, someone, can help me through this. But if there's no simple solution, I guess I will have to stream.

spriggan
07-22-2003, 11:22 PM
have a look at our turorial sections above. There's several on what you want to do.

Bloom22
07-23-2003, 06:49 AM
Hi , check out this one

http://www.actionscript.org/showMovie.php?id=42

:)

jiggaracci
07-23-2003, 02:08 PM
Hey Bloom,
Nice freaking site. I'm watching it now over and over (Hope you don't mind), I'm just trying to get some ideas so that maybe I could create content as visually captivating as yours. I'm at work and I'm blown away. I also saw the link and downloaded the fla for that tutorial, but I don't think it's quite what I'm looking for.

PS are yal looking for an Intern, apprentice, freelancer, gopher? I am totally on yals N#TT$.

Bloom22
07-23-2003, 03:35 PM
Sorry Jiggaracci, these sites aren't mine. I just linked to them because I find them inspirational.

But you can check out the "Projects and Positions" Forum on actionscript.org when you're looking for freelance work:

http://www.actionscript.org/forums/forumdisplay.php3?s=&forumid=4

May I help you with something else? :)

Warrior
07-24-2003, 04:48 PM
In your case you have to create a new movie and load the movies you want. I made a flash file for you and it's in Flash 5 format but uses the getBytesTotal(); and getBytesLoaded(); but don't feel upset because it's seven lines of code and I commented it so you can know which line does what. You will find it easy ;) :)

jiggaracci
07-24-2003, 06:30 PM
Thanks Warrior,
I'm @ work right now, but I will check it out soon as I get home!

jiggaracci
07-24-2003, 06:33 PM
another thing, that little text counter @ the end of you posted

"Attachment: preloader.zip
This has been downloaded 0 time(s)"

Is that a javascript code, because I wanted a counter, a text counter like the one in your posting.

While we're at it, can I have that code also?

Warrior
07-24-2003, 07:55 PM
That's not me. It's the message board. Anyone could do it if they upload a file that is 102KB in size. As for the code about how many people downloaded, you can get one in Hot Scripts (http://www.hotscripts.com) look in Javascript or PHP :D ;)

jiggaracci
07-25-2003, 01:29 AM
Just checked it out and scanned through the code. It worked, it think, it goes so fast, even with 14.4. The swf I'm loading is 2.1mb. And I followed what you said, but at first, my buttons (play) wouldn't work. So I changed the level it loaded inthe first line of code and then it worked. But I looked at the preloader symbol(MC) itself, and It don't appear to have any tweening or sort to it. Did u intentionally leave this out so I could edit it, or is it supposed to be doing so and it's loading so fast I don't have a chance to see it. However, I do see the bar first so I do know it loading properly.

Warrior
07-25-2003, 02:06 AM
That's my fault that the movie is loading so fast :rolleyes: I forgot to put back the download speed, sorry. Test the movie then go to Debug ---> 56K (4.7Kb/s) and see how fast it is now.
It don't appear to have any tweening or sort to it. Did u intentionally leave this out so I could edit it, No, it's supposed to be like that so that it automatically tweens it self in size. I only done the bar so you can add any loading animation you want. Can you post the code you modified ;)

jiggaracci
07-25-2003, 02:12 AM
// **If you have any problems PM me I would be willing to help**
// This line loads the movie
onClipEvent (load) {
loadMovieNum ("jiggaracci.swf", 0);
}
onClipEvent (enterFrame) {
// This line checks the size of the movie and times it by 100
Preloader = (_level1.getBytesLoaded()/_level1.getBytesTotal())*100;
// This line tells the bar to check the amount loaded and keep up
setProperty (bar, _xscale, Preloader);
// This two lines say that if the movie has finished loading
// Tell the loaded movie to go to a frame lable inside that movie
// You have to place a lable some where and give it a name then
// Change the name in the last line of this code
if (_level1.getBytesLoaded() == _level1.getBytesTotal()) {
_level1.gotoAndPlay("jiggaracci");
}
}

Warrior
07-25-2003, 02:24 AM
Thanks, I just wanted to see the code and check it for any errors. Why are you loading the movie is _level0?

jiggaracci
07-25-2003, 02:33 AM
I think thtat loading it through 0 is loading it ontop, through
level 1 , my buttons don't work. I working with your preloader. I customized my debug down to 7.2 @ 600 bps and It appears a lot slower so I can see it, but the bar dont' appear to be growing.

Warrior
07-25-2003, 02:45 AM
It should be growing but because the size is in MB and not KB, it will take a long time unless you have a BroadBand connection.