flash->load jpgs
- Started
- Last post
- 18 Responses
- kyl3
Hi , I need to preload a bunch of jpgs into my swf and would like to show a button as they load and are available. I've tried to use a conditional statement to check and move to the next frame if its loaded but I'm not having too much luck.
can anyone help me out? Thank you very much in advance.
- version30
and this?
http://files.swish-tutorials.com…
- kyl30
thanks v3, I will take a look
- kyl30
Is that swish tut supposed to have a .fla included?
- kyl30
I'm still having probs checkiing the status of these loaded .jpgs. Can anyone help me out with solution to check the progress of the .jpg and move to the next frame if loaded.
sorry for being so clueless. Thanks!
- version30
the swish has a download button at the bottom of the page
- kyl30
yep, downloaded it but there was only a swf and swi file(plus the source jpgs). Am I missing something?
- brokenimage0
swish is a program that produces swf files. it's kind of a dumbed down version of flash (haven't tried it, just read about it).
You should load the jpeg into an empty movieclip and check to see how much has been loaded into the clip inside an onEnterFrame function. (mcLoader.loadMovie("pic.jpg");
mcLoader.getBytesLoaded();
mcLoader.getBytesTotal();)then if get bytes loaded is >= get total bytes > play();
but you'll want to test to see if the total bytes is greater than 5 or something like that, cause sometimes it can start out at 0 and get bytes will be 0 too.i don't know if this helps, but you can definitely find a shit load of resources about this stuff online. try kirupa.com flash forums.
- kyl30
thanks, here is example of what I'm trying to accomplish
http://www.cameronlawson.com/mov…
click on the 'work' section then select a section. If anyone knows of a tutorial which deals with this type of thing I'd love to see it.
- brokenimage0
http://www.kirupa.com/developer/…
just use that tutorial but combine it with what i was talking about.
- brokenimage0
http://www.kirupa.com/developer/…
just use that tutorial but combine it with what i was talking about.
- kyl30
Thanks again everybody, It's not as simple as a preloader. I'll have to think this out a bit.
- unfittoprint0
this may sound somewhat complex if you're a newbie but it's the best solution, imo.
create an xml file that list all your desired jpgs
create a preloader with the follooing.
#1 a loop [onEnterFrame or interval] that checks the xml loading.
#2 if finished, delete the loop [clearinterval or delete onEnterFrame] and store each jpeg location path in an array
#3 start new loop,
. create a var count to indicate wich image you're loading.
.attachMovie or createEmptyMovieClip to create mc[s] to hold each image. use loadMovie and the respective path stored in your array.
.target it and when finished loading, increase the count number and start with the next image
. if count = array.length you're finished.
- kyl30
Thanks Unfit, I'll look into that. sounds like a good solution.
If I wnted a button to appear after each images was loaded could I just have like 30 mcs ready with the buttons in place and attach or target those MCs. Would that be the best way to get that effect?
- kyl30
attachMovie or createEmptyMovieClip to create mc[s] to hold each image. use loadMovie and the respective path stored in your array.
===
er... shoulda read again. Thanks again!
- unfittoprint0
a little help
if you already have your paths stored your looped function could look something like this:
- kyl30
You're awesome unfit. I'm going to give this a shot and I'll let you know. Thanks again!
- Hello-Sexy0
you could also use a MovieClipLoader and use the onLoadComplete function to create the button or mc once the jpg is loaded. you wouldnt have to use an interval or enterframe.
start like unfit said, use xml to bring in the list, a for loop to load them. then movieClipLoader would make it a tad easier. No loops or load percentage checking...