I have a site I built that loads jpg’s dynamically by clicking back and forward buttons. How can I call a preloader to work before each picture loads so that people will know the pictures are loading after they click the back and forward buttons? Please check out my site to see what I am talking about: www.jwduncan.com/The_Dunc…index.html\r\rOnce you get to the site just click on “April 2002” and you will see the arrows to choose the pictures to see. The pictures load but they take a while on a 56k dial-up, which is why I need a preloader to show up before the picture does. \r\rHere is the code I am using that I got from a MX tutorial:\r\r// initialize variables and properties\rstop();\rinput = 1;\rsquare._alpha = 0;\rwhichPic = 1;\r// initiate change to new image when buttons are clicked\rnext.onPress = function() {\r if (whichPic<10 && !fadeIn && !fadeOut) {\r fadeOut = true;\r whichpic++;\r input = whichPic;\r }\r};\rback.onPress = function() {\r if (whichPic>1 && !fadeIn && !fadeOut) {\r fadeOut = true;\r whichpic–;\r input = whichPic;\r }\r};\r_root.onEnterFrame = function() {\r // when a new Photo is selected, fade out, load new image, and fade in\r if (square._alpha>10 && fadeOut) {\r square._alpha -= 10;\r }\r if (square._alpha<10) {\r loadMovie(“images/April2002/image”+whichPic+".jpg", “square”);\r fadeOut = false;\r fadeIn = true;\r }\r if (square._alpha<100 && fadeIn && !fadeOut) {\r square._alpha += 10;\r } else {\r fadeIn = false;\r }\r // limit input field\r if (input>10) {\r input = 10;\r }\r // initiate change to new image when Enter key is pressed\r if (Key.isDown(Key.ENTER)) {\r fadeOut = true;\r whichpic = input;\r }\r};\r// if a number is entered in the input field but Enter is not pressed, change\r// back to current Photo number when clicking anywhere else\rinputField.onKillFocus = function() {\r input = whichPic;\r};\r\r\rThank you very much for anyone’s help.\r\rjonathan@jwduncan.com
Related topics
Topic | Replies | Views | Activity | |
---|---|---|---|---|
Preloader on Dynamic Jpg Loader | 2 | 81 | March 15, 2003 | |
Preloader needed for jpg
|
5 | 60 | July 28, 2003 | |
God help the newb - How to add a preloader to this script (External jpegs) | 0 | 109 | September 17, 2003 | |
Preloading dynamic jpg
|
0 | 36 | July 13, 2007 | |
Jpeg preloading (I did a search!)
|
5 | 92 | June 11, 2003 |