Static classes are easy, just import them and start using it.

<mx:Script>
import com.tapper.MyFormatFunction;
fuction formatThingy(thingToFormat){
return MyFormatFunction.format(thingToFormat);
}
</mx:Script>

At 05:38 PM 2/24/2005, you wrote:
That will only work with a pure AS file, not a class. It is a true "include", and is functionally the same as putting the script directly in the main file.

The class approach, while it makes references a little harder, is better since it helps to avoid the 32k limit.

It is possible to have static class, instead of instantiating it, but I am not quite sure how to do that.
Tracy



---------- From: Omar Ramos [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 4:56 PM To: [email protected] Subject: RE: [flexcoders] Learning to connect actionscript pages to mxml pages

Hi matt,

try this

<mx:Script source="brandnewas.as"/>


Omar Ramos Technology Manager www.itacon.net <http://www.itacon.net/> []




---------- From: Matt Horn [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 12:07 PM To: [email protected] Subject: RE: [flexcoders] Learning to connect actionscript pages to mxml pages Try putting quotes around the {this} in the brandnewas tag:

<brandnewas id="bna" bnaview="{this}" />
matt h



----------
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 24, 2005 10:46 AM
To: [email protected]
Subject: [flexcoders] Learning to connect actionscript pages to mxml pages
I am trying to teach myself how to make an mxml page and connect it to an action script page. To do this I am trying out the simplest program possible. I will show you all the code I have written for both files and what I did was just make a simple mxml page with no extra code and linked it to an action script page with what I believed to be the correct syntax.
Here is the mxml file:
<?xml version="1.0"?>
<mx:Application xmlns:mx="<http://www.macromedia.com/2003/mxml>http://www.macromedia.com/2003/mxml"; width="1738" height="1412" xmlns="*" >


<brandnewas id="bna" bnaview={this} />

</mx:Application>

Here is the .as file I am trying to link it to
// ActionScript Document
class brandnewas
{
public var bnaview:Object;
public function brandnewas()
{}
}






The error message I have been getting is that an mxml tag must be embedded within an application tag to either run or debug it. I also get an error message at the bottom for the mxml file that says in the description "Expected an attribute value[xml]" I am confused for a few reasons one being I thought I had an application tage around the brandnewas tag, and two I am not sure what var needs the attribute value?






Yahoo! Groups Sponsor
ADVERTISEMENT
<http://us.ard.yahoo.com/SIG=129fgdolk/M=298184.6018725.7038619.3001176/D=groups/S=1705007207:HM/EXP=1109370089/A=2593423/R=0/SIG=11el9gslf/*http://www.netflix.com/Default?mqso=60190075>
click here



----------
Yahoo! Groups Links
* To visit your group on the web, go to:
* <http://groups.yahoo.com/group/flexcoders/>http://groups.yahoo.com/group/flexcoders/


*
* To unsubscribe from this group, send an email to:
* <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]


*
* Your use of Yahoo! Groups is subject to the <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.


<<inline: 1074ad04.jpg>>

Reply via email to