A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: hitTest Help!

  1. #1
    MaD Member : )
    Join Date
    Oct 2002
    Posts
    28

    hitTest Help!

    Hi all

    I need help with a basic hittest actionscript. I want basically a ball not to move any further when it hits a line/wall.

    The best i can do is this:

    onClipEvent (enterFrame) {
    if (this.hitTest(_root.edge)) {
    this._x += 14;
    }
    }

    This action script works but it's not what i want...

    Any help appreciated

    PS i have also included a .fla for u guys to look at.
    Attached Files Attached Files

  2. #2
    \/\/EB/\/\ASTER lukesquall's Avatar
    Join Date
    May 2003
    Location
    Solitude
    Posts
    683
    Code:
    onClipEvent (enterFrame) {
    if (this.hitTest(_root.edge)){
    this._x = this._x;}}

  3. #3
    Junior Member
    Join Date
    Jul 2003
    Posts
    28
    I've been trying the same thing, and that code doesn't seem to work.
    The science of war leads one to
    dictatorship pure and simple. The
    science of nonviolence can alone lead
    one to pure democracy.-Mahatma
    Gandhi

  4. #4
    MaD Member : )
    Join Date
    Oct 2002
    Posts
    28

    Doesn't work

    Originally posted by lukesquall
    Code:
    onClipEvent (enterFrame) {
    if (this.hitTest(_root.edge)){
    this._x = this._x;}}
    luke ... this code does not work ... is there another way?

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