Scripting Adobe Flash

Does anyone here have any tips for working with scripting adobe flash? I’m working on a script to import animation frames into a flash document, it works but flash is incredibly slow. I’m wondering if there’s something I’ve overlooked for running Flash in a lighter batch mode or anything similar to that. Also wondering about how to make a UI for tools in Flash. Thanks for any responses to this!

I have also found flash scripting horribly slow. The scripting seams to operate at the user input level, this mean that flash is updating its UI the whole time.
Fortunately my brush with flash scripting didn’t requre the construction of a UI.

Good Luck :slight_smile:

I second that… it can be very slow depending on what you’re doing with it, as for UI You can define UI in an XML, It’s quite nice, and formatting wise it’s very simple. Here is an example I ripped from an old tool;


<dialog id="fix_command" title="Didj Level Check" buttons="accept,cancel">
<vbox>
	<flash width="138"  src="logo.swf"  height="138"  id="ooi_logo" />
	<spacer/>
	<label value="Tool Options" align="left" />
	<separator/>
     <checkbox id="didji_Scale" label="Fix Scale" checked="true" />
	<separator/>
		 <menulist id="didji_snap_meth">
		 <menupop>
			<menuitem label="Pixel Snap" value="pixel" selected="false" />
			<menuitem label="8 x 8 Grid" value="8grid" selected="false" />
			<menuitem label="16 x 16 Grid" value="16grid" selected="true" />
			<menuitem label="32 x 32 Grid" value="32grid" selected="false" />
			<menuitem label="64 x 64 Grid" value="64grid" selected="false" />
		</menupop>
		</menulist>
	<separator/>
</vbox>
</dialog>

Then call it in your jsfl like so;


didjfix_win=document.xmlPanel(fl.configURI +"Commands/didji_ui/didji_lvl_fix.xml");

And you can get user feedback like this;

if(didjfix_win.dismiss == "accept") 
{
if (didjfix_win.didji_snap_meth == "8grid")
{digisnaper(8 , element);}
//etc.
}

The beautiful part is you can quite easily use your script to generate an XML for UI as a response, then instantly call it. In this way you can create a dynamic UI which can change based on the results of your script.

Cheers

Thanks for the UI help Kolgrima. Did some googling and it turns out you can even embed swf’s into the UI panels.