In our tutorial here we are going to build a flash image gallery using the photos stored in the flash library , our result would be something similar to this like this




1- firstly we create the rectangle and the color name and we convert it to a MovieClip and we repeat the same task till we finish all the color and have similar result in figure one.



2- import all the images to the library by choosing file menu , and place or use the shortcut ctrl+R , and import all the images of the cars with different colors.




4-at the step we would give the images in the library a unique identifier and export them to AS , for that they would be accessible from actionscript, right click on the images in the library and we check the checkbox of export for actionscript ,and we give a unique identifier for each image in the library.



5- we create an empty movie clip and we call it " displayer" , this is movie clip is where our cars would be shown , whenever we rollover colors.

6-now we click on the color movie clip and we go to the action section , we add the event onRollover

on(release){
import flash.display.BitmapData;
var linkageId:String = "car1";
var myBitmapData:BitmapData = BitmapData.loadBitmap(linkageId);
this._parent.displayer.attachBitmap(myBitmapData, this.getNextHighestDepth());

}
in the linkageid we give the unique identifier of the car that is in the library that would be shown, after we create a bitmapData and we load it to our movie clip displayer.
here is the sample movie












Posted in Libellés : , Publié par y. elhafyani à l'adresse 4:23 AM  

1 commentaires:

  1. Abhisek Says:

    Wow! Great blog. Wish to get more from here.

 
Copyright 2005-2008 Flash RIA .