dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Array Question

  1. #1
    Senior Member
    Join Date
    Feb 2001
    Posts
    124

    Arrow


    I want to make an on the fly image array that can help place a new image inside a clip depending on which button is pushed.

    Does this look right?:

    img = new Array();
    img[0] = ["../images/topPic"+[j]+".jpg".length];

    I basically want it to function as if the images had already been placed into the array like this:

    img[0] = ['img1', 'img2', 'img3', etc...]

    if I write it like the first example, will I be able to include on the fly however many images that I put into an image directory?

    If not, could anyone suggest some other fornm to intergrate an on the fly array?

  2. #2
    Hack
    Join Date
    Mar 2000
    Location
    Madison, WI
    Posts
    1,753
    Do you mean you want the URLs of the images in the array?

    img = new Array();
    img[0] = "../images/topPic"+j+".jpg";

  3. #3
    Senior Member
    Join Date
    Feb 2001
    Posts
    124

    RE:

    Exactly.

    But, I want the script to be able to assign the image a number & then slip it into the array by taking the .length of all the images coming from the "../images/" URL.
    Then the rest of the code slips it into wherever I assign it.
    Does that make sense?

  4. #4
    Hack
    Join Date
    Mar 2000
    Location
    Madison, WI
    Posts
    1,753
    So if you have 10 pics in a folder, you want Flash to create an array of 10 URLs corresponding to them?

    You would need to use a server side script to look into the folder, count the files, and send the URLs to Flash.

    I use ASP, and you can do this with the FileSystemObject.


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