-
loading JPEG into movieclip question
Hi
im loading a whole load of JPEGs into seperate movieclips BUT im now unable to include any 'loading' devices as they're not included within SWF files
does anybody know how I can do this?
thanks alot for your help
-
Senior Member
If you want to preload the images, you can have a preloader in the main timeline that targets the movieclips you are loading the jpg's into.
-
mmmmm..... these images will be loaded one at a time once everything else has been loaded - kind of like a gallery - so I dont want to load them all at the beginning, but one by one.
The crude way to do it is to put the word 'loading' underneath the area its being loaded into - but this wont let me have a loading bar or anything.
-
Senior Member
You can put a preloader anywhere in the movie, and preloading just specific things as jpg's loading in a empty movieclip. I use it all the time even to preload 5kb images or swf's.
Its just a matter of targeting the empty mc instead of the _root as you do with preloaders for the whole movie.
-
mmmmm.... but if I do a getbytesloaded on an empty movieclip it will think its loaded before the jpeg has loaded wont it?!
Im confused
I might just put the jpeg into its own SWf and load that instead
-
what im trying to say is - the jpegs getting loaded directly into the swf and so there isnt any way of knowing how much of it has loaded is there?
if it was already sitting at the end of a swf you could tell how much of the total has been loaded
-
Senior Member
I dont know how you are loading the jpg's, normally you load jpgs into target movieclips. If thats the case you have an if statement that makes shure some bytes are loaded before checking. That way it wont try to figure out a empty MC.
Heres the code I use ( I have it on a MC, with a percent textfield in it ).
(jpgMC being the name of the movieclip where a jpg is loaded into).
onClipEvent (enterFrame) {
// PRELOADER PART
tb = math.round(_root.jpgMC.getBytesTotal()/1024);
lb = math.round(_root.jpgMC.getBytesLoaded()/1024);
percent = math.round((lb/tb)*100);
if (lb>5) {
if (percent == 100) {
_root.movies.play();
}
}
-
oooook cheers - ill give it a try - Im guessing i put this code on the mc the jpegs being loaded into
-
its not working for me
im loading my jpeg like follows:
loadMovie("image2.jpg", "image");
and then putting your code onto the MC 'image' with a textfield on the main stage called percentage - but no percentage shows up
never mind - ill stick to my basic way for thetime being
thanks anyway
-
Senior Member
Here is a slide show where the next pic is loaded while you look at one pic but not all of them. Check the scripts also inside the empty movieclips.
- The right of the People to create Flash movies shall not be infringed. -
-
woh! - that's a little bit over my head (some of it)
so your preloading ALL the images at the start before you go on?
i really need them to load individually so you can see each one as it loads.
I might put this on the back burner for the time being - but thanks for all your help
I'll try and figure out your file later on
thanks again
-
Senior Member
No. Look at this code:
function loadImage(img,nextImg,viewNext,viewPrev){
clipLoader_1.loadMovie(viewNext);
clipLoader_2.loadMovie(viewPrev)
bilder_1.loadMovie(img);
bilder_2.loadMovie(nextImg);
bilder_2._alpha = 0;
}
in bilder_1 you load your pic which you want to see. In bilder_2 which is invisible you preload your next pic but you load only one at a time. Just use frames to show your pics. I know people like to make slideshows with one frame but sometimes that is not convenient.
- The right of the People to create Flash movies shall not be infringed. -
-
mmmm... its becoming a little clearer. Basically - what ive got is a movieclip - in this movieclip is another 6 empty movieclips which 6 jpegs get loaded into (all at once).
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
|