Forum Topic: Halp. :c -need Flash Code For Game

(152 views • 9 replies)

This topic is 1 page long.

<< < > >>
None

Mariahchu

Reply To Post Reply & Quote

Posted at: 4/14/09 03:52 PM

Mariahchu NEUTRAL LEVEL 01

Sign-Up: 04/14/09

Posts: 3

I have an Adobe Flash CS4 program, and I needs the code that makes items dragable. I'm trying to make a dress-up game thingy. I found one code, but it didn't do anything when I tried testing it. Plz help~ :c


None

Mariahchu

Reply To Post Reply & Quote

Posted at: 4/14/09 03:53 PM

Mariahchu NEUTRAL LEVEL 01

Sign-Up: 04/14/09

Posts: 3

Oh and it may be helpful if I mention I have the clothes for the character in different layers. Like, all the shirts on one layer, pants in another, etc.


None

mayoarm11

Reply To Post Reply & Quote

Posted at: 4/14/09 03:55 PM

mayoarm11 NEUTRAL LEVEL 17

Sign-Up: 06/13/07

Posts: 1,013

AS2:

on(press){ //or on(release)
_x = _root._xmouse;
_y = _root._ymouse;
startDrag(this);
}

Then when you want to stop dragging, you type stopDrag();

Awesome turret game in the making, featuring 85 uniqe turrets: News post

BBS Signature

None

Mariahchu

Reply To Post Reply & Quote

Posted at: 4/14/09 03:59 PM

Mariahchu NEUTRAL LEVEL 01

Sign-Up: 04/14/09

Posts: 3

At 4/14/09 03:55 PM, mayoarm11 wrote: AS2:

on(press){ //or on(release)
_x = _root._xmouse;
_y = _root._ymouse;
startDrag(this);
}

Then when you want to stop dragging, you type stopDrag();

Will this make it so that a person can move things with their mouse?


None

Zielak

Reply To Post Reply & Quote

Posted at: 4/14/09 04:11 PM

Zielak FAB LEVEL 17

Sign-Up: 09/21/05

Posts: 865

At 4/14/09 03:59 PM, Mariahchu wrote:
Then when you want to stop dragging, you type stopDrag();
Will this make it so that a person can move things with their mouse?

yes


None

Smconstpdgy

Reply To Post Reply & Quote

Posted at: 4/14/09 09:50 PM

Smconstpdgy FAB LEVEL 03

Sign-Up: 07/08/07

Posts: 87

At 4/14/09 03:52 PM, Mariahchu wrote: I have an Adobe Flash CS4 program, and I needs the code that makes items dragable. I'm trying to make a dress-up game thingy. I found one code, but it didn't do anything when I tried testing it. Plz help~ :c

UP BUP BUP!

You didn't put in the release script..

on(press){
_x = _root._xmouse;
_y = _root._ymouse;
startDrag(this);
}

on(release){
this._x = this._x
this._y = this._y
// Don't know if those are needed.
stopDrag(this);
}


None

mayoarm11

Reply To Post Reply & Quote

Posted at: 4/15/09 05:26 AM

mayoarm11 NEUTRAL LEVEL 17

Sign-Up: 06/13/07

Posts: 1,013

At 4/14/09 09:50 PM, Smconstpdgy wrote: UP BUP BUP!

You didn't put in the release script..

on(press){
_x = _root._xmouse;
_y = _root._ymouse;
startDrag(this);
}

on(release){
this._x = this._x
this._y = this._y
// Don't know if those are needed.
stopDrag(this);
}

don't be stupid. That's not needed.

Awesome turret game in the making, featuring 85 uniqe turrets: News post

BBS Signature

None

henke37

Reply To Post Reply & Quote

Posted at: 4/15/09 05:39 AM

henke37 NEUTRAL LEVEL 23

Sign-Up: 09/10/04

Posts: 3,604

He means that the assignments are not needed, the method calls are still needed.

Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.


None

ThePeasant

Reply To Post Reply & Quote

Posted at: 4/15/09 11:03 AM

ThePeasant NEUTRAL LEVEL 08

Sign-Up: 08/30/07

Posts: 447

NO MORE DUMB DRESSUPS!

and p.s. - don't call them 'games' because there's no game in them. They could be applications.


None

GodlyKira

Reply To Post Reply & Quote

Posted at: 4/15/09 11:52 AM

GodlyKira LIGHT LEVEL 05

Sign-Up: 12/21/08

Posts: 73

At 4/14/09 09:50 PM, Smconstpdgy wrote: on(press){
_x = _root._xmouse;
_y = _root._ymouse;
startDrag(this);
}

on(release){
this._x = this._x
this._y = this._y
// Don't know if those are needed.
stopDrag(this);
}

Woah too much script and way to messy,

onEnterFrame = function() {
for (var i in _root) {
if (this[i]._parent) {
this[i].onPress = function() {
this[i].startDrag();
}
this[i].onRelease = function() {
this[i].stopDrag();
}
}
}
}
BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 07:42 PM

<< 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!