Another solution to this is to use helper classes, instead of compiling the
script block into the component class.  I never have more than a single
script block in an mxml file, rarely have more than one included script
file, and often have none of either.

 

You can use the code-behind technique, or static functions in a separate
class, or a normally instantiated helper class.

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: [email protected] [mailto:[email protected]] On
Behalf Of Dan Pride
Sent: Thursday, November 26, 2009 2:41 PM
To: [email protected]
Subject: [SPAM] [flexcoders] Multiple Script Files

 

  

A similar question. To simplfy things I have created a script file for each
table with the relevant actionscript functions for the table in the file.

i.e.
<mx:Script source="CenterScript.as" /> 
<mx:Script source="SquareScript.as" /> 
<mx:Script source="LocaScript.as" /> 
etc etc 

Is this a common way to handle script complexity as an application grows?
The app only uses a couple of components so there is a fair bit of
actionScript code tied to the main app file.

Thanks
Dan Pride



Reply via email to