- Home
- Tutorials
- Flash
- Intermediate
- How to Use the Easy Slideshow Component v1.0

Page 4 of 7
That's all the data you need to get the Slideshow to work.
Working with the loadHandler:
As mentioned earlier, when the a file is loaded into the slideshow, the loadHandler function is called. The load Handler is passed the current file's attributes in the first argument in the format.
{
attributeName1: currentFileValue,
attributeName2: currentFileValue
}
So in this case, it will pass only the URL as {URL: "myImage1.jpg"} for the first file.
The second argument passed will be the attributes array
[attributeName1, attributeName2, ...]
So in this case, it will be ["URL"], since there is only one attribute, in our data File.
The third argument passed is loadID. This specifies whether the currently loaded file is a "data" file containing the file list or the actual file that is a part of the transition. Its returns "file" only. Where would this be useful?
The Easy Slideshow component has a method, getAllAttributes ();
This method returns an object that resembles the structure of you data file.
Since attributes won't be loaded until the data file has loaded, you can check in the loadHandler if the the 3rd argument is "file", and only then call the getAllAttributes () method. The structure of the object in this case would be,
{
num1: {URL: "myImage1.jpg"},
num2: {URL: "myImage2.jpg"},
totalFiles: 2
}
Using this object you can build data to supply to other components, like a comboBox component. The sample file does exactly this. Using this you can further extend the Easy slideshow component into a general purpose website interface!
