# Help with positioning of symbol on stage

**URL:** <https://forum.kirupa.com/t/help-with-positioning-of-symbol-on-stage/321770>\
**Category:** Uncategorized\
**Created:** [April 30, 2011, 8:33pm UTC](https://forum.kirupa.com/t/help-with-positioning-of-symbol-on-stage/321770 "2011-04-30T20:33:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nippyeyes](https://avatars.discourse-cdn.com/v4/letter/n/43a26b/32.png) [@nippyeyes](https://forum.kirupa.com/u/nippyeyes)\
**Post date:** [April 30, 2011, 8:33pm UTC](https://forum.kirupa.com/t/help-with-positioning-of-symbol-on-stage/321770/1 "2011-04-30T20:33:59Z")

</div>

Hey, really simple problem… i think. I place a symbol on the stage in the middle and then i have a textbox and when i input a number it moves up and down the axis. However when i press backspace to get rid of the word “rating” and place a number it sends it to the top of the page. Can someone please help me so that when i place a number in then press backspace for another number it returns back to the desired point on the axis. Thank you

```auto

package 
{
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.text.*;
	import flash.events.*;

	public class TextLecture3 extends Sprite
	{

		private var myTextBox:TextField = new TextField();
		private var myOutputBox:TextField = new TextField();
		private var myText:String = "Rating";
		private var myBall:Ball = new Ball ;

		public function TextLecture3()
		{
			captureText();
		}

		public function captureText():void
		{
			myTextBox.type = TextFieldType.INPUT;
			myTextBox.restrict = "0-9";
			myTextBox.background = true;
			myTextBox.border = true;
			myTextBox.maxChars = 2;
			myTextBox.height = 100;
			myTextBox.width = 500;
			var xPosition2 = 257;
			var yPosition2 = 343;
			myBall.y = yPosition2;
			myBall.x = xPosition2;

			
			addChild(myTextBox);
			addChild(myBall);
			

			myTextBox.text = myText;
			trace(myTextBox.text);
			myTextBox.addEventListener(Event.CHANGE,positionSymbol);
		}

		// use for the Event.CHANGE event. Has a different class.
		public function positionSymbol(event:Event):void
		{
			
			var rating:int = int(myTextBox.text);
			var position:int;
			

			

			// convert rating to position on stage
			position =(4 * rating * 10);
			trace(position);
			if ((position <= 400) || (position >= 0))
			{
				myBall.y = position;
				
			}
			
		}
	
		
	}
}

```
