Flash Templates

Flash Templates Today
Web Sites
Free Shape
Photoshop Tutorials
Flash Tutorials

Free Website Templates
View All Templates!
Preview & Download
Preview & Download
Recommended Hosting:
Host Unlimited Domains on 1 Account
1500GB storage and 15000GB bandwidth for $6.95/mo!
Recommended Hosting:
Host Unlimited Domains on 1 Account
1500GB storage and 15000GB bandwidth for $6.95/mo!
Free Website Templates: 123456789101112131415
Preview & Download Preview & Download Preview & Download

Welcome To MyFreeWebTemplates.info Flash Tutorials Area - Read _droptarget property

Drag blue rectangle over the yellow. If you drop the blue one on the yellow, the script will align blue rectangle inside the yellow.

NOTE: Minimum Flash Designer version 5.0.17 (verify revision number under "Help" > "About...", download update if required)

Follow the steps below:

  1. Launch Flash Designer and choose "blank".
  2. Set the frame delay to "Stop" ("Frame" > "Frame Delay").
  3. Size the frame at about 300x300. ("Frame" > "Frame Size")
  4. Create 1 small and 1 larger shapes with the rectangle tool and give them different fill colors.
  5. Select smaller shape and click Edit > Convert to Sprite.
  6. Right-click it and click "Placement Properties".
  7. Check the "Action-Script Target" checkbox and click OK.
  8. Click the other shape and repeat the process.

Smaller shape (blue) should appear as "Sprite3" and larger (yellow) as "Sprite4". If necessary rename the sprite: select it and choose "Item" > "Placement Properties"

Choose "Frame" > "ActionScript" and paste the code:

Sprite3.onPress = function()
{
	Sprite3.startDrag();
};
Sprite3.onRelease = function()
{
	if(Sprite3._droptarget=="/Sprite4") 
	{
		// align Sprite3
		Sprite3._x = Sprite4._x + (Sprite4._width-Sprite3._width)/2;
		Sprite3._y = Sprite4._y + (Sprite4._height-Sprite3._height)/2;
	};
	Sprite3.stopDrag();
};



Press F9 to preview the movie.

_droptarget always returns the path with a leading slash /.

Download source project t1048.zip (4 kb)


Illustrator Tutorials
HTML Tutorials
Flash Templates
Free Web Templates
Free Website Templates
Free Flash Templates
Web Templates Forum
Welcome to MyFreeWebTemplates.info we have a collection of Free Templates available for download created by designers from around the globe. Our collection is growing daily so be sure to check back often for more Free Templates. If you can't find a Free Template that suits your needs, we may offer you many professional web templates and flash web templates.

Website templates are pre-made website designs that you can customize and personalize to suit your company's image.You can save time and money by using website templates for your design project.
All Rights Reserved 2007-2008 by MyFreeWebTemplates.info