XML Image Gallery with Falling Pictures (Snow Effect)
| Category | : Flash | Views | : 34385 | ||
| Version | : 8 | Rating | : | ||
| Type | : Text | Source File | : xml-image-gallery-with-falling-pictures.zip | ||
| Result | : See the result | ||||
The images will be loaded and fall randomly until the user clicks one of these images.

Then the image clicked will enlarge and center on the screen. If the user clicks on another image or outside the enlarged picture, this picture will go back to its original size and continue falling.

The first thing to do here is to load our XML file with the paths to the images; so create an XML file like this one:
<xml>
<images>
<image1 title = "0.jpg" />
<image2 title = "1.jpg" />
<image3 title = "2.jpg" />
<image4 title = "3.jpg" />
</images>
</xml>
Put as many nodes as you want inside
I have the images ready and saved the XML to "images.xml". Both XML and images need to be in the same folder of your flash file.
Open you flash file and set the size of the stage to 800x500, that's the size we will be using, then open the actions for the first frame in the stage and paste:
//Import libraries for the BitmapData and Matrix objects
import flash.display.BitmapData;
import flash.geom.Matrix
//Create XML object
var image_xml = new XML();
//Set the ignoreWhite property to false
image_xml.ignoreWhite = true;
//Load the XML file "images.xml"
image_xml.load("images.xml")
//Array to store the paths to our images when we take them from the XML
var images_path = new Array();
//This is a variable we are going to use to keep track of how many images frames we have
frames = 0;
//Later we will write a code to know if all images loaded, if they did we set this variable to true
ready = false;
Now before we write the Event Handler for the XML to get the paths to the images we need to make our Frame MC, just create a new MC and draw a frame anyway you want it:

![]() |
![]() |
![]() |
![]() |
![]() |







