• Home
  • Free Tutorials
  • Free Video Tutorials

Adobe Photoshop
Autodesk 3ds Max
CSS
Flash
Help Center Live
iPhone
Joomla
Make Money Online!
Mambo
mIRC
Outlook Express
SEO / SEM
Simple Machine Forum
Target Explorer

XML Image Gallery with World Style

Category : Flash Views : 38997
Version : 8 Rating : 
3.1/5 (50 votes)
  • Currently 3.12/5
  • 1
  • 2
  • 3
  • 4
  • 5
Type : Text Source File: xml-image-gallery-with-world-style.zip
Result: See the result


Previous | 1 | 2 | 3 | 4 | 5 | Next

Free Flash Tutorials, XML Image Gallery, World Style Image Gallery

In this gallery you move all image with the mouse and when you roll over one image it will enlarge.

First create a new MC to use as a frame for the pictures:
Free Flash Tutorials, XML Image Gallery, World Style Image Gallery

The rectangle inside the frame on my MC has the size "200x150", if yours is different just remember the number because we are going to use it.
Drag an instance of this MC to the stage and name it, "frame".

Now create an XML file with the paths to the images, like this:
<xml> <images> <image1 title = "1.jpg" /> <image2 title = "2.jpg" /> <image3 title = "3.jpg" /> <image4 title = "4.jpg" /> </images> </xml>

Take some images and copy their paths to the attribute "title" of any node.

Let's start the code by loading the paths from the XML:
//Import two libraries that we are going to use for the images loaded import flash.display.BitmapData; import flash.geom.Matrix //Load the XML file, "images.xml" var image_xml = new XML(); image_xml.ignoreWhite = true; image_xml.load("images.xml") //Array for the paths of the images var images_path = new Array(); //Variable to give unique names to MCs var frames = 0 //When the XML loaded image_xml.onLoad = function() { //Loop through each node for(i = 0; i < image_xml.firstChild.firstChild.childNodes.length; i++) { //Get path _root.images_path[i] = image_xml.firstChild.firstChild.childNodes[i].attributes.title; //Create MC for the image _root.createEmptyMovieClip("frames" + i, _root.getNextHighestDepth()); //Load the image _root.MCloader.loadClip(_root.images_path[i], _root["frames" + i]); } }
Above we use and object called MCloader to load the images, it is a MovieClipLoader object that we are going to use to load all images and to get exactly when the image is loaded.


del.icio.us digg it Reddit Stumble Upon Technorati

Previous | 1 | 2 | 3 | 4 | 5 | Next
How to Video Tutorials on software by Helpvids.com

Video tutorial: Forex trading



Sponsors



Advertisement









Studio | Advertisement | About Webzo | Contact Webzo | Terms of Use | Free Video Tutorials by Helpivds

Copyright © 2007 NR Concepts Ltd. All rights reserved.