0 Replies - 1962 Views - Last Post: 23 November 2010 - 09:25 AM

#1 flyboy1   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 23-November 10

Displaying a random number in a Dynamic or TLF text box?

Posted 23 November 2010 - 09:25 AM

I am trying to get a random number to display in a Dynamic or TLF text box. I have used code snippets from the Flash program and check the syntax it says it is ok but I do not get the number appearing in the box?

It is probably something very simple but although i have tried all sorts of combinations with the code i cannot get it to display the number?

I ran a trace on random number code and it gave a random number in the output panel but when i try to have it display in the text box nothing? any suggestions why my code is wrong?

stop();

var num_text=Number;
var randomNumber:Number = Math.floor(Math.random()*(limit+1));

button_1.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
{
	function fl_MouseClickHandler_2(event:MouseEvent):void
	function fl_GenerateRandomNumber_3(limit:Number):Number
{
	var num_text=Number;
	var randomNumber:Number = Math.floor(Math.random()*(limit+1));
	Number(fl_GenerateRandomNumber_3(100));
	return randomNumber;
	num_text.text=Number; 
	
}
}



Is This A Good Question/Topic? 0
  • +

Page 1 of 1