• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

display a url and make it an active link

Guest
Oct 17, 2011 Oct 17, 2011

Copy link to clipboard

Copied

I am new to Flash Builder and action scripts, all i want to do is have the page display a website link, say www.google.com  and have it so within the mobile flex app the user can click on it and it will open the website.

I used a label but it just shows the text and will not let the user click on it.

Any help with the code would be great.

Views

580

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Oct 18, 2011 Oct 18, 2011

You have to add a click function to either

<s:Label label="LinkButton" click="open()"/>

or

<mx:LinkButton label="LinkButton" click="open()"/>

this will open the web page in a new tab

private function open():void {

var url:String = 'http://www.google.com';

var request:URLRequest = new URLRequest(url);

navigateToURL(request);

}

Don

Votes

Translate

Translate
Engaged ,
Oct 18, 2011 Oct 18, 2011

Copy link to clipboard

Copied

LATEST

You have to add a click function to either

<s:Label label="LinkButton" click="open()"/>

or

<mx:LinkButton label="LinkButton" click="open()"/>

this will open the web page in a new tab

private function open():void {

var url:String = 'http://www.google.com';

var request:URLRequest = new URLRequest(url);

navigateToURL(request);

}

Don

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines