[flexcoders] Re: mxml components
Hmm. I wonder what I am doing wrong. I am using the SDK and a text editor to create my .as files. I have succeeded in compiling and running some custom classes that I have built. I have succeeded in using some of the flex components by copying the component source files to my source directory and changing the package names in the component source files. I tried pointing the compiler to the source files themselves by adding the path to the source path in the flex-config.mxml file like this: source-path path-element /Users/Tom/flex/flex_sdk_3/frameworks/projects/framework/src /path-element /source-path It looks like the library-path is set properly, pointing to the SWC files. My program using the flex components will compile with no errors, but when I try to run it I get TypeError: Error #1009: Cannot access a property or method of a null object reference. and a list of the mx components in the program. Thanks for any advice. In the meantime, I will keep reading. --- In flexcoders@yahoogroups.com, David Pariente xxmapach...@... wrote: Yes, i think from flex you can perfectly use them using only AS3. No secret about that. If you mean using them in flash, i thing it's also possible using the special packaged flex component kit for flash, available at flex website. -- David Pariente RIA consultor -- El 04/01/2010, a las 03:14, ztpi1 zt...@... escribió: Is it possible to use the components in the flex framework without using mxml?
[flexcoders] Re: mxml components
The import statement does not create instances. It just makes a class available to another class so it can use its methods and create instances of it. You don't need an import statement if the class you want to import is in the same package as the class you are referencing it from. You can import an entire package by using the wildcard character (import mx.controls.*). You create instances by using the new operator. When you declare an object in MXML that tag is compiled into a block of Actionscript that contains the new operator. --- In flexcoders@yahoogroups.com, Scott [EMAIL PROTECTED] wrote: The import class; is what creates the instance? So in other words, if I use the import thisfile.mxml in each of my other files, each one is creating another instance of the thisfile.mxml? From: flexcoders@yahoogroups.com on behalf of Michael VanDaniker Sent: Tue 7/29/2008 10:30 AM To: flexcoders@yahoogroups.com Subject: {Disarmed} Re: {Disarmed} RE: [flexcoders] mxml components Are these the same instance or unique instances with in each of the class instances themselves (mainclass/class3)? MainClass.mxml: mx:script ![CDATA{ Import com.myapp.models.LoginClass; ... .. And Class3.mxml mx:script ![CDATA{ Import com.myapp.models.LoginClass; ... .. These are not instances. You create instances by either declaring them in MXML or using the new operator in script. The import statements make LoginClass available to MainClass and Class3 so you can create instances of LoginClass from within each of those components. You don't need an import statement if the class you reference is in the same package you are referencing it from. -- This message has been scanned for viruses and dangerous content by MailScanner http://www.mailscanner.info/ , and is believed to be clean.