Skip to main content
PanosKolettis
Known Participant
April 22, 2015
Question

Converting from AS2 to AS3 programming flash

  • April 22, 2015
  • 3 replies
  • 618 views

I 'm trying to convert a project  7. Cool Icons Set - Blue Glossy from AS2 to AS3 (with Flash CS3).
It has some MovieClips.
In the MovieClips it has code. For example in some frame of a MovieClip it has 'stop();'

But in AS3 code is not allowed in the MovieClips.
How can I do it in AS3? (I suppose I 'll have to make some class for the MovieClip...??)

  Anyway, don't you think this is a regression?

It was so easy to put code in the frames of the movieClip and so handy, and they replaced it with something much harder?

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Ned Murphy
Legend
April 22, 2015

Code is allowed inside movieclips in AS3 - you can put it in the frames.  The primary difference between AS2 and AS3 in terms of where the code can go is that AS3 does not allow code to be attached to objects.

PanosKolettis
Known Participant
April 22, 2015

Maybe I 'm not expressing it correctly.

It gives me a warning when I run it:

WARNING: Actions on button or MovieClip instances are not supported in ActionScript 3.0. All scripts on object instances will be ignored.

So the actions in the MovieClips are not executed.

You can download it from here.

Ned Murphy
Legend
April 22, 2015

You are repeating what I just said cannot be done in AS3... you cannot place code ON objects, but you can place code in the timeline(s).

If you are getting that warning then chances are that if you open the program as an AS2 file you can select a button or movieclip while the actionscript window is opened and you will see code that has been attached to the object... it is not in the timeline.  It might take some trial and error to locate though.  This was a poor design choice for the software which many people made use of... it makes finding code difficult since there is nothing to indicate which objects have code attached to them.  When you place code in the timeline you can see that by the "a" indications in the timeline frames, but there is nothing of the sort for code that is placed on objects.  AS3 does not allow code to be attached to objects, but you can still place code in the timelines.