[TxMt] Suggested workflows AS3: Flash/Textmate

Gaby Vanhegan gaby at vanhegan.net
Mon Jun 2 15:21:20 UTC 2008


On 2 Jun 2008, at 11:14, Alistair Colling wrote:

> 1) Is there a way I can compile in Textmate that can incorporate  
> designs made in an FLA? I would like to be able to create interfaces  
> in Flash, create the SWF initially from the Flash IDE and then edit  
> all of my code in Textmate and compile from Textmate while I am  
> working. I'm aware that I can create library items and attach them  
> to the stage at runtime but I would like to be able to lay them out  
> in Flash as well. I was able to do this in AS2 when using MTASC but  
> when I compile using fcsh the content from the original SWF  
> (compiled from Flash) is overwritten.

This works perfectly for me:

package {
	
	[Embed(source="file.swf",symbol="MyExportedSymbol")]
	public class MyExportedSymbol extends Sprite {
		
		// Create a public var for each named clip in the symbol's root

		// Standard constructor
		public function MyExportedSymbol ( ) : void {
		}

	}

}

Then just build the application in TM.  mxmlc will pull in the  
appropriate symbol from the swf then any time you create a  
MyExportedSymbol object with:

var ms:MyExportedSymbol	= new MyExportedSymbol();

If creates it with the asset from the .swf file you specified.  The  
gotcha will be that if you have a couple of clips in that symbol's  
root timeline you need to create public variables to hold them in the  
class definition.  For example if you have two clips dropped into it  
named ClipA and ClipB, you will need to have:

	public var ClipA:Sprite;
	public var ClipB:Sprite;

As public variables of the class.

Enjoy!

G.

--
Being drunk is feeling sophisticated without being able to say it.
http://www.playr.co.uk/





More information about the textmate mailing list