| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Nov 2001
Posts: 11
|
Okay I decided to do a little operation flash game instead of checkers like everyone suggested. The only problem is that I don't know how to set up the timer and I am having problems with startDrag. I was looking at this eggplant game in the flash folder and I tried to make the button instance and a movie clip but nothing would drag you would just see the hand over it. I am a little confused about having a button instance inside the movie clip. I wanted to make it where if you move the heart or whatever in the wrong place then it would beep and if you get it right then it wouldn't beep. I was wondering would I need to look at if then statements.
|
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,612
|
get your drag working first.
create your button. then create a new MC (Ctrl F8) and drop a copy of your button into the MC. that's it. then you have to put the drag commands on the button (see the drag'n'drop tute). then you can use hitTest to determine if the placement is appropriate.
__________________
Cheers Jesse Stratford ActionScript.org Cofounder Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org Please don't email or PM me Flash questions, that's what the Forums are for! ![]() Please don't rely on me reading my PMs either. Email me about important stuff. |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Nov 2001
Posts: 11
|
I am a beginner at actionscripting. But I am making an operation game in flash. I have all my pieces such as the heart, the body, etc. I really don't know where to go next. I wanted to make a timer and whenever you drag a piece in the wrong place it will beep to let them know that's the wrong place. The player will have only 30 seconds to win. I have been trying to find something in my book about get timer or hitTest but I can't find anything. I don't know if I need to use if then statements or what. I was wondering if anyone could help please.
|
|
|
|
|
|
#4 |
|
Registered User
Join Date: Nov 2001
Posts: 11
|
Hi,
I think so u should have dragable pieces and the location where it has to be placed as movie clips.test it with hittest with a if condition.it will be better if u send me the raw fla file. ![]() |
|
|
|
|
|
#5 |
|
Risu Oyabun!
Join Date: Apr 2001
Location: Houston, Texas
Posts: 1,460
|
This is much like a paper doll project, so I'm gonna butt my nose in with a few suggestions.
First off, look up all of the following functions in your documentation:
In addition, knowing how to position a MC by modifying the _x and _y are a MUST. I would make a MC with a tiny dot in it. Using an onClipEvent(enterFrame), have the dot MC follow the mouse position. The code will look something like this... Code:
onClipEvent(enterFrame) {
this._x = _root._Xmouse;
this._y = _root._Ymouse;
}
That should get you off in the right direction, eh? Need more? Post again! |
|
|
|
|
|
#6 |
|
Registered User
Join Date: Nov 2001
Posts: 11
|
That's another question I had is that I am not quites sure how to make a buzzard. Cause I wanted to make it where the wrong areas of the body when it comes into contact with the different organs there will be a beep sound. Also I am not sure how to post my source file on here.
|
|
|
|
|
|
#7 |
|
Risu Oyabun!
Join Date: Apr 2001
Location: Houston, Texas
Posts: 1,460
|
To attach a file here, look near the bottom of the page when posting. You'll see a section for attaching a file. You'll see a browse button.
This is really a moderate to advanced kind of project. It's a good idea to have the basics down when it comes to Flash... knowing about the three symbol types and how they work, knowing about how variables interact and how to access properties. If ya don't know that stuff by heart, read up! Do the lessons provided in the Flash Help menu. To guide you in the right direction, check this out. Define an area around which you want the clip to "snap" to... make sense? Like, if the user drops the heart NEAR the area it should be, then it goes into place... otherwise it gets a buzz. To define that box, draw a rectangle around the area and jot down the 4 coordinates: left, right, top, and bottom. Define some variables on your draggable movie clip(s). Lookie here:
See those snap variables? They are used when the dragged clip is released. Have an if statement check to see of the clip was dropped within the boundaries of the snap-to box. If it was, have it "snap" to the designated coordinates. The code would look something like this... Code:
on(release, releaseOutside) {
if (((this._x >= snapX1) && (this._x <= snapX2)) &&
(this._y >= snapY1) && (this._y <= snapY2))) {
this._x = snapX;
this._y = snapY;
}
}
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FlashGameLicense.com - virtual marketplace to connect game developers and buyers | AdamSchroeder | General Chat | 0 | 12-18-2007 10:16 PM |
| My first video game! / Test it! | janevblagoj | Gaming and Game Development | 0 | 08-26-2007 08:18 AM |
| Nietzsche: My first AS2 game | SHDR | Gaming and Game Development | 2 | 07-16-2007 09:13 AM |
| Rate My Game, plz fill the questioner | UzumakiJr | Site Check | 0 | 12-16-2006 09:48 PM |
| Card Game (turn-based) - Lobby Room and Game Room, maintain state | cururu | ActionScript 2.0 | 3 | 05-20-2006 03:06 AM |