Skip to main content
Participating Frequently
Jun 13, 2017 2:18 PM UTC
Answered

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

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 is closed to new replies. Start a new post to keep the conversation going.
Bernd Alheit
Bernd AlheitCorrect answer
Community Expert
Jun 14, 2017 1:43 PM UTC

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.

10 replies

Participating Frequently
Jun 14, 2017 1:50 PM UTC

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.

Translate
Participating Frequently
Jun 13, 2017 3:07 PM UTC

Bernd,

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

This forum is a little confusing.

Translate
Joel Geraci
Community Expert
Community Expert
Jun 13, 2017 3:37 PM UTC

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

ActionScript 3

Translate
Participating Frequently
Jun 14, 2017 1:33 PM UTC

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

Translate
Joel Geraci
Community Expert
Community Expert
Jun 13, 2017 2:49 PM UTC

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. 

Translate
Bernd Alheit
Community Expert
Community Expert
Jun 13, 2017 2:46 PM UTC

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

Translate