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

Convert ActionScript in HTML5

New Here ,
Nov 21, 2017 Nov 21, 2017

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();

590
Translate
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);
}

Translate
LEGEND ,
Nov 21, 2017 Nov 21, 2017

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

Translate
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

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);
}

Translate
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

Thank you

Translate
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
LATEST

you're welcome.

Translate
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