Sign in to follow this  
djsteffey

mxml question

Recommended Posts

I am doing a flash game using mxml with flex. I am trying to figure out how i can place my UI components relative to their parent container.
		<mx:State name="MainMenu">
			<mx:AddChild>
				<mx:Panel title="Select Grid Size" width="150" height="150" x="400" y="350">
					<mx:Button x="100" y="200" label="10x10 Grid" click="start_game_10x10(event)"/>
					<mx:Button label="20x20 Grid" click="start_game_20x20(event)"/>
					<mx:Button label="30x30 Grid" click="start_game_30x30(event)"/>
					<mx:Button label="40x40 Grid" click="start_game_40x40(event)"/>
				</mx:Panel>
			</mx:AddChild>
		</mx:State>

i use the above above code to put a panel with several buttons in it on the screen. no matter what i put for the x and y values of that first button it will never move its location. i would like to make something like x=10 and y=10 relative to the panel container. so that no matter where the panel is located the button will always be positioned at 10 pixels from the left edge of the panel and 10 pixels from the top edge

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this