A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: simple hitTest syntax question

  1. #1
    Senior Member
    Join Date
    May 2006
    Posts
    119

    simple hitTest syntax question

    Im trying to write that when the object is not on the hit object a sound will play.
    I have this... it seems logical...to me...but doesnt work.
    on (press){
    startDrag(this);
    HEY = new Sound();
    Thanks = new Sound();
    HEY.attachSound("HEY!");
    Thanks.attachSound("Thanks");

    }
    on(release){
    stopDrag();
    if(_root.owl.hitTest !==(_root.treehole)){
    HEY.start();
    }
    }


    what is the syntax im looking for here?

    Thank you for any help

    Mark

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Code:
    on (release){
        stopDrag();
        if (!_root.owl.hitTest(_root.treehole)) { // the clips _root.owl and _root.treehole are not touching
            HEY.start();
        }
    }

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