A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Image detection in folder script?

  1. #1
    Flash Poser
    Join Date
    Nov 2002
    Posts
    217

    Image detection in folder script?

    _root.createEmptyMovieClip("container", 1);
    rand = random(9);
    container.loadMovie("fimages/image"+rand+".jpg");
    container._x = container._y=0;
    container._alpha = 0;

    In our fla we have this on frame one which proceeds to load an image by fading it in from a folder. Is there any possible script that can detect the amount of images in a folder and load those? Because sometimes there are blank images (no images) which loads.
    Thanks in advance!

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    With your script you are also loading image0.jpg, which you may not have.

    Use this updated random script instead to just load images 1-9 .

    rand = math.round(math.random()*8+1);

    Flash can not look into folders. In that case you will need a server side script like php,asp or cgi.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Flash Poser
    Join Date
    Nov 2002
    Posts
    217
    thank you so much pellepiano!

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