[flexcoders] GLOBAL functions?
Hello, I've got some functions and variables in my main MXML file that I need to access from other MXMLs in the project. For some reason, I can't seem to figure out how to do this. I've (obviously) checked the documentation looking for a 'global' keyword, or for an 'extern' keyword or for some other way to do this. I'm sure I'm missing something obvious. Could someone point me in the right direction? Thanks in advance, Steve Steve Kellogg Peak8 Solutions 1401 14th Street Boulder, Colorado 80302, USA Fax: 303.415.2597 E-Mail: [EMAIL PROTECTED]
Re: [flexcoders] GLOBAL functions?
use mx.control.Application.application to access the variable. No globals are there in AS-3 jignesh dodiya On 11/25/06, Steve Kellogg @ Project SOC [EMAIL PROTECTED] wrote: Hello, I've got some functions and variables in my main MXML file that I need to access from other MXMLs in the project. For some reason, I can't seem to figure out how to do this. I've (obviously) checked the documentation looking for a 'global' keyword, or for an 'extern' keyword or for some other way to do this. I'm sure I'm missing something obvious. Could someone point me in the right direction? Thanks in advance, Steve Steve Kellogg Peak8 Solutions 1401 14th Street Boulder, Colorado 80302, USA Fax: 303.415.2597 E-Mail: [EMAIL PROTECTED] -- Regards, Jignesh Dodiya
RE: [flexcoders] GLOBAL functions?
Jignesh, Thanks VERY MUCH. Steve _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jignesh Dodiya Sent: Saturday, November 25, 2006 10:21 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] GLOBAL functions? use mx.control.Application.application to access the variable. No globals are there in AS-3 jignesh dodiya On 11/25/06, Steve Kellogg @ Project SOC [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] com wrote: Hello, I've got some functions and variables in my main MXML file that I need to access from other MXMLs in the project. For some reason, I can't seem to figure out how to do this. I've (obviously) checked the documentation looking for a 'global' keyword, or for an 'extern' keyword or for some other way to do this. I'm sure I'm missing something obvious. Could someone point me in the right direction? Thanks in advance, Steve Steve Kellogg Peak8 Solutions 1401 14th Street Boulder, Colorado 80302, USA Fax: 303.415.2597 E-Mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] com -- Regards, Jignesh Dodiya
RE: [Junk E-Mail - LOW] [flexcoders] GLOBAL functions?
You'll want to create a new actionscript class. In there, you can create your functions, and then in whatever files you need, you can just do an: include com.mycompany.myglobalfunctions And make the call: com.mycompany.myglobalfunctions.someMethod(); Shan _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Steve Kellogg @ Project SOC Sent: Saturday, November 25, 2006 11:05 AM To: flexcoders@yahoogroups.com Subject: [Junk E-Mail - LOW] [flexcoders] GLOBAL functions? Hello, I've got some functions and variables in my main MXML file that I need to access from other MXMLs in the project. For some reason, I can't seem to figure out how to do this. I've (obviously) checked the documentation looking for a 'global' keyword, or for an 'extern' keyword or for some other way to do this. I'm sure I'm missing something obvious. Could someone point me in the right direction? Thanks in advance, Steve Steve Kellogg Peak8 Solutions 1401 14th Street Boulder, Colorado 80302, USA Fax: 303.415.2597 E-Mail: [EMAIL PROTECTED]
RE: [flexcoders] GLOBAL functions?
Hi, Try creating a package with a class containing all your global functions (i.e myUtils), then you can include this package and use the class including functions and variables. Hope this helps, Flexy _ From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Steve Kellogg @ Project SOC Sent: Saturday, November 25, 2006 7:05 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] GLOBAL functions? Hello, I've got some functions and variables in my main MXML file that I need to access from other MXMLs in the project. For some reason, I can't seem to figure out how to do this. I've (obviously) checked the documentation looking for a 'global' keyword, or for an 'extern' keyword or for some other way to do this. I'm sure I'm missing something obvious. Could someone point me in the right direction? Thanks in advance, Steve Steve Kellogg Peak8 Solutions 1401 14th Street Boulder, Colorado 80302, USA Fax: 303.415.2597 E-Mail: [EMAIL PROTECTED]
RE: [flexcoders] Global functions
There are certainly ways to do global functions and variables, but OO languages like AS3 generally avoid them. You can describe your functions as static in a class and make them globally accessible that way, but you'd still need to import the package. If you have a bunch of imports that you'll use in *every* file you could create a little snippet of AS that has those imports and use the #include statement to pull them in (#include is dropping the # in the next beta I think). Matt -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Richard Schutten Sent: Tuesday, March 21, 2006 2:38 AM To: [EMAIL PROTECTED] Com Subject: [flexcoders] Global functions I want to create a Flex application where each part of the application is coded in a seperate mxml file. In the main application mxml i've added a TabNavigator and added a tab for each seperate mxml file. I also created a Functions ActionScript file which contains all functions for my application. In each mxml file i have to use 'import Functions.*' to reach my functions. Also when using an Alert in each file i have to use 'import mx.controls.Alert' in each. Is there a way to only import the needed stuff once, thus in the main mxml file? Does flex have Global Functions and variables? Richard -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Global functions
I want to create a Flex application where each part of the application is coded in a seperate mxml file. In the main application mxml i've added a TabNavigator and added a tab for each seperate mxml file. I also created a Functions ActionScript file which contains all functions for my application. In each mxml file i have to use 'import Functions.*' to reach my functions. Also when using an Alert in each file i have to use 'import mx.controls.Alert' in each. Is there a way to only import the needed stuff once, thus in the main mxml file? Does flex have Global Functions and variables? Richard -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/