Skip to main content
Chardb
Known Participant
May 8, 2017
Answered

How to learn Action Script for Animate

  • May 8, 2017
  • 1 reply
  • 1357 views

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

This topic has been closed for replies.
Correct answer Colin Holgate

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.

1 reply

Colin Holgate
Colin HolgateCorrect answer
Inspiring
May 8, 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 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.

Chardb
ChardbAuthor
Known Participant
May 8, 2017

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

Colin Holgate
Inspiring
May 8, 2017

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.