简体   繁体   中英

Creating Menus in adobe flex

I am working on a game in flex, and I am trying to figure out how to create menus in the game. I am was thinking it would be easy just to add and remove a child for the menu, but then it would be a pain to make interactive. I figure there must be some way to do it, so I am asking here.

I am trying to do both a pop up menu and an always on screen menu, like a bottom menu bar, so if anyone has any ideas please let me know. I am completely new to flash and flex and don't really know where to start past making the actual game. Thanks

WWaldo

Have you looked at the Flex MenuBar class?

More documentation on it here .

If you need something spark related, check out the ButtonBar and see about extending that.

Beyond that, I'm unclear exactly what you want. Adding and removing children to any given Flex UIComponent is pretty easy. I don't know why that would make it hard for things to be interactive.

In terms of making a menu with different appearances based off of the state of something, check out the built in state management:

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf63611-7ffa.html

This lets you define what children appear in which state of the menu, then you just set the currentState: currentState='soundMenu'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM