Movable XML Image Gallery
| Category | : Flash | Views | : 29620 | ||
| Version | : 8 | Rating | : | ||
| Type | : Text | Source File | : movable-xml-image-gallery.zip | ||
| Result | : See the result | ||||
onClipEvent(mouseUp)
{
this.mDown = false;
this.stopDrag();
}
If the mouse was released set mDown to false and use stopDrag() to stop dragging the Movie Clip with the mouse.
onClipEvent(mouseMove)
{
if(this.hitTest(_root._xmouse, _root._ymouse, true))
{
if(this.mDown)
{
Only run this code if the mouse is down.
if(Key.isDown(Key.CONTROL))
{
_xscale += _root._xmouse - this.oldMousex;
_yscale += _root._xmouse - this.oldMousex;
Change the scale of this Movie Clip by the difference of the current position of the mouse and the old one.
this.stopDrag();
}
Stop dragging.
else if (Key.isDown(Key.SHIFT))
{
_rotation += _root._ymouse - this.oldMousey;
Change the rotation with the mouse movement, just like scaling.
this.stopDrag();
}
Stop dragging.
this.oldMousex = _root._xmouse;
this.oldMousey = _root._ymouse;
}
}
}
Set the old position of the mouse to the current position so we can use it on the next mouse movement.
var images_xml = new XML();
images_xml.ignoreWhite = true;
images_xml.load("images.xml");
Create XML object and load the xml file "images.xml".
var images_path = new Array();
This array will be the node with all images paths.
images_xml.onLoad = function()
{
_root.images_path = images_xml.firstChild.childNodes;
Set the array we created previously to the nodes with the images paths.
![]() |
![]() |
![]() |
![]() |
![]() |




