A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Simple hitTest Question

  1. #1
    kbaum
    Guest

    Simple hitTest Question

    I have a simple hitTest question. I know how to check to see if a MC is touching another MC, but how can I check to see if it is touching anything?
    Thanks!

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    This is the wrong forum. Thread moved.

    You can do something like this:
    PHP Code:
    mc.onPress = function ()
    {
        
    this.startDrag ();
    };
    mc.onRelease = function ()
    {
        
    this.stopDrag ();
    };
    Object.prototype.ht = function ()
    {
        
    this.onEnterFrame = function ()
        {
            if (
    this.hitTest (mc))
            {
                
    trace (this " hit");
            }
        };
    };
    for (var 
    1<= 4i++)
    {
        
    this["mc" i].ht ();

    - The right of the People to create Flash movies shall not be infringed. -

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