dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Array Problem

Hybrid View

  1. #1
    muvipix.com
    Join Date
    May 2001
    Location
    Maine
    Posts
    289

    Array Problem

    I'm creating a simple array from an xml file -

    Code:
    pictures = new Array();
    for (var i = 1; i<=_root.Images; i++) {
    	pictures[i] = _root.image_folder+xmlData.gallery[1].images[i-1].image[0].file.value;
    }
    This outputs my image paths fine, but for some reason, it puts a comma at the very beginning?

    ie -

    , images/image1.jpg,images/image2.jpg,images/image3.jpg, etc...Is there an easy way to get rid of that first comma?
    Regards,

    Ron

  2. #2
    muvipix.com
    Join Date
    May 2001
    Location
    Maine
    Posts
    289
    Thanks anyway, splice() did the trick. Seems like a bug though.
    Regards,

    Ron

  3. #3
    Actionscript Flotsam
    Join Date
    Feb 2003
    Posts
    33
    I don't know if it would make a difference in your case, but whenever I'm asking Flash to resolve a complicated path including variables, I won't ask it to perform operations on both sides of the equal sign at the same time.

    So, I'd set a temporary variable like:

    nowpicture = everything on the right side of your equal sign.

    pictures[i] = nowpicture

    This little bit of handholding has made things easier for Flash, in my experience.

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