Adobe Flash
--
Questions
--
Followers
Top Experts
Sorry if this is obvious - I've looked all over for an answer to this problem - which I suspect is an easy one..
I have a slideshow where the user steps through the images one at a time. The images must be external jpgs and I want to load all 12 images before getting to the actual slideshow. Slideshow works fine apart from the preload - I have tried using my usual preloading techniques but the main movie seems to ignore preloading the external jpgs and jumps straight to the slideshow.
Can anyone point me to a preloading script example that works for a series of external jpg files?
Many Thanks.
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
The best thing is to post your script so somebody can tell u what's wrong.
I think you have to preload the one after another so you'll need 12 loops.
another thing is that u are probably running it from your computer and you don't see anything of the preload because it's preformed so quickly.
If so just use 'view streaming'
(in the previewwindow under view)
http://www.brajeshwar.com/archives/cat_flash_actionscript.php
//km
Here is my script attempt for loading 3 jpgs - I have a progress bar called 'loadBar' and dynamic text 'loadText':
I have put this on frame 1:
loadMovie("images/portrait
loadMovie("images/portrait
loadMovie("images/portrait
bytes_loaded = Math.round(_root.getBytesL
bytes_total = Math.round(_root.getBytesT
getPercent = bytes_loaded/bytes_total;
_root.loadBar._width = getPercent*100;
_root.loadText = Math.round(getPercent*100)
if (bytes_loaded == bytes_total) {
_root.gotoAndPlay("startsl
}
...and put this on frame 2:
gotoAndPlay(1);
I realize that simply repeating the loadMovie part at the beginning might not be a very smart idea and might be the problem - I'm not too sure how to create a loop specifically for this script but if that's definately the problem I'll try sort it out.
Thanks for any help






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
loadMovie("image1.jpg", "imageloader1")
loadMovie("image2.jpg", "imageloader2")
loadMovie("image3.jpg", "imageloader3")
put this on frame 2:
bytes_loaded = Math.round(imageloader1.ge
bytes_total = Math.round(imageloader1.ge
getPercent = bytes_loaded/bytes_total;
_root.loadBar._xscale = getPercent;
_root.loadText = Math.round(getPercent*100)
if (bytes_loaded == bytes_total) {
_root.gotoAndPlay(4); // or where the viewer starts
}
put this on frame 3:
gotoAndPlay(2);
I'm not realy sure about the about the part where u want to display the downloaded % and the rescaling of the bar.
You where right about not putting the loadMovie on the same frame as the rest because you otherwise restart loading the jpg's everytime u went to that frame
The main problem what that your bitesloaded and bytes_total where those of the movieclip and not those of the pictures.
And remember to save before u test your movie because if ther is a problem in the loop it could be that Flash MX crashes
Sorry but I've tried the script exactly as you posted and I just can't get it to work. I've stripped out the % and loadBar just to make sure and still no luck.
The script still only downloads the 3k of the main movie and ignores the 3 external jpg images (35k). Do you perhaps have any other ideas? I don't know if you have the time but I've linked to the .fla here if you want to have a look - Thanks again.
http://www.padukltd.com/help.html
Before the loading is finnished the movie won't go to the next frame so it can't work how i told u but u have to put the preloader in another movieclip
I've changed it and put it online
(but I think pictures will be loaded one after another an not all at ones)
but you still have to put the mathround in it
http://users.pandora.be/flplayer/

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Thanks for this link - from what I can understand, everything is called from the external data1.txt file? What exactly do you write in the file?
I've tried just putting in a list of the image names (image1.jpg, image2.jpg etc) - didn't work.
Cheers






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
in the function getPercent:
/*...*/ the commented area is an alternate, but not working properly... i don't no why???
the trace commands are only for test purposes...
bye!

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Adobe Flash
--
Questions
--
Followers
Top Experts
Adobe Flash (formerly Macromedia Flash) is a cross-platform multimedia and software platform used to embed animations, video, and interactive applications into web pages and desktop and mobile applications and games. Flash displays text, vector and raster graphics to provide animations, video games and applications. It allows streaming of audio and video, and can capture mouse, keyboard, microphone and camera input. The ActionScript programming language allows creation of interactive animations, video games, web applications, desktop applications and mobile applications.