Jump to content
  • Advertisement
Sign in to follow this  
djsteffey

mxml question

This topic is 3433 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
Use a stylesheet, or set the layout on the Panel to absolute.

Flex positioning is surprisingly nasty. For a technology that was supposed to ease the pain of dynamic HTML development, that's a big letdown.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!