Select to view content in your preferred language

Hyperlink Logo in config.xml?

1158
9
Jump to solution
02-08-2012 11:59 AM
AshleyPeters
Frequent Contributor
Is it possible to make the logo in the config.xml a hyperlink?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Ashley,

   OK, then this is what you need to add to the HeaderControllerWidget.mxml:


  1. Just add this to the top where the other private vars are:
    private var linkURL:String;

  2. In the widgetConfigLoadedHandler funtion add these lines in the if configXML:
                        linkURL = configXML.logolinkurl;

  3.                     if (linkURL)
                        {
                            logoIcon.buttonMode = true;
                            logoIcon.useHandCursor = true;
                            logoIcon.addEventListener(MouseEvent.CLICK, img_clickHandler);
                        }
  4. Then add this new function:
                private function img_clickHandler(event:MouseEvent):void

  5.             {
                    navigateToURL(new URLRequest(linkURL));
                }
Next add this line in the HeaderControllerWidget.xml:
<logolinkurl>http://www.esri.com</logolinkurl>


Don't forget to click the Mark as answer check and to click the top arrow (promote) as shown below:

View solution in original post

0 Kudos
9 Replies
RobertScheitlin__GISP
MVP Emeritus
Ashley,

   It is possible if you can edit the HeaderControllerWidget.mxml. DO you have the ability to edit the source code?
0 Kudos
AshleyPeters
Frequent Contributor
Yes, I'm using FlashBuilder.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ashley,

   OK, then this is what you need to add to the HeaderControllerWidget.mxml:


  1. Just add this to the top where the other private vars are:
    private var linkURL:String;

  2. In the widgetConfigLoadedHandler funtion add these lines in the if configXML:
                        linkURL = configXML.logolinkurl;

  3.                     if (linkURL)
                        {
                            logoIcon.buttonMode = true;
                            logoIcon.useHandCursor = true;
                            logoIcon.addEventListener(MouseEvent.CLICK, img_clickHandler);
                        }
  4. Then add this new function:
                private function img_clickHandler(event:MouseEvent):void

  5.             {
                    navigateToURL(new URLRequest(linkURL));
                }
Next add this line in the HeaderControllerWidget.xml:
<logolinkurl>http://www.esri.com</logolinkurl>


Don't forget to click the Mark as answer check and to click the top arrow (promote) as shown below:
0 Kudos
AshleyPeters
Frequent Contributor
Thanks Robert!
0 Kudos
ShaneCarey
Deactivated User
Hi,

This is really great and very useful. I was wondering would it be possible to add a label to the hyperlink as you hover over the logo with your mouse.
Thanks
0 Kudos
ShaneCarey
Deactivated User
Hi,

This is really great and very useful. I was wondering would it be possible to add a label to the hyperlink as you hover over the logo with your mouse.
Thanks
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Shane,

  Sure all you need to do is add this line to the others:


                    linkURL = configXML.logolinkurl;                     if (linkURL)                     {
                        logoIcon.toolTip = "Blah blah blah";                         logoIcon.buttonMode = true;                         logoIcon.useHandCursor = true;                         logoIcon.addEventListener(MouseEvent.CLICK, img_clickHandler);                     }
0 Kudos
AnthonyGiles
Honored Contributor
All,

If you dont have the ability to edit the source code you can always hide the logo and use the static image widget instead:

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Static_Image_widget_tags/01m300...

Regards

Anthony
0 Kudos
ShaneCarey
Deactivated User
Great stuff, thanks.
0 Kudos