Movable XML Image Gallery - Page 6
Posted by : webzo on Mar 12, 2008
Next
_root.Frame.Pic.load(images_path[0].attributes.title);
Load the picture for the Frame Movie Clip we already placed on the stage.
for (i = 1; i < _root.images_path.length; i++)
{
This for statement will loop the number of paths we have inside "images_path".
duplicateMovieClip(Frame, "Frame" + i, _root.getNextHighestDepth());
Duplicate the frame Movie Clip.
var frame = _root["Frame" + i];
The variable "frame" is set to be the Movie Clip we just created, any changes made on the variable "frame" will be done on the Movie Clip as well.
frame._x = Math.random() * 400 + 20;
frame._y = Math.random() * 20 ? 40;
Set the starting position for the Movie Clip using the "frame" variable. The frame is placed above the screen because we coded the Movie Clip to move to a destination inside the screen.
frame.imagePath = _root.images_path*.attributes.title;
}
}
Here we set the "imagePath" variable to the attribute "title" of the node "i" inside the images_path array.
Then the Movie Clip will load the image using this variable.

no comment
Add comment