|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by IDEASDesign in ActionScript, Adobe Flash
this is loading the buttons from right to left. but the starting _x isn't using the first button, it's using the last.
my posBut needs to start the first button at something like "Stage.width - 20" so that i can always keep my first button there. right now when i try it, it is using the last button to measure from, so you can't even see the other buttons since they are off screen.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
|
posBut = Math.round(Stage.width/2);
function init():Void {
for (i=0; i<_parent.headerbar.menuArray.length; i++) {
_parent.headerbar.mcButton.duplicateMovieClip("mcBut"+i, i);
//_parent.headerbar["mcBut"+i]._x = Math.ceil(_parent.headerbar.posBut);
_parent.headerbar["mcBut"+i]._x = Math.ceil(_parent.headerbar.posBut);
_parent.headerbar["mcBut"+i].nr =(_parent.headerbar.menuArray.length-i)-1;
_parent.headerbar["mcBut"+i].mcTxt.txt.htmlText = _parent.headerbar.menuArray[(_parent.headerbar.menuArray.length-i)-1].getMenuName;
_parent.headerbar["mcBut"+i].mcTxt.setColor(_parent.headerbar.menuTextColor);
val = 10*(_parent.headerbar["mcBut"+i].mcTxt.txt.textWidth+_parent.headerbar.butWidth);
_parent.headerbar["mcBut"+i].mcBut._xscale = val;
_parent.headerbar["mcBut"+i].mcBut._width = Math.ceil(_parent.headerbar["mcBut"+i].mcBut._width);
//
_parent.headerbar["mcBut"+i].mcTxt._x = Math.ceil((_parent.headerbar["mcBut"+i].mcBut._width-_parent.headerbar["mcBut"+i].mcTxt.txt.textWidth-10)/2);
_parent.headerbar.posBut += Math.ceil(_parent.headerbar["mcBut"+i]._width);
}
}//
|
20091111-EE-VQP-89 / EE_QW_2_20070628