Select to view content in your preferred language

Header Menu Bar Drop down

1732
15
Jump to solution
01-18-2012 06:44 AM
KevinCressy
Emerging Contributor
Hi,

I would like to add a couple of menu items on a menu bar in the header of my flex viewer application.  These would include "Links" and other hyperlinks that are useful on my project.

I have looked at implementing this using MenuBar (see here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/MenuBar.html) by adding the code example to HeaderControllerWidget.mxml however while I have managed to get a "box" where the menu should be - I don't actually get a menu to appear.

I am not sure if I am adding this to the wrong file or if there is something else I am missing.

Any help appreciated.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Kevin,


  I realized that I forgot to comment one area, and left some unused stuff in the code. Here is an updated version:

View solution in original post

0 Kudos
15 Replies
RobertScheitlin__GISP
MVP Emeritus
Kevin,

   Sounds like you need to look at this widget:

http://www.arcgis.com/home/item.html?id=5e4717fe1bb247f89b9092308e569c30

Don't forget to click the top arrow (promote) and to click the Mark as answer check as shown below:
0 Kudos
KevinCressy
Emerging Contributor
Thanks Robert.

I was hoping to implement that looked a little less out of box which was why I was going to attempt to use the MenuBar component.  This will certainly help in the short term though so thanks very much!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Kevin,

   OK, post what you have added to the HeaderControllerWidget.mxml and I will have a look.
0 Kudos
KevinCressy
Emerging Contributor
Hi Robert,

My modified code is attached. I have added comments of Kevin** where I have added the new code - hopefully this helps?

I have only changed HeaderControllerWidget.mxml - I have not changed HeaderControllerWidget.xml

I notice I am getting a parse error at line 301 (just befor my script) but I can not resolve this.

Thanks in advance for the help,

Kevin
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Kevin,

   Don't take offense, but it is painfully obvious that you need to learn just the basics of Flex Programming... You can not get far by just finding some code online and copy and pasting it, with out have a minimal (basic) understanding of the flex language. I recommend you Google flex in a Week.

That being said here is what you HeaderControllerWidget.mxml should have looked like, (all changes commented):

Don't forget to click the top arrow (promote) and to click the Mark as answer check as shown below:
0 Kudos
KevinCressy
Emerging Contributor
Hi Robert,

No offence taken at all.  Flex is new to me so you ar exactly right.  I am currently starting the Flex in a week course hosted by Adobe, having just finished the Build a flex app in a day course.  This was an excellent course that has shown me my way around the the Flash Builder IDE - but your right I need to look further into fundamentals.  I am doing a combination of learning the fundamentals of the Flex SDK while also finding my way around the ArcGIS Flex API.  I'm definately getting there and have learnt a lot recently, but clearly a long way to go!

Any way thanks for your help, I'll take a look at your code now.

regards,

Kevin
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Kevin,


  I realized that I forgot to comment one area, and left some unused stuff in the code. Here is an updated version:
0 Kudos
KevinCressy
Emerging Contributor
Hi Robert

This is exactly what I was after, sincere thanks for your help with this.

Regards,

Kevin
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Kevin,

Don't forget to click the Mark as answer check as shown below in the bottom red rectangle:
0 Kudos