Forum Topic: action script question

(331 views • 11 replies)

This topic is 1 page long.

<< < > >>
None

SmittyMcGee

Reply To Post Reply & Quote

Posted at: 10/29/05 08:37 PM

SmittyMcGee EVIL LEVEL 03

Sign-Up: 01/07/05

Posts: 117

I know a bit of action script. But im not sure how to make something.

I need to know what the script would be for grabbing and rotating something. Like a wheel. But it has to stay in the same place.

If anyone knows please tell me. Thanks.


None

SpamBurger

Reply To Post Reply & Quote

Posted at: 10/29/05 08:38 PM

SpamBurger NEUTRAL LEVEL 15

Sign-Up: 07/12/05

Posts: 4,620

Put this code on the wheel:

onClipEvent(enterFrame){
_rotation+=5;
}

"However, the game received only two orders, one of which Molyneux speculated was from his mother." -Peter Molyneux's first game The Entrepreneur


None

SmittyMcGee

Reply To Post Reply & Quote

Posted at: 10/29/05 08:42 PM

SmittyMcGee EVIL LEVEL 03

Sign-Up: 01/07/05

Posts: 117

At 10/29/05 08:38 PM, SpamBurger wrote: Put this code on the wheel:

onClipEvent(enterFrame){
_rotation+=5;
}

No, that would make it rotate as soon as it enters the frame. I need to know the script for making it rotatewhen i grab it and rotate it.

Like:

onClipEvent(mouseDown){

yada yada yada.


None

SmittyMcGee

Reply To Post Reply & Quote

Posted at: 10/29/05 08:52 PM

SmittyMcGee EVIL LEVEL 03

Sign-Up: 01/07/05

Posts: 117

nobody knows?


None

EmoNarc

Reply To Post Reply & Quote

Posted at: 10/29/05 08:53 PM

EmoNarc LIGHT LEVEL 11

Sign-Up: 05/01/05

Posts: 1,866

At 10/29/05 08:37 PM, Fifi_Von_Stupid wrote: I know a bit of action script

NOOB... LIAR... I BET U DONT NO **** ABOUT ACTIONSCRIPT... GO **** YOURSELF!!! anywho... here you go:

onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
if (_root._xmouse += 1) {
_rotation += 1;
}
}
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
if (_root._xmouse -= 1) {
_rotation -= 1;
}
}
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
if (_root._ymouse += 1) {
_rotation += 1;
}
}
if (this.hitTest(_root._xmouse, _root._ymouse, false)) {
if (_root._ymouse -= 1) {
_rotation -= 1;
}
}
}

now a quote from Greenday:

(You) are so full of ****
Born and raised by hypocrits
Heart recycled but never saved,
From the cradle to the grave,


None

Rammer

Reply To Post Reply & Quote

Posted at: 10/29/05 08:55 PM

Rammer DARK LEVEL 31

Sign-Up: 06/08/03

Posts: 4,314

At 10/29/05 08:53 PM, BobRicci wrote: code stuff

wouldnt that check ONLY if the mouse button is clicked? not if its held down?

{ AMD Athlon 64 X2 5200+ 2.6 GHz - two 320 GB HDDs in RAID 0 - NVIDIA GeForce 8800 GT - Gyration mouse - Razer Tarantula keyboard - 2 GB Corsair RAM }

(:


None

SmittyMcGee

Reply To Post Reply & Quote

Posted at: 10/29/05 08:57 PM

SmittyMcGee EVIL LEVEL 03

Sign-Up: 01/07/05

Posts: 117

eAt 10/29/05 08:53 PM, BobRicci wrote:

At 10/29/05 08:37 PM, Fifi_Von_Stupid wrote: I know a bit of action script
NOOB... LIAR... I BET U DONT NO **** ABOUT ACTIONSCRIPT... GO **** YOURSELF!!!

I know enough to understand it. But I'm no good at writing them, because i always put stuff in the wrong orders and stuff like that.


None

SmittyMcGee

Reply To Post Reply & Quote

Posted at: 10/29/05 09:12 PM

SmittyMcGee EVIL LEVEL 03

Sign-Up: 01/07/05

Posts: 117

Come one, does anyone know what to do?


None

EmoNarc

Reply To Post Reply & Quote

Posted at: 10/29/05 09:14 PM

EmoNarc LIGHT LEVEL 11

Sign-Up: 05/01/05

Posts: 1,866

At 10/29/05 08:55 PM, 2k_rammerizkool wrote:
wouldnt that check ONLY if the mouse button is clicked? not if its held down?

oh yeah... i forgot about that...

well... you are on your own then...


None

SmittyMcGee

Reply To Post Reply & Quote

Posted at: 10/29/05 09:28 PM

SmittyMcGee EVIL LEVEL 03

Sign-Up: 01/07/05

Posts: 117

At 10/29/05 09:14 PM, BobRicci wrote:
well... you are on your own then...

Why, do you consider yourself the only person who knows what to do? Just because you can't do it, doesnt mean I'm on my own : )

Now, does anyone have any idea of what to do?


None

SmittyMcGee

Reply To Post Reply & Quote

Posted at: 10/30/05 01:37 AM

SmittyMcGee EVIL LEVEL 03

Sign-Up: 01/07/05

Posts: 117

pleeeeeease someone help me.

I will give you a big hug <3


None

Go0gley

Reply To Post Reply & Quote

Posted at: 10/30/05 01:01 AM

Go0gley LIGHT LEVEL 19

Sign-Up: 07/08/04

Posts: 218

This what you're looking for?

onClipEvent (load) {
var down:Boolean = false;
}
onClipEvent (mouseDown) {
down = true;
}
onClipEvent (mouseUp) {
down = false;
}
onClipEvent (enterFrame) {
if (down == true && hitTest(_root._xmouse, _root._ymouse, true)) {
_rotation = 90+Math.atan2(_y-_root._ymouse, _x-_root._xmouse)*180/Math.PI;
}
}

Didn't require loads of thinking..


All times are Eastern Standard Time (GMT -5) | Current Time: 11:45 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!