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

Convert ActionScript in HTML5

New Here ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

Hi everybody,

Can anybody help me to convert this ActionScript in a HTML5 Script?

Thanks a lot!

btn_Logo.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);
btn_ball01.addEventListener(MouseEvent.MOUSE_OVER, fl_ClickToGoToAndStopAtFrame_2);
btn_ball02.addEventListener(MouseEvent.MOUSE_OVER, fl_ClickToGoToAndStopAtFrame_3);
btn_ball03.addEventListener(MouseEvent.MOUSE_OVER, fl_ClickToGoToAndStopAtFrame_4);
btn_ball04.addEventListener(MouseEvent.MOUSE_OVER, fl_ClickToGoToAndStopAtFrame_5);
btn_ball05.addEventListener(MouseEvent.MOUSE_OVER, fl_ClickToGoToAndStopAtFrame_6);
scene.addEventListener(MouseEvent.MOUSE_OVER, fl_ClickToGoToAndStopAtFrame_1);

function fl_ClickToGoToWebPage(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.adobe.com"), "_blank");
}

function fl_ClickToGoToAndStopAtFrame_2(event:MouseEvent):void
{
gotoAndStop(2);
}

function fl_ClickToGoToAndStopAtFrame_3(event:MouseEvent):void
{
gotoAndStop(3);
}

function fl_ClickToGoToAndStopAtFrame_4(event:MouseEvent):void
{
gotoAndStop(4);
}

function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void
{
gotoAndStop(5);
}

function fl_ClickToGoToAndStopAtFrame_6(event:MouseEvent):void
{
gotoAndStop(6);
}

function fl_ClickToGoToAndStopAtFrame_1(event:MouseEvent):void
{
gotoAndStop(1);
}

stop();

Views

501

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 , Nov 21, 2017 Nov 21, 2017

stage.enableMouseOver(10);

this.btn_Logo.addEventListener('mousedown', fl_ClickToGoToWebPage.bind(this));

this.btn_ball01.addEventListener('mouseover', fl_ClickToGoToAndStopAtFrame_2.bind(this));

etc

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

function fl_ClickToGoToAndStopAtFrame_2(event)
{
this.gotoAndStop(1);
}

Votes

Translate

Translate
LEGEND ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

When talking to buttons you need to add 'this.' before the button name. For the event part you use strings, like "click" instead of MouseEvent.CLICK. There are no typed variables, so in the function you would say (event) instead of (event:MouseEvent).

For what types of events there are you should read the documentation. Here's a page that tells you what different event types there are:

EaselJS Tutorial: Mouse Interaction

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 ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

stage.enableMouseOver(10);

this.btn_Logo.addEventListener('mousedown', fl_ClickToGoToWebPage.bind(this));

this.btn_ball01.addEventListener('mouseover', fl_ClickToGoToAndStopAtFrame_2.bind(this));

etc

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

function fl_ClickToGoToAndStopAtFrame_2(event)
{
this.gotoAndStop(1);
}

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
New Here ,
Nov 21, 2017 Nov 21, 2017

Copy link to clipboard

Copied

Thank you

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 ,
Nov 21, 2017 Nov 21, 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