Works for me:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[
import flash.net.navigateToURL;
public var myURL:String;
private function imageClick(evt:MouseEvent):void
{
myURL = "http://www.yahoo.com/";
navigateToURL(new URLRequest(myURL), "_self");
}
]]>
</mx:Script>
<mx:Canvas>
<mx:ApplicationControlBar>
<mx:Image source="@Embed('logo.gif')" id="logo"
click="imageClick(event);"/>
</mx:ApplicationControlBar>
</mx:Canvas>
</mx:Application>
SWF, HTML file etc on the remote server.
What do you mean when you say "does not work"? Do you get an error
message?
You click the image and nothing happens? Something else?
--- In [email protected], "uclamerrick" <merr...@...> wrote:
>
> I have an Image on an ApplicationControlBar and I am trying to make it
> such that when the image is clicked, the current browser window/tab is
> redirected to a URL. It works when the swf file is opened locally, but
> not if its a remote swf file. I am guessing this is some security
> issue, and am wondering if anyone has found a way around this.
>
> This works
> Opening the swf file locally, and clicking the image loads the new URL
> as specified in the imageClick function below.
>
> This does not work
> Opening the swf file remotely using an html page with object/embed
> code and clicking the image *does not* load the URL.
>
>
> import flash.net.navigateToURL;
>
> public var myURL:String;
>
> private function imageClick(evt:MouseEvent):void {
> myURL = "http://www.yahoo.com/";
> navigateToURL(new URLRequest(myURL), "_self");
> }
>
> <mx:Canvas...>
> <mx:ApplicationControlBar...>
> <mx:Image
> source="@Embed('logo.png')"
> id="logo"
> click="imageClick(event);"
> />
> ...
> </mx:ApplicationControlBar>
> </mx:Canvas>
>