Pass argument to parameter from text box in UI (Flash, AS3)
<p>I'm currently learing to program in AS3 in Flash CS6 (I have no previous programming experience), and now I'm trying to pass an argument to a parameter from a text box in the UI.</p>

<p>Here's what I've come up with:</p>

<pre><code>btnKnapp.addEventListener(MouseEvent.CLICK, skrivUt(int(txtInput.text)));
function skrivUt(x:int)
{
    for(var i:int=1; i&lt;=5; i++)
    {   
        var output:String = "";
        for(var j:int=0; j&lt;x; j++)
        {
            output += String(i);
        }
        trace(output);
        txtOutput.appendText(output + "\n");
        output = "";
    }
}
</code></pre>

<p>So I want to execute the <code>skrivUt</code> function, and use the integer written in the <code>txtInput</code> text box as the <code>x</code> parameter,when I press the button <code>btnKnapp</code>. </p>