Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

hitTestPoint, how can i put the point of a movieCLip that is inside another.

New Here ,
Feb 02, 2019 Feb 02, 2019

function coli(ob1, ob2){

if(ob2.hitTestPoint(ob1.bd.la.ha.x, ob1.bd.la.ha.y, true))

    t.text = String(time);

   }

ob1 and ob2 is given by a MovieClip as the parameter, and .bd(body), .la(left arm), .ha(hookarm) is as well MovieClips, but inside of another one(what i like to call "sons"). that function is called in a ENTER_FRAME function called main().

In this code, the colision isn't working, and i think that is due the .x and .y that the MC obtain when is "son" of another one, their (0,0) coordinates is based on their  "father's" X and Y.  I tried to create a mc called p(i know that i could create a object of the Point Class, but i don't know how to use it) that receive the sum X and Y of the Mcs of ob  (ob1 + ob1.bd + ob1.bd.la + ob1.bd.la.ha)  in a ENTER_FRAME based function, but that doesn't do the p stay in the same postion of the ob1.bd.la.ha. What can i do?

TOPICS
ActionScript
169
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 03, 2019 Feb 03, 2019
LATEST
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines