-
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?
-
Thanks anyway, splice() did the trick. Seems like a bug though.
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|