actionscript 3 - LocalToGlobal Multiple Times -



actionscript 3 - LocalToGlobal Multiple Times -

for whatever reason code not work properly. fresh pair of eyes , find i'm doing wrong? have no thought matter. here code:

import flash.geom.point; var upperpoint:point = new point(monster.animation2.upper.attackmarker.x,monster.animation2.upper.attackmarker.y); var animationpoint:point = new point(monster.animation2.upper.localtoglobal(upperpoint).x,monster.animation2.upper.localtoglobal(upperpoint).y); var monsterpoint:point =new point(monster.animation2.localtoglobal(animationpoint).x,monster.animation2.localtoglobal(animationpoint).y); var globalpoint:point = new point(monster.localtoglobal(monsterpoint).x,monster.localtoglobal(monsterpoint).y); trace(globalpoint);

here quick diagram of parental relationships among movieclips:

monster[ animation[ upper[ attackmarker ] ] ]

flash should trace exact point @ attackmarkerwould if take movieclip out of parents. figure out i'm doing wrong?

when attempting find display object's global coordinates, need phone call localtoglobal once on object's direct parent (in example, monster.animation2.upper):

var attackmarkerpoint:point = new point(monster.animation2.upper.attackmarker.x, monster.animation2.upper.attackmarker.y); var globalpoint:point = monster.animation2.upper.localtoglobal(attackmarkerpoint);

actionscript-3 flash

Comments

Popular posts from this blog

java Multi query from Mysql using netbeans -

c# - DotNetZip fails with "stream does not support seek operations" -

c++ - StartServiceCtrlDispatcher don't can access 1063 error -