A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: MovieClip positioning math problem

  1. #1
    Retired SCORM Guru PAlexC's Avatar
    Join Date
    Nov 2000
    Location
    NJ
    Posts
    1,387

    MovieClip positioning math problem

    Backed myself into a tricky corner here.

    I have a grid of boxes, 4 columns (for now), created dynamically attaching MC's to the stage ("targets"0. When you rollover each, a box pops up with more info. ("popup")

    For the column on the left, I want the pop-up to align just off of the upper-left hand corner of the mc on the stage (popup._x = target._x - somepaddingvalue).

    As you rollover targets to the right, the popup box should position itself more to the left, so for the last column, it looks like they're aligned via the upper-right hand corner, (with padding).

    Can anyone figure out the algorithm for this?

    Much appreciated.
    "What really bugs me is that my mom had the audacity to call Flash Kit a bunch of 'inept jack-asses'." - sk8Krog
    ...and now I have tape all over my face.

  2. #2
    Senior Member Shotsy247's Avatar
    Join Date
    Apr 2001
    Location
    Be there in a minute!
    Posts
    1,386
    If each MC is named with a target0, target1, target2, etc. you could use that number to multiply your padding number by.

    popup0._x = target0._x - someValue * 0
    popup1._x = target1._x - someValue * 1
    popup2._x = target2._x - someValue * 2
    popup3._x = target3._x - someValue * 3

    _t
    I don't feel tardy.

  3. #3
    Retired SCORM Guru PAlexC's Avatar
    Join Date
    Nov 2000
    Location
    NJ
    Posts
    1,387
    They are, and the indexing happens inside a for loop I could use the count variable for, but I'd like it to work based on position so it's more flexible in the future.
    "What really bugs me is that my mom had the audacity to call Flash Kit a bunch of 'inept jack-asses'." - sk8Krog
    ...and now I have tape all over my face.

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