views:

425

answers:

6

Can any Flash compiler put specific scripts on specific frames of the Flash movie SWF?

Like you can do from within the Flash IDE, just place a script on the required frame using the Timeline panel, and the script gets compiled to that frame of the Flash movie SWF.

Eg. script on frame 1 :

trace("Reached frame 1");

Eg. script on frame 2 :

trace("Reached frame 2");

SWF Compilers: (Hopefuls)

+1  A: 

As far as I know, none of the compilers you mentioned manages a timeline based execution. But swfmill may help here. I advise you to compile your own binaries because the precompiled binaries are pretty outdated and lacks important fixes.

artificialidiot
+1  A: 

Both MTASC and Haxe let you 'inject' code into a specific frame of an existing swf. The usual process is to create a library swf using SWFMill that contains all your assets. After that you inject your code with either one of the compilers into that swf resulting in a new swf.

After injecting code into frame 1, try also injecting code into frame 2 as a next step. In theory this should work. I haven't tried this myself so you might want to experiment with this.

Luke
+1  A: 

There is a small haxe written neko tool that allows you build multiple frame swfs: http://gamehaxe.com/2009/02/04/haxe-preloader-for-flash-written-in-haxe/

Hippo
A: 

maybe you can also have a look at the undocumented function

addFrameScript(frameNumber,function,frameNumber,function...)

OXMO456
+1  A: 

It's possible with the MXMLC, though it not very well documented.

A Google Search for Flex Frame Metadata will show you the code. A little trial and error and you should be able to get something working. (This is how the flex preloader works)

tylermac
WOW! Incredible. Just in case the Google SERP changes, here's the best link - http://nondocs.blogspot.com/2007/04/metadataframe_22.html
Jenko
A: 

what about using ASC opensourced in FLEX sdk, you could use it for compilation and then envelope the resulting abc into DoAbc tag and put into desired frame with any library that handles swf file format.

alexm