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

How to learn Action Script for Animate

Explorer ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

I am transitioning from Adobe Director to Animate. I am familiar with Lingo and wrote an animated and interactive program in it. Now I want to learn Actionscript so I can work with Animate.

What is the best way to do that. There were a bunch of books and reference material that came with Director for Lingo that listed all functions. Is there anything similar for Animate? How can go I about examining the full capability of what is possible with Actionscript. May I ask if you can recommend a book, video etc. ?

Thanks,

Charan

TOPICS
ActionScript

Views

912

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

LEGEND , May 08, 2017 May 08, 2017

I had to go through adapting to Flash coming from Director, though that was in the days of Flash 5. I would paste my Lingo into the Actions panel, and line by line use the help to figure out how to make it work.

Things are somewhat harder with ActionScript 3. Funnily, if you had chosen to use JavaScript for scripting in Director, you would already know the syntax of AS3 and JavaScript.

You could if you want give a couple of examples of a Director way of doing something, and I could say how it's do

...

Votes

Translate

Translate
LEGEND ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

I had to go through adapting to Flash coming from Director, though that was in the days of Flash 5. I would paste my Lingo into the Actions panel, and line by line use the help to figure out how to make it work.

Things are somewhat harder with ActionScript 3. Funnily, if you had chosen to use JavaScript for scripting in Director, you would already know the syntax of AS3 and JavaScript.

You could if you want give a couple of examples of a Director way of doing something, and I could say how it's done in Flash Pro or in Adobe Animate.

One useful thing to know, you will quickly get scared off by lots of talk about how you have to use OOP and external Class files with AS3. That isn't true. You can do everything in frame scripts.

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
Explorer ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

Thank you, Colin.

One of the things, I often did in my app, was to have a sprite be replaced by something else on rollover. Like a cat turns into a dog. Do I do that by turning the item into a button? Or is there some other way?

Also what is the analog to creating a "frame script" in Animate? Is this done in the Actions timeline?

Than, the other question I have is how does AS work with local and global variables. For example, I want to keep track of how many times a "sprite"-not sure what they call these in Animate-  is clicked.

Another question: do the sound files get embedded in the file for the browser or do they have to be uploaded as wel for the final server version. Is the sound file reference structure similar to it was in Director?

I used to go through the Lingo Directory to find functions I could use. Hopefully learning Actionscript will be the same.

Thanks for the suggestion about pasting my Director code into Animate. I am going to try that.

Charan

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
LEGEND ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

I'll add numbers. BTW, all these answers apply to AS3. There would be different answers for some of the same questions if you were doing HTML5 Canvas:

1. Yes. Using a button where the Over frame is different would be an easy way to get the same effect.

2. Unlike Director there isn't a special script channel. You can click in any keyframe in the timeline, even if it has other contents, and add script to the Actions panel. One way to work is to create a layer, specifically for scripts. It would then be very much like the script channel. But better than that, you can use as many layers as you like, and have different handlers in different layers. Makes organizing things easier.

3. Generally, the level in the hierarchy that you're at when you make the variable is what owns the variable. For example:

var a:int = 10;

function addbuttonwasclicked(){

a++;

}

function subtractbuttonwasclicked(){

a--;

}

The 'a' variable is available to both functions, and to anything else later in the timeline. Same as with Lingo where you can define all the variables ahead of any handlers.

4. SWFs (the equivalent of DCR) usually use MP3, which is almost identical to Shockwave Audio. The sounds can either be embedded in the swf or played from external local or online files.

Director can still do a lot of things that Animate cannot do, but many of the things that both can do are done in a more useful way in Animate.

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
Explorer ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

Colin,

I am now seeing what I dont know.

I thought I Actionscript applies to all scripting whether doing a html 5 app or another.

So what is the language when one wants to do App for web application, which is what I want to do.

I basically want to reprogram my Director app for the web. Something that became near impossible in Director.

Thanks for the dialog and help!

Charan

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
LEGEND ,
May 08, 2017 May 08, 2017

Copy link to clipboard

Copied

LATEST

For the questions you asked, most things are the same answers. Here's some differences:

The language you use is JavaScript, but it uses a library called CreateJS, which makes the syntax look more like AS3.

Variables in JavaScript are not typed, same as in Director.

When running in a browser you have access to 'document' and 'window' too, and you can use those to more closely match Director's global variables. So, this:

window.somevar = "some value";

would make 'somevar' available everywhere.

When you are creating the project, all graphics and sounds may feel like they are internal, but when you publish they all become external files.

If you need to fully support Firefox you may need to have OBB as well as MP3 of each sound. It only takes one line of code to support both.

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