A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Flash MX Photo Gallery Question

  1. #1

    Flash MX Photo Gallery Question

    Hello All:

    I have created a photo gallery using the example given with-in MX.

    My question is... Is there a way I can add a preloader to each of the jpg files that are being loaded in for those folks on a slow connection.

    I thought about making each jpg a swf file and including a preloader on each movie, but I am hoping to avoid all the extra work.

    This is the script I am using for the gallery.


    //initialize variables and properties
    square._alpha = 0;
    whichPic = 1;
    //initiate change to new image when buttons are clicked
    next.onPress = function() {
    if (whichPic<16 && !fadeIn && !fadeOut) {
    fadeOut = true;
    input = whichPic;
    back.onPress = function() {
    if (whichPic>1 && !fadeIn && !fadeOut) {
    fadeOut = true;
    input = whichPic;
    _root.onEnterFrame = function() {
    // when a new Photo is selected, fade out, load new image, and fade in
    if (square._alpha>10 && fadeOut) {
    square._alpha -= 10;
    if (square._alpha<10) {
    loadMovie("image"+whichPic+".jpg", "square");
    fadeOut = false;
    fadeIn = true;
    if (square._alpha<100 && fadeIn && !fadeOut) {
    square._alpha += 10;
    } else {
    fadeIn = false;
    // limit input field
    if (input>16) {
    input = 16;
    // initiate change to new image when Enter key is pressed
    if (Key.isDown(Key.ENTER)) {
    fadeOut = true;
    whichpic = input;
    // if a number is entered in the input field but Enter is not pressed, change
    // back to current Photo number when clicking anywhere else
    inputField.onKillFocus = function() {
    input = whichPic;


    Thanks much for the help!

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    press the picture...
    Go to http://can_info_guide.tripod.com/
    and check xml dynamic content (I think?) Anyway look for simple slideshow. You will find what you want. When the user looks at one slide the next one will preload.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center