RE: [flexcoders] New to Flex, couple of questions
I just had the chance to read the replies to my questions now! Thanks a lot Dirk and Tracy! Though this is overdue since about a week! Sascha -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dirk Eismann Sent: Monday, 24. April, 2006 22:44 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] New to Flex, couple of questions Importance: High Hi - and welcome to Flex :) MXML files get turned into AS prior compilation and you can do pretty anything either in MXML or AS. A typical usecase is to setup a Controller inside your main Application file. This can be done either in a Script block or by tag syntax as Tracy suggested. Below are two examples - email code, but you should get the idea :) 1) Script style mx:Application creationComplete=initApp() mx:Script import foo.bar.Controller; private var controller:Controller; private function initApp():void { controller = new Controller(); controller.init(this); } /mx:Script /mx:Application 2) Tag style mx:Application creationComplete=controller.init(this) Controller id=controller xmlns=foo.bar.* / /mx:Application // Controller.as package foo.bar { import mx.core.Application; public class Controller { public function init(application:Application) { // whatever... } } } -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] New to Flex, couple of questions
Ive checked through the block and found 3 Ant build files, but none of them mention the Flex compiler anywhere (compc.exe), not sure if this is helpful. Thanks anyway for the link! Sascha From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of JB Sent: Friday, 21. April, 2006 23:04 To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] New to Flex, couple of questions Importance: High Hi, Check out Simeon Bateman site http://www.simb.net/blog/ -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] New to Flex, couple of questions
Hi Tracy, An example would be great if you got any. Even if it's in 1.5 I think it will be helpful to understand how AS and Flex works together. Thanks, Sascha -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Saturday, 22. April, 2006 02:34 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] New to Flex, couple of questions I am not doing 2.0 yet, but in 1.5 you can put your AS code in a class file, and then either instantiate it in a tag, or make the class methods static, import it and then use the static methods. I have a simple example in 1.5 if you want to see it. Tracy -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] New to Flex, couple of questions
Hi - and welcome to Flex :) MXML files get turned into AS prior compilation and you can do pretty anything either in MXML or AS. A typical usecase is to setup a Controller inside your main Application file. This can be done either in a Script block or by tag syntax as Tracy suggested. Below are two examples - email code, but you should get the idea :) 1) Script style mx:Application creationComplete=initApp() mx:Script import foo.bar.Controller; private var controller:Controller; private function initApp():void { controller = new Controller(); controller.init(this); } /mx:Script /mx:Application 2) Tag style mx:Application creationComplete=controller.init(this) Controller id=controller xmlns=foo.bar.* / /mx:Application // Controller.as package foo.bar { import mx.core.Application; public class Controller { public function init(application:Application) { // whatever... } } } Concerning ANT and the command line compilers: mxmlc is used to compile applications (SWF files), compc is used to compile component libraries (SWC files) so you should look out for ANT scripts that use mxmlc and not compc :) In addition, you might want to check what Mike Chambers blogged recently: http://weblogs.macromedia.com/mesh/archives/2006/04/flex_2_actionsc_1.cf m Dirk. -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sascha Balkau Sent: Monday, April 24, 2006 6:36 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] New to Flex, couple of questions Hi Tracy, An example would be great if you got any. Even if it's in 1.5 I think it will be helpful to understand how AS and Flex works together. Thanks, Sascha -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Saturday, 22. April, 2006 02:34 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] New to Flex, couple of questions I am not doing 2.0 yet, but in 1.5 you can put your AS code in a class file, and then either instantiate it in a tag, or make the class methods static, import it and then use the static methods. I have a simple example in 1.5 if you want to see it. Tracy -- 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 SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] New to Flex, couple of questions
This very simple sample app consist of three file. One is an ordinary class, one is a class with static methods and the third is the main mxml file, which uses the two utility classes. Tracy ?xml version=1.0 encoding=utf-8? !-- UtilityClassTest.msml -- mx:Application xmlns:mx=http://www.macromedia.com/2003/mxml xmlns=* mx:Script![CDATA[ import UtilityClassStatic public var sAppProperty:String = BAZ; ]]/mx:Script UtilityClass id=u app={this}/ mx:Label text={u.getFoo()} / mx:Label text={UtilityClassStatic.getBar()} / /mx:Application // UtilityClas.as Example utility function class for dynamic instantiation class UtilityClass { public var app:UtilityClassTest; public function getFoo():String{ return FOO + app.sAppProperty; } }//UtilityClass // UtilityClassStatic Example utility function class for Static reference class UtilityClassStatic { public static function getBar():String{ return BAR; } }//UtilityClassStatic -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sascha Balkau Sent: Monday, April 24, 2006 12:36 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] New to Flex, couple of questions Hi Tracy, An example would be great if you got any. Even if it's in 1.5 I think it will be helpful to understand how AS and Flex works together. Thanks, Sascha -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Saturday, 22. April, 2006 02:34 To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] New to Flex, couple of questions I am not doing 2.0 yet, but in 1.5 you can put your AS code in a class file, and then either instantiate it in a tag, or make the class methods static, import it and then use the static methods. I have a simple example in 1.5 if you want to see it. Tracy -- 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 SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Re: [flexcoders] New to Flex, couple of questions
Hi,Check out Simeon Bateman sitehttp://www.simb.net/blog/Sascha Balkau [EMAIL PROTECTED] wrote:Hi list, I'm familiar with ActionScript 2.0 but new to Flex and just started learning Flex 2.0 and AS3.0. I'm amazed how easy and flexible components can be used with Flex but I got a few questions about it... So far I have only seen MXML code with embedded ActionScript. But I prefer to write the ActionScript in a class structure. Is it possible to keep both ActionScript Classes and MXML code in their own files and somehow link these? If so, how do I do that? I'd like use an Ant build file to compile the Flex apps but I'm not very familiar with the compiler syntax yet. Does somebody know of any examples on the web on how to use the compiler in a command line or an example Ant build file for it? Thanks for any help! Sascha How low will we go? Check out Yahoo! Messengers low PC-to-Phone call rates. -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Web site design development Computer software development Software design and development Macromedia flex Software development best practice YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
RE: [flexcoders] New to Flex, couple of questions
I am not doing 2.0 yet, but in 1.5 you can put your AS code in a class file, and then either instantiate it in a tag, or make the class methods static, import it and then use the static methods. I have a simple example in 1.5 if you want to see it. Tracy -Original Message- From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sascha Balkau Sent: Friday, April 21, 2006 12:26 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] New to Flex, couple of questions Hi list, I'm familiar with ActionScript 2.0 but new to Flex and just started learning Flex 2.0 and AS3.0. I'm amazed how easy and flexible components can be used with Flex but I got a few questions about it... So far I have only seen MXML code with embedded ActionScript. But I prefer to write the ActionScript in a class structure. Is it possible to keep both ActionScript Classes and MXML code in their own files and somehow link these? If so, how do I do that? I'd like use an Ant build file to compile the Flex apps but I'm not very familiar with the compiler syntax yet. Does somebody know of any examples on the web on how to use the compiler in a command line or an example Ant build file for it? Thanks for any help! Sascha -- 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 Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.