<p>I have an actionscript file that defines a class that I would like to use inside a Flex application. </p>

<p>I have defined some custom controls in a actionscript file and then import them via the application tag:</p>

<pre>
<code>
&lt;mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:scorecard="com.apterasoftware.scorecard.controls.*"
...
&lt;/mx:Application&gt;
</code>
</pre>

<p>but this code is not a flex component, rather it is a library for performing math routines, how do I import this class?</p>

You'd need to import the class inside a script tag.
```
```
<mx:Application
  xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:Script>
    import com.apterasoftware.scorecard.controls.*;
    // Other imports go here

    // Functions and other code go here
  </mx:Script>

  <!-- Components and other MXML stuff go here -->
  <mx:VBox>
    <!-- Just a sample -->
  </mx:VBox>
</mx:Application>
```
```
Then you'll be able to reference that class anywhere else in your script tag.  Depending on how the class is written you may not be able to use binding within the MXML, but you could define your own code to handle that.
Namespace declarations are only used to import other MXML components.  AS classes are imported using the import statement either within a Script block or another AS file.