Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-10-2001, 06:30 PM   #1
Registered User
Join Date: Nov 2001
Posts: 11
Question need help with game

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.
lashon20 is offline   Reply With Quote
Old 11-10-2001, 11:12 PM   #2
ActionScript.org Founder
Jesse's Avatar
Join Date: Nov 2000
Location: New York
Posts: 8,736

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.

Jesse Stratford
ActionScript.org Cofounder

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.
Jesse is offline   Reply With Quote
Old 11-15-2001, 05:37 PM   #3
Registered User
Join Date: Nov 2001
Posts: 11
Post help with operation game

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.
lashon20 is offline   Reply With Quote
Old 11-16-2001, 07:18 AM   #4
Registered User
Join Date: Nov 2001
Posts: 11

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.
flashveda is offline   Reply With Quote
Old 11-16-2001, 02:24 PM   #5
20 Ton Squirrel
Risu Oyabun!
20 Ton Squirrel's Avatar
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:
  1. startDrag - To initialize the drag of the pieces. Don't lock on center!
  2. stopDrag - To stop dragging. Nuff said
  3. hitTest - To test if the mouse is hitting the buzzer area
  4. onClipEvent - To do lots of stuff!

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

onClipEvent(enterFrame) {
    this._x = _root._Xmouse;
    this._y = _root._Ymouse;
This little dot MC is what you will use to test if the user is hitting the buzzer area. You could put the hitTest in that same onClipEvent, just make certain to only have it check when the mouse is down...

That should get you off in the right direction, eh? Need more? Post again!
20 Ton Squirrel is offline   Reply With Quote
Old 11-16-2001, 08:24 PM   #6
Registered User
Join Date: Nov 2001
Posts: 11
Post don't know how topost my file

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.
lashon20 is offline   Reply With Quote
Old 11-16-2001, 09:10 PM   #7
20 Ton Squirrel
Risu Oyabun!
20 Ton Squirrel's Avatar
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:
  1. snapX1 - Left corner of the snap-to box
  2. snapX2 - Right corner of the snap-to box
  3. snapY1 - Top of the snap-to box
  4. snapY2 - Bottom of the snap-to-box
  5. snapX - The X coordinate of the snap
  6. snapY - The Y coordinate of the snap

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...
on(release, releaseOutside) {
     if (((this._x >= snapX1) && (this._x <= snapX2)) && 
          (this._y >= snapY1) && (this._y <= snapY2))) {
          this._x = snapX;
          this._y = snapY;
That help any?
20 Ton Squirrel is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump

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 09:16 PM
My first video game! / Test it! janevblagoj Gaming and Game Development 0 08-26-2007 07:18 AM
Nietzsche: My first AS2 game SHDR Gaming and Game Development 2 07-16-2007 08:13 AM
Rate My Game, plz fill the questioner UzumakiJr Site Check 0 12-16-2006 08:48 PM
[AS2] Card Game (turn-based) - Lobby Room and Game Room, maintain state cururu Gaming and Game Development 3 05-20-2006 02:06 AM

All times are GMT. The time now is 09:29 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.