-
Retired SCORM Guru
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.
-
Senior Member
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
-
Retired SCORM Guru
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|