XML Image Gallery with World Style
| Category | : Flash | Views | : 43211 | ||
| Version | : 8 | Rating | : | ||
| Type | : Text | Source File | : xml-image-gallery-with-world-style.zip | ||
| Result | : See the result | ||||
this._x -= difX * this._xscale / 100
this._y -= difY * this._yscale / 100
Move the MCs according with their scales so MCs that are smaller move slower and vise-versa.
if(this.hitTest(_root._xmouse, _root._ymouse, true))
{
Run this code if the mouse is over this MC.
this._xscale = this._yscale += (100 - this._xscale) / 15;
this._rotation += (0 - this._rotation) / 5;
this._alpha += (100 - this._alpha) / 5;
Ease the scale, rotation and alpha to their default values. Alpha and the rotation change faster than the scale because we only divide them by 5.This is how the calculation for the easing effect works:
variable to ease += (end variable current variable) / speed
The bigger the speed is the slower the easing will be and vise-versa.
this.swapDepths(_root.getNextHighestDepth());
Bring this MC to the top so the smaller ones don't appear over it.
}
if(this._x < 0)
{
this._x += Stage.width;
this._xscale = this._yscale = Math.random() * 5 + 2
this._rotation = Math.random() * 360;
this._alpha = this._xscale * 20
} else if(this._x > Stage.width) {
this._x -= Stage.width;
this._xscale = this._yscale = Math.random() * 5 + 2
this._rotation = Math.random() * 360;
this._alpha = this._xscale * 20
}
if(this._y < 0)
{
this._y += Stage.height;
this._xscale = this._yscale = Math.random() * 5 + 2
this._rotation = Math.random() * 360;
t his._alpha = this._xscale * 20
} else if(this._y > Stage.height) {
this._y -= Stage.height;
this._xscale = this._yscale = Math.random() * 5 + 2
this._rotation = Math.random() * 360;
this._alpha = this._xscale * 20
}
If this MC is off the screen in any direction we just put it on the other side of the screen and we get new values for the scale, rotation and alpha.
}
_root.frames++
Increase variable that we use for unique names for the duplicates.
}
target.removeMovieClip();
}
Remove the MC that we used to load the image as we don't need it anymore.
![]() |
![]() |
![]() |
![]() |
![]() |






