SWISHmax : Not fully MX compatible

Support for ActionScript in SWiSHmax is NOT 100% MX compatible. The incompatibility is subtle but important.

Apparently SWiSHmax doesn't create the correct bytecode if you use an intrinsic function name (like "play") as an object member name. As an example, this code works fine in Flash MX but fails completely in SWiSHmax.

onFrame (1)
{
    var x = new Object;
    x.play = function() { fscommand("fullscreen", "true") };
    x.play();
}

This is especially problematic if you're trying to use the ActionScript API in SWF Studio because some functions, like ssCore.WMAudio.play, can never be called from SWiSHmax because of the use of the keyword play.

Using dot notation i.e. object.membername is the normal way to dereference object members, but the array notation i.e. object["membername"] is equally valid, so using ssCore.WMAudio["play"]({}) is one way to solve the SWiSHmax problem. The array notation keeps the member name in a string literal so it's evaluated only at runtime and not treated as a special name at compile time like it would be in the dot notation.

To make this even easier for SWiSHmax users, SWF Studio creates aliases for every function in the ActionScript API. So instead of calling ssCore.WMAudio.play({}) you can use ssCore.WMAudio.$play({}). The only difference is the $ prefix before the method name.

You only need to use a $ when the method name of an ActionScript API call matches the name of a Flash intrinsic function like "play", "loadMovie", etc. Here's a list of names you should use the $ with.

· getURL
· loadMovie
· loadMovieNum
· loadVariables
· loadVariablesNum
· play
· print
· stop
· trace