Loading images dynamically

Ask a Question related to Macromedia Flash Data Integration, Design and Development.

  1. #1

    Default Loading images dynamically

    I have a slideshow that I am working on and the way the slideshow works is that
    it assigns any number of images i define to an array.

    problem is, i dont know how to check how many images are in a particular
    folder on the hard drive. the number of images being displayed could be
    anywhere from 1-200. "numofImages" is the variable that I am going to use to
    cap off the looping statement... how do I tell flash to: "look in this folder
    on the hard drive", "read how many elements are in the folder", "record that
    number in 'numofImages' "?

    I have some of my relavent code here:

    //NUMBER VARIABLE FOR ARRAY
    var N:Number;
    //NUMBER VARIABLE FOR THE NEXT IMAGE LOADED FROM THE ARRAY
    var nxtImage:Number = 0;

    /*FOR STATEMENT... IF N IS LESS THAN numofImages ADD TO IT
    AND THEN REPEAT THE STATEMENT IMG_ARY[N]
    RESET THE IMG_VAR VARIABLE AND PRINT IT*/
    for (N=0;N<numofImages;N++) {
    img_var = "image"+N+".jpg";
    img_ary[N] = img_var;
    }

    LuckysCharms2000 Guest

  2. Similar Questions and Discussions

    1. Dynamically loading xml content
      I?m creating a menu bar in which the links have to be dynamically created based on the values in the xml, and the number of links(buttons) may even...
    2. Dynamically loading PNG and GIF files through XML
      Hello, I have a project where I need to use XML to dynamically load PNG and GIF files not just JPEGs. I have found forums and information from...
    3. dynamically loading css-rules!
      what is the question, I dont get it, you said it print correctly the styles, so what's the problem ? Savut "Sindre Hiåsen" <paalhi@ifi.uio.no>...
    4. dynamically loading images and manipulating them
      Hi I am trying to load a series of images(jpg) based on information returned by a cold fusion query, and then break the images up into pages of...
    5. dynamically loading video
      hi flashbrains, anyone know if its possible to dynamically load a video file into a flash movie? i want to have the my SWF reading a text file to...
  3. #2

    Default Re: Loading images dynamically

    Flash cannot look into server folders.

    You need a server side script that will determine the number of files and
    send that count back to Flash.

    --
    Lon Hosford
    [url]www.lonhosford.com[/url]
    May many happy bits flow your way!
    "LuckysCharms2000" <webforumsuser@macromedia.com> wrote in message
    news:dnpqlb$j5a$1@forums.macromedia.com...
    I have a slideshow that I am working on and the way the slideshow works is
    that
    it assigns any number of images i define to an array.

    problem is, i dont know how to check how many images are in a particular
    folder on the hard drive. the number of images being displayed could be
    anywhere from 1-200. "numofImages" is the variable that I am going to use
    to
    cap off the looping statement... how do I tell flash to: "look in this
    folder
    on the hard drive", "read how many elements are in the folder", "record that
    number in 'numofImages' "?

    I have some of my relavent code here:

    //NUMBER VARIABLE FOR ARRAY
    var N:Number;
    //NUMBER VARIABLE FOR THE NEXT IMAGE LOADED FROM THE ARRAY
    var nxtImage:Number = 0;

    /*FOR STATEMENT... IF N IS LESS THAN numofImages ADD TO IT
    AND THEN REPEAT THE STATEMENT IMG_ARY[N]
    RESET THE IMG_VAR VARIABLE AND PRINT IT*/
    for (N=0;N<numofImages;N++) {
    img_var = "image"+N+".jpg";
    img_ary[N] = img_var;
    }


    Motion Maker Guest

  4. #3

    Default Re: Loading images dynamically

    there are solutions...
    if the flash can't read how many images are in that folder, U can help him...

    if in the folder is images named image#.jpg where # is the number, and there
    are no missing numbers U can stop where the image is no more loading in a movie
    clip in at most 3s (timeout)
    kind of:
    loadmovie("image"+index+".jpg",q);
    wait 3s (can do a loop for 3*fps or make frames for 3s)
    if(q.getBytesLoaded<1){//there are no more files}

    or U can put a .txt file with the N=#, and load it into fla, so U don't have
    to change the fla just edit the .txt file when number of images

    danredman Guest

  5. #4

    Default Re: Loading images dynamically

    IF you can process asp then its easy to get the count.

    dim totalFiles
    Set imgDirectory=Server.CreateObject("Scripting.FileSy stemObject")
    Set imageFiles=imgDirectory.GetFolder(Server.MapPath"/images/"))

    For each filefound in imageFiles.files
    totalFiles = totalFiles + 1
    next

    zensoldier Guest

  6. #5

    Default Re: Loading images dynamically

    thanks guys ill look into that
    LuckysCharms2000 Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139