Results 1 to 5 of 5

Thread: Loading images into an array from a directory

  1. #1
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Loading images into an array from a directory

    I have the following hard-coded JavaScript:

    fadeimages[0]=["photo1.jpg", "", ""]
    fadeimages[1]=["photo2.jpg", "", ""]
    fadeimages[2]=["photo3.jpg", "", ""]

    instead, I want to load all images in a specific directory into the array. I don't know the number of images so I don't know the size of the array. It can vary depending on the number of images in the directory.

    How wold I do this?

  2. #2
    Join Date
    Jul 2008
    Posts
    102
    Thanks
    36
    Thanked 6 Times in 6 Posts

    Default

    You will find your answer by looking up .push

    Dal
    Programmers are tools used to convert Caffeine to code

  3. #3
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Can you provide a link or an example?

  4. #4
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    .push method adds an element to the array. But I want to retrieve a list of files from a directory in an array.

  5. #5
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    You need server-side to accomplish this. You might have more luck on server-side section.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

Bookmarks

Posting Permissions

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