Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-12-2012, 03:42 PM   #1
MarcianoSR
Registered User
 
Join Date: Jul 2012
Posts: 28
Default [AS3] Dragging problem

Hi there,

I have a problem with using the drag property, hittesting another sprite. I'm creating a game which need a strict hitTest on another sprite.

So my game is about bombs that pop up every second, pink and black. The user needs to drag them to a certain field which belongs to the bomb color (obviously pink and black). The bombs bounce back if they reach the end of the stage, but also, when they hit a field on the egde, it bounces in an other direction. Just some simple physics. If you DRAG the bomb in the right field, your scores increases, the bomb's velocity will be set on 0 and the mouse will be disabled for that perticular bomb. So far so good it all works.

My problem is that when I drag the bomb half over the field the bomb's velocity won't stop, they score counts one up, and the mouse is disabled.

I can't show any pictures or send the link to the game since I don't have 50 posts yet.

Hope my problem is clear,


Thanks in advance.
MarcianoSR is offline   Reply With Quote
Old 07-12-2012, 04:12 PM   #2
acolyte
Senior Member
 
acolyte's Avatar
 
Join Date: Feb 2005
Posts: 532
Default

Hi Marciano,

sry i dont reaLY GET IT when you drag the bomb over a field where you assigned a hitTest
then the velo. goes up and the bomb is drifting away ?

there is a way how to post links here simply leave out the http:// stuff in the url and then you can post links

would be realy helpfull
__________________
>>I know my english sucks, ... but I speak german.
(this Signature was stolen from some french guy)
acolyte is offline   Reply With Quote
Old 07-12-2012, 06:37 PM   #3
MarcianoSR
Registered User
 
Join Date: Jul 2012
Posts: 28
Default

Hi acolyte,

Thanks for your answer!

First, the links:

stap.iam.hva.nl/~schildm001/bomb/BombSort.swf
stap.iam.hva.nl/~schildm001/bomb/bombgame.jpg


Ok, so what I mean to say is that when the game starts, bombs randomly come in to view. They move with an velX and velY which has a value of 2 pixels. When I drag and drop the bomb into the right field, (the pink in the pink field for example) I set the value of bomb velX and velY on 0 and disable the mouse to the current bomb.

I hope this is clearer now with the links.
MarcianoSR is offline   Reply With Quote
Old 07-13-2012, 09:30 AM   #4
acolyte
Senior Member
 
acolyte's Avatar
 
Join Date: Feb 2005
Posts: 532
Default

Hi Marciano ,

can you provide a flashfile i could help you figure it out .
thnx
__________________
>>I know my english sucks, ... but I speak german.
(this Signature was stolen from some french guy)
acolyte is offline   Reply With Quote
Old 07-13-2012, 11:06 AM   #5
MarcianoSR
Registered User
 
Join Date: Jul 2012
Posts: 28
Default

Hi Acolyte,

Im not using Flash at all, im all coding this in FlashDevelop.

Link to the Main class:
stap.iam.hva.nl/~schildm001/bomb/Main.as

Link to the Fields class:
stap.iam.hva.nl/~schildm001/bomb/Fields.as

Link to the Bomb class:
stap.iam.hva.nl/~schildm001/bomb/Bomb.as

Thanks for your help!
MarcianoSR is offline   Reply With Quote
Old 07-13-2012, 12:17 PM   #6
acolyte
Senior Member
 
acolyte's Avatar
 
Join Date: Feb 2005
Posts: 532
Default

Marciano ,

its strange i am trying to trace out when reversey is called
__________________
>>I know my english sucks, ... but I speak german.
(this Signature was stolen from some french guy)

Last edited by acolyte; 07-13-2012 at 12:47 PM.
acolyte is offline   Reply With Quote
Old 07-13-2012, 05:58 PM   #7
MarcianoSR
Registered User
 
Join Date: Jul 2012
Posts: 28
Default

What is your idea? What is wrong with the reverseX?
MarcianoSR is offline   Reply With Quote
Reply


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


All times are GMT. The time now is 05:23 AM.

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