[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.

Question
[x]
Attachment Details

x position for first button

Asked by IDEASDesign in ActionScript, Adobe Flash

Tags: Adobe, Flash CS3, CS3, AS2

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);
        }
}//
 
Related Solutions
Keywords: x position for first button
 
Loading Advertisement...
 
[+][-]09/04/08 03:09 PM, ID: 22393237Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/04/08 03:23 PM, ID: 22393340Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/04/08 03:31 PM, ID: 22393381Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/10/08 11:54 AM, ID: 22441644Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/10/08 02:13 PM, ID: 22443116Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/10/08 11:15 PM, ID: 22446762Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/11/08 07:57 AM, ID: 22450603Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/15/08 03:12 PM, ID: 22483407Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/15/08 10:13 PM, ID: 22485091Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/16/08 07:28 AM, ID: 22488722Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/17/08 12:52 AM, ID: 22496381Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 / EE_QW_2_20070628