PDA

View Full Version : Need help, Flash: Drag, Rotate, and Drop


varcharcode
04-21-2006, 10:01 AM
Hi,
I'm creating a flash based-quiz and it should have an "Idea Wheel" just like the picture below, where you can drag the answers given in the choices... you have to put them inside the idea wheel. The problem is, the "answers" should be rotatable so you can fit it inside the wheel because some of them are too long... how can you do that in Flash? Do you have an FLA of any Draggable and Rotatable text?

Thanks.

http://www.tms.co.nz/in-touch/images/issue7/types_work_wheel.gif

varcharcode
04-24-2006, 06:18 AM
something like this:
http://www.geocities.com/varcharcode/dragrotatedrop.jpg

varcharcode
04-24-2006, 08:43 AM
I found this answer in another forum, it's not what I'm looking for...

put this in your Movie clip that you want to rotate, drag and drop if you're using flash MX:

onClipEvent(load) {
this.onPress = function() { this.startDrag(false,0,0,200,400); }
this.onRelease = this.onReleaseOutside = function() { this.stopDrag() }
}
onClipEvent(keyDown) {
if (Key.isDown(Key.RIGHT)) { this._rotation +=2; }
if (Key.isDown(Key.LEFT)) { this._rotation -=2; }
}



I have 5 Movie Clips and they all rotate at the same time once you press the arrow keys... They are not suppose to rotate at the same time. What i need is to make EACH rotate once it was picked... so I can assign them in the proper place in the pie chart.

varcharcode
04-26-2006, 05:31 AM
i have discovered how to do it.. just want to share with anyone who might be looking for this type of code...

MX code
for the movie clip/s you want to Drag Rotate and drop.


on (press) {
_root.current_selection = this;
startDrag("/NAMEOFINSTANCE");
}
on (release) {
stopDrag();
}


MAKE A BUTTON TO USE and insert this code
on (release) {
_root.current_selection._rotation += 45;
}


in the keyframe add this code:
current_selection = "null";

it's ok now