|
Scrapbook Photo Gallery tutorial in Flash Goodie!! We will learn three flash behaviors while creating this eye-catching photo gallery and they are -
- Load external graphic behavior ,
- On-click behavior to lift photograph right on top and
- Drag -and- drop behavior
Let’s begin the tutorial,
- Import and use any background you like
- Next ,we will have to create a movie clip to hold the photograph,
Please follow the steps below to create the same, 1. Create a movie clip symbol and name it ‘pic_mc’
2. Now in this movie clip symbol, create a larger white square vector graphic, which will behave as a photo border. Lock this layer and create a new layer above the same and create a gray colored square vector graphic which is smaller than the white one and align it center to the white one.
3. Select this gray square vector graphic and convert it to a movie clip symbol and give it an instance name ‘photo’. This movie clip is now done, return to main ‘scene1’. - Now drag this movie clip ‘pic_mc’ into your canvas and name it ‘pic1’,
- Likewise, drag three more and name them ‘pic2’, ‘pic3’ and ‘pic4’.
- Move the 4 images and name them ‘pic1’, ‘pic2’, ‘pic3’ and ‘pic3’ into the directory where this flash source file resides.
Actionscripting – Load external graphic behavior - Insert another new layer in your flash file and name it ‘actions’.
- Select ‘Frame1’ of actions layer and paste below script in your actions window.
//load Graphic Behavior this.pic1.photo.loadMovie("pic1.jpg"); //End behavior
//load Graphic Behavior this.pic2.photo.loadMovie("pic2.jpg"); //End behavior
//load Graphic Behavior this.pic3.photo.loadMovie("pic3.jpg"); //End behavior
//load Graphic Behavior this.pic4.photo.loadMovie("pic4.jpg"); //End behavior |
On-click behavior to lift photograph right on top and drag and drop behavior - Select each movie clip and paste the below script in the actions window
on (press) { //Start Dragging Movieclip Behavior startDrag(this); //End behavior
//Bring to Front Behavior mx.behaviors.DepthControl.bringToFront(this); //End behavior }
on (release) { //Stop Dragging Movieclip Behavior stopDrag(); //End behavior } |
Press 'Ctrl+Enter' to view the your Scrapbook photo gallery.
Click here to download source file
You can also view other Flash Photo Galleries at My photographs and Pranav
Tags: Flash photo gallery, load external images, drag and drop, actionscript photo
gallery
|