Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preloader for images in seperate swf

Status
Not open for further replies.

HostaDesigner

Technical User
Dec 6, 2000
14
US
I have a site with over 75 thumbnailed plant pictures. In order to reduce download time, I made each larger pic that is activated from clicking it's thumbnail a seperate .swf that's loaded into the next level of the movie. How can I make a preloader that responds to the kb size of the image as it loads so that the user isn't staring at a blank screen while it loads?

Mike
 
hi

Like many of the great new features of Flash5, Macromedia have kept this well hidden. You can use the getBytesLoaded action. The following is copied from Help:



MovieClip.getBytesLoaded

Syntax

anyMovieClip.getBytesLoaded();

Arguments

None.

Description

Method; returns the number of bytes loaded (streamed) for the specified Movie Clip object. Because internal movie clips load automatically, the return result for this method and MovieClip.getBytesTotal will be the same if the specified Movie Clip object references an internal movie clip. This method is intended for use on loaded movies. You can compare the value of getBytesLoaded with the value of getBytesTotal to determine what percentage of an external movie has loaded.

Player

Flash 5 or later.


Hope it helps
dD
davdesign@hotmail.com

^^^^^^^^^^^^^^^^
 
Ok. I've tried to use the getBytesloaded action to get my preloader to work. The preloader shows up, but it's operating out of sequence with the image being loaded. How do I write the actionscript to get this loader to work?? I am stumped. The seperate .swf is 11 frames: 1 for each 10% of the image in frame 11. I want the preloader to advance 1 frame for every 10% of the image in frame 11. To see what my problem is, go to:

home.att.net/~mike.groothuis/hostaspot.html
Click the secret white button in the lower left of the screen (trust me, it is there)
Skip the intro, click the "photos" button to go to the thumbnails page, click on the first thumbnail to get the temporary image to load. The preloader should show up there.

Also...Any way to get the download size reduced for the site as a whole? I'm still working on that too. I sure wish I could figure this complicated stuff out on my own...I guess I have to start somewhere! :)

Thanks!
Mike
 
Hi Mike:
Davdesign will surely come up with an answer on your preloader... Meanwhile here are my comments:

1- I think your preloader is working... it's not just showing the picture the first time around, but on a second visit(the picture or movie being in my machine's cache) it shows up quite fast. Hiting the home button then causes a problem since you're not unloading that picture's movie, and it covers the menu.
2- You don't seem to have solved your email form problems... Guess you have these more important problems to solve.
3- As for cutting down the size, I think you should make several movies with each item, and only load them at user's request(ie when he hits one particular item). Work on a copy of your fla... In case it doesn't turn out the way you want it to. In anycase, your loading time is not that bad... On my 56k standard connection, I can easily suffer it because you're offering me something to look at rather then just an empty screen. Maybe it's also because I like hostas... Mine are buried under 2 feet of snow right now... but spring is coming soon!

Regards,
François Gill ;-)
 
Just a little item of help that I discovered the other day that takes the hassle out of filling in a form:(put this in the first keyframe of the scene)

Selection.setFocus(insert variable name of text box here);

This will put the cursor in the text field for the user as they get to that page. Simple, easy and effective.
Hope this helps...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top