Yes, as I explained in my long paragraph, the new code parses the images and urls from one text file.
Think of the split() function as something that breaks larger pieces of data in smaller ones. First we split() the entire text file into individual lines. Then, we split the individual lines into images and urls.
Remember, each line in the text files is set up like this: images.jpg|http://www.website.com
The array.push() has nothing to do with reading a value from an array. It writes to the array.
If I have an array like this:
Code:
fruits = array("apple", "orange", "grape");
and I do this:
Code:
fruits.push("banana");
It will add banana to the end of the fruits array. So you'll get.
Code:
fruits = array("apple", "orange", "grape", "banana");
So, back to the marquee example. Once the for loop completes, all of the images and the URLs will be in their separate arrays because of this method.
I hope that makes sense.
Bookmarks