dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] Hittest Problems

  1. #1
    Member
    Join Date
    Mar 2007
    Posts
    43

    Question [F8] Hittest Problems

    Hello,
    I have an object(car) on the stage which can be controlled with the arrow keys. I have created 4 points around the boundary of the object(small circles), one upwards, second downwards and so on in all directions.(placed within mc "car")
    The problem is that I want to do a hittest between a object and the small circles which are within the mc car. I have used the code:

    onEnterFrame=function(){
    if(car.hitTest(object.upcircle._x,object.upcircle. _y,true)){
    //CODE//
    }
    }
    This code doesn't work (this is for collision between the center of the circle and the object), but, what's odd is that the normal boundary hitTest i.e
    onEnterFrame=function(){
    if(car.hitTest(object.upcircle)){
    //CODE//
    }
    }

    THIS WORKS!!!!!
    PLEASE HELP........
    Thanking You,
    Chinmaya

    P.S. This code is written in the 1st frame (My flash document currently has one frame)

  2. #2
    Senior Member
    Join Date
    Oct 2008
    Posts
    227
    Try _root.object.upcircle
    Sometimes i works, sometimes not...
    Actionscript is weird :P

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