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

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

New Here ,
Jun 13, 2017 Jun 13, 2017

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

TOPICS
Acrobat SDK and JavaScript
672
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 , Jun 14, 2017 Jun 14, 2017

. 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.

Translate
Community Expert ,
Jun 13, 2017 Jun 13, 2017

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

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 ,
Jun 13, 2017 Jun 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. 

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 ,
Jun 13, 2017 Jun 13, 2017

Bernd,

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

This forum is a little confusing.

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 ,
Jun 13, 2017 Jun 13, 2017

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

ActionScript 3

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 ,
Jun 14, 2017 Jun 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

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 ,
Jun 14, 2017 Jun 14, 2017

. 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.

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 ,
Jun 14, 2017 Jun 14, 2017

Thanks.

Do you know where i can find (i tried google it) an example of some scripts?

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 ,
Jun 14, 2017 Jun 14, 2017

You should look for a forum about web browser JavaScript.

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 ,
Jun 14, 2017 Jun 14, 2017
LATEST

Understood.

Do you have a link?

If don´t, i´ll search it.

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 ,
Jun 14, 2017 Jun 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.

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