Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Flash Actionscript Maddness
Old 08-05-2010, 09:44 PM Flash Actionscript Maddness
Extreme Talker

Posts: 201
Name: Brian
Trades: 0
So I am trying to create a thing that I can drag, drop and rotate an image by click of the mouse. I have the click and drag part down, but how can I get it to rotate? I want to basically click the corner, and spin it clock or counter clockwise.

This is my code so far for the drag and drop

Code:
import flash.events.KeyboardEvent;
import flash.events.Event;

movieClip_1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_2);

function fl_ClickToDrag_2(event:MouseEvent):void
{
	movieClip_1.startDrag();
}

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_2);

function fl_ReleaseToDrop_2(event:MouseEvent):void
{
	movieClip_1.stopDrag();
}


stage.addEventListener(KeyboardEvent.KEY_DOWN, fl_PressKeyToMove_2);

function fl_PressKeyToMove_2(event:KeyboardEvent):void
{
	switch (event.keyCode)
	{
		case Keyboard.UP :
			{
				movieClip_1.y -=  5;
				break;

			};
		case Keyboard.DOWN :
			{
				movieClip_1.y +=  5;
				break;

			};
		case Keyboard.LEFT :
			{
				movieClip_1.x -=  5;
				break;

			};
		case Keyboard.RIGHT :
			{
				movieClip_1.x +=  5;
				break;

		}
	}
};
Its pretty much what flash gave me.

If you can help that would be great.

Thanks.
bdg1115 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Flash Actionscript Maddness
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20840 seconds with 12 queries