<?xml version="1.0" encoding="utf-8"?>
<Application name="Image_contextMenu_link_test"
xmlns="http://ns.adobe.com/mxml/2009"
xmlns:mx="library:adobe/flex/halo"
layout="flex.layout.BasicLayout"
initialize="init();">
<Script>
<![CDATA[
[Embed("assets/fx_appicon-tn.gif")]
private var fxIcon:Class;
private var imageContextMenu:ContextMenu;
private var urlReq:URLRequest;
private function init():void {
urlReq = new URLRequest();
urlReq.url = "http://www.adobe.com/go/flex";
imageContextMenu = new ContextMenu();
imageContextMenu.link = urlReq;
lbl.text = "Right-click image control for context menu";
lbl.setStyle("left", 10);
lbl.setStyle("top", 10);
img.source = fxIcon;
img.setStyle("horizontalCenter", 0);
img.setStyle("verticalCenter", 0);
img.contextMenu = imageContextMenu;
}
]]>
</Script>
<mx:Label id="lbl" />
<mx:Image id="img" />
</Application>