as3 looping MC from class not adding X propertity correctly

I have a simple loop that creates a movieClip from a class in my library. It's adding the first part of the equation to the x property but not the plus 50. HOWEVER, it is adding the +50 but only to the first item in the loop. What am I doing wrong here?

var flagButton:MovieClip;

function displayFlagButtons()
{

    for( var i = 0; pages.length > i; i++)
    {

        flagButton = new roundButton();

            // The line below is giving me issues in adding 50 to each movieClip
            flagButton.x = (flagButton.width * i) + 50; 
            // Again, above code adds 50 to 1st item only


        addChild(flagButton);
    }
}

Answers


Did you mean :

flagButton.x = (flagButton.width + 50) * i; 

Need Your Help

Perform INSERT in Stored Procedure after SELECT

sql sql-server

I would like to query a list of users from one table:

Input type currency format with comma and decimal place 2

javascript format currency

I just want to ask how to make a JavaScript of currency format of input type text. Is it possible that the numbers will have comma while you type the number? Also, how to make the number fixed with 2

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.