Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Flash Actionscript's HitTest Function

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Wed Oct 08, 2008 5:06 pm    Post subject: Flash Actionscript's HitTest Function Reply with quote

How does hit test work? I tried hooking IntersectRect (The only collision function I know) but apparently Flash's HitTest doesn't use Intersect so... How does that function worK and is there a way to hook it?
Back to top
View user's profile Send private message
Overload
Master Cheater
Reputation: 0

Joined: 08 Feb 2008
Posts: 293

PostPosted: Wed Oct 08, 2008 6:44 pm    Post subject: Reply with quote

Which ActionScript? I use HitTest all the time in AS3.
_________________
Blog

Quote:
Rhys says:
you can be my maid
Rhys says:
ill buy you a french maid outfit
Tyler says:
Sounds good
Rhys says:
ill hold you to that
Back to top
View user's profile Send private message MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Wed Oct 08, 2008 6:56 pm    Post subject: Reply with quote

IDIOT >.>

Im trying to hook hittest not call it...
Back to top
View user's profile Send private message
LolSalad
Grandmaster Cheater
Reputation: 1

Joined: 26 Aug 2007
Posts: 988
Location: Australia

PostPosted: Wed Oct 08, 2008 7:28 pm    Post subject: Reply with quote

dnsi0 wrote:
IDIOT >.>

Im trying to hook hittest not call it...


You're the idiot. Nobody can help you hook it unless you tell us which version of ActionScript.

I know how you can hook it with ActionScript itself if it's ActionScript 2, by the way.

_________________
Back to top
View user's profile Send private message MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Wed Oct 08, 2008 7:35 pm    Post subject: Reply with quote

as2
Back to top
View user's profile Send private message
LolSalad
Grandmaster Cheater
Reputation: 1

Joined: 26 Aug 2007
Posts: 988
Location: Australia

PostPosted: Wed Oct 08, 2008 8:20 pm    Post subject: Reply with quote

Code:
_root.htBackup = MovieClip.prototype.hitTest;
MovieClip.prototype.hitTest = function(xORtarget, y, shapeFlag) {
   if (shapeFlag != null) {
      trace('hitTest (3 parameters form): ' + this + ', ' + xORtarget + ', ' + y + ', ' + shapeFlag);
      return _root.htBackup(xORtarget, y, shapeFlag);
   } else {
      trace('hitTest (single parameter form): ' + this + ', ' + xORtarget);
      return _root.htBackup(xORtarget);
   }
}
trace(hax1.hitTest(hax2));
trace(hax1.hitTest(25, 25, hax2));


hax1 and hax2 are MovieClips on the stage. This hooks both forms of hitTest; the one that requires a single parameter (target) and the other which requires 3 parameters (x, y, shapeFlag).

Outputs:
Code:
hitTest (single parameter form): _level0.hax1, _level0.hax2
true/false
hitTest (3 parameters form): _level0.hax1, 25, 25, _level0.hax2
true/false

_________________
Back to top
View user's profile Send private message MSN Messenger
Overload
Master Cheater
Reputation: 0

Joined: 08 Feb 2008
Posts: 293

PostPosted: Wed Oct 08, 2008 9:41 pm    Post subject: Reply with quote

dnsi0 wrote:
IDIOT >.>

Im trying to hook hittest not call it...

Don't be so quick to judge.

_________________
Blog

Quote:
Rhys says:
you can be my maid
Rhys says:
ill buy you a french maid outfit
Tyler says:
Sounds good
Rhys says:
ill hold you to that
Back to top
View user's profile Send private message MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Thu Oct 09, 2008 5:20 pm    Post subject: Reply with quote

No your not getting me...
What I want is to edit the memory NOT as.
So basically flash processes hitTest as a function and uses commands to execute. So I want to edit a compiled flashj movie and hook HitTest so that I can create a godmode in certain areas.
Back to top
View user's profile Send private message
LolSalad
Grandmaster Cheater
Reputation: 1

Joined: 26 Aug 2007
Posts: 988
Location: Australia

PostPosted: Fri Oct 10, 2008 12:22 am    Post subject: Reply with quote

dnsi0 wrote:
No your not getting me...
What I want is to edit the memory NOT as.
So basically flash processes hitTest as a function and uses commands to execute. So I want to edit a compiled flashj movie and hook HitTest so that I can create a godmode in certain areas.


By using AS2 you can create that godmode effect; that code I posted is capable of hooking hitTest in a compiled Flash movie by using LoadMovie with the hooking SWF, and can use commands like fscommand to send the data to the program or it can do all the godmode work itself.

_________________
Back to top
View user's profile Send private message MSN Messenger
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Fri Oct 10, 2008 12:27 am    Post subject: Reply with quote

IntersectRect is windows API, Flash is cross platform. It will use a custom function.
Back to top
View user's profile Send private message MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Fri Oct 10, 2008 8:32 am    Post subject: Reply with quote

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites