To call a link in Flex/Flash, you utilize URLRequest and navigateToURL
The syntax looks like this:
import flash.net.URLRequest;
import flash.net.navigateToURL;
private function goToGoogle():void{
navigateToURL(new URLRequest("http://www.google.com"));
}
more generally...
private function linkToURL(resource:String):Void
{
navigateToURL(new URLRequest(resource));
}
<mx:Button label="Exit" click="navigateToURL('http://www.google.com')"/>
On Wed, Feb 4, 2009 at 9:28 AM, Frank Griffin <[email protected]> wrote:
> I have an "Exit" button that I need to close the application and call a
> URL. What is the proper syntax for this? I get an error with the following
> code:
>
>
>
> 1084: Syntax error: expecting identifier before rightbrace.
>
>
>
> <mx:HBox borderStyle="solid" paddingTop="10" paddingBottom="10"
> paddingLeft="10" paddingRight="10">
> <mx:Button label="View"
> click="myViewStack.selectedChild=ViewOnly;"/>
> <mx:Button label="Edit"
> click="myViewStack.selectedChild=EditView;"/>
> <mx:Button label="Delete"/>
> <mx:Button label="Exit"
> click="http://www.google.com;"/>
> </mx:HBox>
>
>
>
>
>
> Thanks,
>
>
>
> Frank
>
>
>
>
>
>
>
>
> -------------------------------------------------------------
> To unsubscribe from this list, simply email the list with unsubscribe in
> the subject line
>
> For more info, see http://www.affug.com
> Archive @ http://www.mail-archive.com/discussion%40affug.com/
> List hosted by FusionLink <http://www.fusionlink.com>
> -------------------------------------------------------------
--
Johnny Waggener
Software Developer
Multicast Media
678-592-2650