A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: localToGlobal problems

  1. #1
    bibuti. nolen's Avatar
    Join Date
    Sep 2002
    Location
    az.
    Posts
    191

    localToGlobal problems

    i posted a few days ago about relative positions inside movieclips.

    then i remembered localToGlobal.
    duh.


    apparently i'm implementing it wrong, as when i move the box anywhere else, it still repositions the box to the clip's x and y.

    the code is in the 2nd box from the top on the far left.

    2nd frame.

    thanks for any help.


    nolen
    Attached Files Attached Files
    i'm obsessed with video games.

  2. #2
    Member
    Join Date
    Apr 2004
    Posts
    49
    looked at the file was kinda messy so i didnt really understand.. but i think i can help


    point = new Object();
    point.x = this._x;
    point.y = this._y;
    localToGlobal(point);

    box.beginx = point.x;
    box.beginy = point.y;


    is how you use the localtoglobal... it only works with objects formated object.x object.y (not sure if it can have more paramters or not, but i know it works this way).. so create a object tell it your local coordinate.. localtoglobal.. then it returns global posistions in object.x object.y

    NOTE: need to recaculate if object is moved
    something like

    point.x = this._x;
    point.y = this._y;
    localToGlobal(point);
    box.currentx = point.x;
    box.currenty = point.y;

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