Solved

Blending AS1 & AS2

Posted on 2006-11-13
2
331 Views
Last Modified: 2008-02-20
I maintain a Flash-based app comprised of a fairly large number of individual swfs. In a nutshell it flows from a login management branch to a menu generation branch and finally hundreds of different content movies at the bottom.

Eventually I'll be dragging everything to AS2 but that bottom layer is going to take quite awhile...in fact, it'll probably be better suited to wait long enough for player adoption and go straight to AS3. In the meantime i have a number to needs driving an attempt to get the Login & Menuing systems updated to AS2 asap.

I understand I can't blend as1 & as2 in the same movie but it seems like i should be able to count on using popups to segregate the clips enough to create a stable, blended app. So that the Menu (running under AS2) fires the AS1 Content clips into a seperate popup. The complication will be that the content clips expect some values to be found in the Global and specific layers space.

Again, I'm sure a workaround is feasible - & that i'm not the first to face this need. Looking for an overview and others' experiences.

0
Comment
Question by:juststeve
  • 2
2 Comments
 
LVL 5

Accepted Solution

by:
blockage1 earned 250 total points
ID: 17969736
To a certain extent you can blend AS1 and AS2 without any problems - even when set your publish settings to AS2 you'll find that most AS1 still works (I'm not aware of any that wont).

If you use AS2 classes, then all code inside the classes must be AS2. In your main movie you can import AS2 classes and use them along with any AS1.

The only realy problem with having a mixure of AS1 and AS2 is that you'll lose some of the advantages of AS2 - things like typed variables are very useful but less so if they're not used everywhere.

If your targeting older versions of the player you still need to watch out for specfic features, e.g. if you're targeting the v6 plugin you can't use getNextHighestDepth() with either AS1 or AS2 as it didn't come in until v7.

It's also worth noting that AS2 and AS1 compile to the same code - it's only with AS3 that thing get more complicated.
0
 
LVL 5

Expert Comment

by:blockage1
ID: 17970243
Something on another forum just reminded me of one bit of AS1 that wont compile as AS2 - the slash notation. In AS1 you could do stuff like

/:myVar

In AS this has to be changed to...

_level0.myVar
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now