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

How to link to webpage from button click?

Community Beginner ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

I keep getting syntax errors using the snippet code and I'm following the directions... Just want the button to link to an outside webpage - very new to Animate - and frustrated. Any suggestions much appreciated.

Views

6.1K

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

Community Expert , Apr 10, 2017 Apr 10, 2017

that's html5 code.  if you're publishing for as3, using as3 code:

button_1.addEventListener(MouseEvent.CLICK,f1);

function f1(e:MouseEvent):void{

navigateToURL(new URLRequest('http://www.adobe.com'),'_blank');

}

Votes

Translate

Translate
Community Expert ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

what code you using that's triggering an error and what's the error?

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
Community Beginner ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

Thanks for looking ...

I'm using this:

* Click to Go to Web Page

Clicking on the specified symbol instance loads the URL in a new browser window.

Instructions:

1. Replace http://www.adobe.com with the desired URL address.

   Keep the quotation marks ("").

*/

this.button_1.addEventListener("click", fl_ClickToGoToWebPage_2);

function fl_ClickToGoToWebPage_2() {window.open("http://www.adobe.com","_blank")}

and error is

1120 Access of undefined property window

I replaced in my version the domain with the appropriate one - as instructions indicate to do

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
Community Expert ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

that's html5 code.  if you're publishing for as3, using as3 code:

button_1.addEventListener(MouseEvent.CLICK,f1);

function f1(e:MouseEvent):void{

navigateToURL(new URLRequest('http://www.adobe.com'),'_blank');

}

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
Community Beginner ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

Thank you VERY much. It works. 🙂

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
Community Expert ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

LATEST

you're welcome.

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
Community Beginner ,
Apr 10, 2017 Apr 10, 2017

Copy link to clipboard

Copied

* Click to Go to Web Page

Clicking on the specified symbol instance loads the URL in a new browser window.

Instructions:

1. Replace http://www.adobe.com with the desired URL address.

   Keep the quotation marks ("").

*/

this.button_1.addEventListener("click", fl_ClickToGoToWebPage_2);

function fl_ClickToGoToWebPage_2() {window.open("http://www.adobe.com","_blank")}

and error is

1120 Access of undefined property window

I replaced in my version the domain with the appropriate one - as instructions indicate to do

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