This tutorial will cover one of the most interesting and powerful Variable Types in Actionscript,"The Arrays. Well to get this Simple for you , the Array is an Object that lets you save, access and manipulate the content of the Arrays. The Array is an object whose properties are identified by a number representing their position in the array, this Number is referred by "index", All Array starts with the Index 0. and there is no better than example to clarify this, I will Create an Array Called ourArray.
Now let's discuss what we can do with this Arrays, Normally Arrays stores a lot different data from Strings , Integers , Complex object to Arrays , which means that you can create a multi-dimension Array by inserting an Array into another. This is an Array holding a different type of Variable.
//lets create ourArray var ourArray = new Array("I am String into my our Array" );
//lets create myArray myArray[0] = "I am a String"; myArray[1] = 5; // I am a number. myArray[2] = ourArray ; // I am an Array
trace(myArray[2][0]); // The output will be "I am String into my our Array".
The Array Object has several method for manipulating the array. Array.concat : Concatenates the parameters and returns them as a new array. Example:
Slideshow is really kinda rare at the internet , I tried to look at some ready Slideshow that need just some modification and here we are ready , but it seems that I can't find what I want, that why I want to write this tutorial to help some people like me that are interested in a slide show .
This slide show is made with Flash 8 and ActionScript 2, and Will use the XML File .
The XML File "filelist.xml" would look like something like this :
This Snippet of Code will load the xml file , and will launch the function ChangeClip() with an interval of 10 seconds , which means that the function will be repeated each 10 seconds and will change the picture.
function ChangeClip(XMLValue) { element = XMLValue.firstChild;
easeType = mx.transitions.easing.Regular.easeOut; var begin = 20; var end = 100; var time = .5; var mc = ourMovieClip;
ballTween = new mx.transitions.Tween(mc, "_alpha", easeType, begin, end, time, true);
counter++;
}
This Snippet of code is a function that will load the image or the Movie Clip in the Stage and will increase the value of the counter
the Transition that was used here is a type of transition that wasn't documented in the flash class documentation , there is a lot different method for doing this kind of transition , so you can have a different type of transition.