• 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

Movable XML Image Gallery

Category : Flash Views : 68778
Version : 8 Rating : 
2.7/5 (105 votes)
  • Currently 2.70/5
  • 1
  • 2
  • 3
  • 4
  • 5
Type : Text Source File: movable-xml-image-gallery.zip
Result: See the result


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

rot = (Math.random() * 90) – 45
Set the variable "rot" to a random rotation between -45 and 45.

xSpeed = Math.random() * 5 + 2 ySpeed = Math.random() * 5 + 2
Random _x and _y speed.

rotSpeed = Math.random() * 5 + 2
Get a random speed for the rotation.

loaded = false; }
Variable used to know whether the image is loaded or not.

onClipEvent(enterFrame) { if(!loaded) {
If the image is not loaded move the Movie Clip to the destination.

this._y += (destY - this._y) / ySpeed; this._x += (destX - this._x) / xSpeed;
Move the code using this easing math:
(destination - current position) / speed;
The smaller the speed the faster the Movie Clip will move and vise-versa.

this._rotation += (rot - this._rotation)/rotSpeed; }
Rotate Movie Clip with easing.

if(this.Pic.percentLoaded != 100) { this.percent.text = this.Pic.percentLoaded; }
If the image is not 100% loaded set the text of the textbox to the current percentage.

else { this.percent._visible = false; loaded = true; } }
If the image is loaded hide the textbox by setting the visibility to false and set loaded to true.

onClipEvent(mouseDown) { this.oldMousex = _root._xmouse; this.oldMousey = _root._ymouse;
Set the old position to the current position of the mouse.

this.mDown = true;
Mouse is down so set to true.

if(this.hitTest(_root._xmouse, _root._ymouse, true)) { this.startDrag(); this.swapDepths(_root.getNextHighestDepth()); } }
If the mouse clicked on this Movie Clip use the function startDrag() to automatically make the mouse drag the Movie Clip and use swapDepths(depth) to get this frame on the top of the others.


More cool tech articles from other blogs.

Place your ad here
Loading...


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

Sponsors





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

Copyright © 2007 NR Concepts Ltd. All rights reserved.