code:
package
{
import flash.display.*;
import flash.text.*;
import flash.events.*;
public class Opdracht2 extends MovieClip
{
private var _button:Sprite = new Sprite();
private var _tfInput:TextField = new TextField();
private var _tfOutput:TextField = new TextField();
public function Opdracht2()
{
addChild(_button);
addChild(_tfInput);
addChild(_tfOutput);
_tfInput.type = TextFieldType.INPUT;
_tfInput.border = true;
_tfInput.width = 100;
_tfInput.height = 20;
_tfOutput.autoSize = "left";
_tfOutput.visible = false;
_button.y = _tfInput.height + 5;
_button.graphics.beginFill(0x0000FF);
_button.graphics.drawRect(0, 0, 40, 20);
_button.buttonMode = true;
_button.addEventListener(MouseEvent.MOUSE_DOWN, showText);
}
private function showText(event:Event):void
{
_tfOutput.text = _tfInput.text;
_tfOutput.visible = true;
_tfOutput.x = Math.random() * (stage.stageWidth - _tfOutput.width)
_tfOutput.y = Math.random() * (stage.stageHeight - _tfOutput.height)
}
}
}
This is what I got so far
Its working but I need to get a higher amount of outputs.
Not one time but 20 times or something like that
Anyone?