A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: BlaBlaBla hittest [HELLLP]

  1. #1
    XRave tongxn's Avatar
    Join Date
    Apr 2005
    Location
    Somewhere near Here
    Posts
    870

    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

  2. #2
    Senior Member
    Join Date
    Oct 2004
    Posts
    2,049
    try this
    PHP Code:
    onClipEvent(enterFrame)
      If(
    Trace.Hittest.True)
         
    setProperty("results""Hit!")
      }
    eles{
         
    setProperty("results""safe")


  3. #3
    XRave tongxn's Avatar
    Join Date
    Apr 2005
    Location
    Somewhere near Here
    Posts
    870
    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

  4. #4
    XRave tongxn's Avatar
    Join Date
    Apr 2005
    Location
    Somewhere near Here
    Posts
    870
    really!
    When you actually know what "OMG I have so much homework!" means, you won't want to be me.
    Xrave

  5. #5
    Confused Game/Cartoon Designer
    Join Date
    May 2005
    Location
    Texas
    Posts
    60
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center