(PHP 5 < 5.3.0, PECL ming SVN)
SWFAction.
The script syntax is based on the C language, but with a lot taken out- the SWF bytecode machine is just too simpleminded to do a lot of things we might like. For instance, we can't implement function calls without a tremendous amount of hackery because the jump bytecode has a hardcoded offset value. No pushing your calling address to the stack and returning- every function would have to know exactly where to return to.
So what's left? The compiler recognises the following tokens:
There is no typed data; all values in the SWF action machine are stored as strings. The following functions can be used in expressions:
length
at location location
of
the given string string
.
Additionally, the following commands may be used:
clip
(aka sprite). The new movie clip has name name
and is at depth depth
.
target
. The lock
argument indicates whether
to lock the mouse (?)- use 0 (FALSE
) or 1 (TRUE
). Optional parameters
define a bounding area for the dragging.
target
argument
corresponds to HTML document targets (such as "_top" or "_blank").
The optional method
argument can be POST or GET if you want to submit
variables back to the server.
target
argument can be a
frame name (I think), or one of the magical values "_level0" (replaces
current movie) or "_level1" (loads new movie on top of current movie).
num
. Frame numbers start at 0.
name
. Which does a lot of good, since I
haven't added frame labels yet.
Movie clips (all together now- aka sprites) have properties. You can read all of them (or can you?), you can set some of them, and here they are:
/box.x = 100;
.
Why the slash in front of the box, though? That's how flash keeps
track of the sprites in the movie, just like a Unix filesystem-
here it shows that box is at the top level. If the sprite named
box had another sprite named biff inside of it, you'd set its x
position with /box/biff.x = 100;. At least, I think so; correct
me if I'm wrong here.