-
XRave
BlaBlaBla hittest [HELLLP]
Hi, I am developing a mouse stillness test
I have a hittest area on my stage, named trace. This area is erased into 2. so that mouse could run between the 2 area with out touching them. however, I done something stupid to warn the user the mouse touched the Hit area:
//A dynamic textbox is there on the stage named results
Code:
onClipEvent(load)
If(Trace.Hittest.True)
setProperty("results", "Hit!")
}eles{
setProperty("results", "safe")
}
Anything gone wrong? the Hittest didn't work a single bit...
Regards,
Tongxn
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
try this
PHP Code:
onClipEvent(enterFrame)
If(Trace.Hittest.True)
setProperty("results", "Hit!")
}eles{
setProperty("results", "safe")
}
-
XRave
What's the difference with that?!
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
XRave
When you actually know what "OMG I have so much homework!" means, you won't want to be me.
Xrave
-
Confused Game/Cartoon Designer
your code was riddled with errors, misspellings, and improper usage of methods. in this code i assume you are using a dynamic text field (resultsTextBox) to display results. also, this checks constantly whether the mouse touches Trace, instead of only checking once.
Code:
Trace.onEnterFrame = function(){
If(Trace.hitTest(Trace._parent._xmouse, Trace._parent._ymouse, true)) {
resultsTextBox.text = "Hit!"
}else{
resultsTextBox.text = "safe"
}
}
P-Dizzle is in the hizzle.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|