Hi, today i made a dragger to view large images inside the small mask and here i am to show for you how to use it if you need. Well, the dragger need only create a simple object and set the content movieclip and the mask movieclip instances, the classe do the rest. See the sample bellow.

(Either JavaScript is not active or you are using an old version of Adobe Flash Player. Please install the newest Flash Player.)

You can click and drag the image into this box, you can put the box or with the width and height as you want and the same for the loaded image, you can use the size as you want too. But how to do it work fine ? Let’s go to the document class:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package
{
	import com.dLibs.events.Events;
	import com.dLibs.loadit;
	import com.dLibs.utils.dragIt;
 
	import flash.display.MovieClip;
 
	public class DocumentClass extends MovieClip
	{
		private var image:loadit;
		private var theImage:String = "http://farm4.static.flickr.com/3631/3375666390_505733a332_b.jpg";
 
		public function DocumentClass():void
		{
			image = new loadit(theImage,true);
			image.addEventListener(Events.COMPLETE, imgComplete);
			image.addEventListener(Events.PROGRESS, imgProgress);
			content.addChild(image);
		}
 
		private function imgProgress(e:Events):void
		{
			// trace(e.obj.percentLoaded);
		}
 
		private function imgComplete(e:Events):void
		{
			var drag:dragIt = new dragIt();
			drag.drag(content,maskImage);
			addChild(drag);
		}
	}
}

Here i load the Flickr image (Jesus Jones, Me and Joisiney Leandro) and only into the complete event i put the function that make the dragger. First step is create the dragIt object like show the line 29.

The second step is set the Movieclips, the content clip and the maks clip, using the Public Function drag. See the line 30, and add the object to stage aaand done. Test the movie and you can drag your own pictures into the mask, so easy. To make the sample you can download the sample bellow or only classes using the SVN repository: http://asdatalibs.googlecode.com/svn/trunk/

Download the sample project: Drag large images into the box (210)

Read too:

3 Responses to “Drag large images inside the box”

  1. linkfeedr » Blog Archive » Drag large images inside the box - RSS Indexer (beta) Says:

    [...] images inside the box VA:F [1.1.8_518]Rating: 0.0/5 (0 votes cast) This article was found on . Click here to visit the full article on the original website.Hi, today i made a dragger to view large images inside the small mask and here i am to show for you [...]

  2. » Drag large images updated: now with zoom | DES 84 - Blog of DES84 Website Says:

    [...] again, now i will show an update of the post Drag large images inside de box. Now the class dragIt have the option to use zoom in and out the content of the [...]

  3. DIY Makeup Says:

    Hi hunnie, nice site! I genuinely appreciate this article.. I was wondering about this for a while now. This cleared a lot up for me! Do you have a rss feed that I can add?

Leave a Reply