Skip to main content
Participating Frequently
June 13, 2017
Answered

I need to convert AS3 external class to Javascript - Html 5 (Canvas).

  • June 13, 2017
  • 4 replies
  • 766 views

I have some knowledge in javascript, but i don´t know if there is some difference in Flash´s javascript, like Unity 3D, it´s a little bit different.

Do you have some script examples that i can use as a guide for me?

Some basic questions:

. I don´t know how to create the header properly;

. Can i import things like: "import flash.events.MouseEvent;"? "import flash.events.*; " etc...

. Can i extends Movieclip?

. How i create variables? Is the same? "public var num:int;"?

. How i add listener, like: "bt_start.addEventListener(MouseEvent.CLICK, gameFunction);"?

That´s all i need at the moment.

Thanks

This topic has been closed for replies.
Correct answer Bernd Alheit

Man,

You just don´t realize don´t you? Have you read my question? I ask about the Javascript language, AFTER converted as3 to javascript. So i think here is the more properly location to ask my question.

Pay attention to the questions, even if there is "As3" in the text, i don´t need help about As3, but yes about Javascript.

Again:

. I don´t know how to create the header (OF JAVASCRIPT) properly;

. Can i import things like: "import flash.events.MouseEvent;"? "import flash.events.*; " etc... (USING JAVASCRIPT)

. Can i extends Movieclip? (USING JAVASCRIPT)

. How i create variables? Is the same? "public var num:int;"? (USING JAVASCRIPT)

. How i add listener, like: "bt_start.addEventListener(MouseEvent.CLICK, gameFunction);"? (USING JAVASCRIPT).

Understand now Bernid, Joel??

If you don´t know the answer, please, let others answer, and avoid put some answer criticizing my post.

Thanks


. Can i import things like: "import flash.events.MouseEvent;"? "import flash.events.*; " etc... (USING JAVASCRIPT)

Acrobat JavaScript doesn't support this.

. Can i extends Movieclip? (USING JAVASCRIPT)

Not possible with Acrobat JavaScript.

. How i create variables? Is the same? "public var num:int;"? (USING JAVASCRIPT)

Example: var i1;

. How i add listener, like: "bt_start.addEventListener(MouseEvent.CLICK, gameFunction);"? (USING JAVASCRIPT).

Not possible with Acrobat JavaScript.

4 replies

Participating Frequently
June 14, 2017

About: "if there is some difference in Flash´s javascript, like Unity 3D, it´s a little bit different..."

I found out.

There is no difference.  But there is a FlashJavascript too, that is like javascript for Unity 3D in the calling of function and variables, something like that.

Participating Frequently
June 13, 2017

Bernd,

Because i just didn´t find a properly location to ask this.

This forum is a little confusing.

Joel Geraci
Community Expert
Community Expert
June 13, 2017

A Google search for "Adobe forums as3" yielded this link as the first result.

ActionScript 3

Participating Frequently
June 14, 2017

Man,

You just don´t realize don´t you? Have you read my question? I ask about the Javascript language, AFTER converted as3 to javascript. So i think here is the more properly location to ask my question.

Pay attention to the questions, even if there is "As3" in the text, i don´t need help about As3, but yes about Javascript.

Again:

. I don´t know how to create the header (OF JAVASCRIPT) properly;

. Can i import things like: "import flash.events.MouseEvent;"? "import flash.events.*; " etc... (USING JAVASCRIPT)

. Can i extends Movieclip? (USING JAVASCRIPT)

. How i create variables? Is the same? "public var num:int;"? (USING JAVASCRIPT)

. How i add listener, like: "bt_start.addEventListener(MouseEvent.CLICK, gameFunction);"? (USING JAVASCRIPT).

Understand now Bernid, Joel??

If you don´t know the answer, please, let others answer, and avoid put some answer criticizing my post.

Thanks

Joel Geraci
Community Expert
Community Expert
June 13, 2017

ActionScript and Acrobat JavaScript have a common history but that's about it. You can't import external libraries. You're going to need to rethink your solution. 

Bernd Alheit
Community Expert
Community Expert
June 13, 2017

Why do you post this in the forum for Acrobat JavaScript?