I need to use DataProvider class and i cannot find the package that contains it. In all examples I saw they use fl.data, but I'm using flex builder sdk 3.4 beta and it doesn't have such a package. Any clue?
Thanks,
Nava
fl.data.DataProvider is a Flash authoring tool specific class and cannot be imported to a flex project. Check out ArrayCollection or XMLListCollection for flex.
As far as Adobe's classes are concerned, packages starting with
fl.* are CS3/4 only.
mx.* are Flex/AIR only.
flash.* are available everywhere.
Related
In Scenebuilder 1.1, you could import an entire custom component as a whole.
In 2.0, however, it is importing the component as separate pieces (Container and nodes). Since my custom component relies on being unified to work with its controller and IDs, this breaks it.
Is there anything I can do as of yet? I'd really like to be able to use Java 8 and Scenebuilder 2.0 for its DatePicker. If a full stable release is right around the corner, perhaps I can wait. I'd preferably want to avoid hacky solutions.
Any ideas?
I have only found one way to deal with this kind of back-compatibility: building my own scenebuilder.
It is officially open source so you can check it out with mercurial on bitbucket for instance.
Then you build it and modify it to put all your custom components and dependencies in the same classpath for one unique classloader.
Check the class named FXOMLLoader, it is where the classloader is used, my fix was to explicitly only use one classloader for all components and adding a few repertories with my deps inside to the classpath for it to work.
I have used Jar Class Loader library to do so, and it works pretty well. This is pretty hacky though.
I have a flex component that is using mostly mx and actionscript code. I am using it fine in my AIR application, however, I need to be able to use certain Air libraries within this component, so I need to make it Air 'aware' or compatible.
For example, I need to get a reference to the current active window, so it looks like I need to use NativeApplication.activeWindow.
But when I type this in to my component actionscript class, it does not know about NativeApplication. So it seems I have to do something to that project to enable Air classes, unless there is another approach?
Do you use Flash Builder and Flex Library Project to compile your component?
If yes, there is a checkbox "Include Adobe AIR libraries" in the project properties. Open Project > Properties > Flex Library Compiler and check "Include Adobe AIR libraries".
Need to import the libraries into your code like this:
import flash.display.NativeWindow;
import flash.display.NativeWindowSystemChrome;
import flash.display.NativeWindowInitOptions;
Then the application can use it.
Are there any good tools to generate UML class diagrams using the source code from a Flex Builder project? I have been trying IntelliJ but for some reason it generates the inherited class structure from the SDK and not everything below my main app.
You could try UML4AS - UML for ActionScript and Flex.
You may have a look on the following program:
Commercial:
http://www.sparxsystems.com/products/ea/index.html
http://www.visual-paradigm.com/support/documents/vpumluserguide/12/13/5963_aboutvisualp.html
Free:
Using StarUML to Generate ActionScript 3.0
Edit: 29 May
http://www.uml4as.com/flower-platform/ the alpha version can be download now.
I think the best option for now is to use Crocus Modeller, UML for Flex & AS3
The internet says to add
import fl.controls.Combobox
But Flex says that there is no class called fl.controls
Which is the equivalent class in flex?
You cannot import fl.* classes to a Flex application, and you cannot import mx.* classes to a Flash application - those are platform specific if you will. Only flash.* classes can be used irrespective of the platform.
Use the flex combo box as already suggested, or export the flash combo box to an SWC and give it a shot.
This shouldn't be an issue if you're using Flex as just an editor - that is if you're not compiling your AS files using Flex. The only problem would be that you won't get auto-complete for fl classes. You can just ignore the flex errors and compile it using flash.
mx.controls.ComboBox
Similar to the [Embed ()] tag I know from flex ¿ what's for the following code:
[Event(name="init",type="flash.events.Event")]
[Event(name="ioError",type="flash.events.IOErrorEvent")]
[Event(name="securityError",type="flash.events.SecurityErrorEvent")]
I've found this in several libraries I used, the one show here is from Flartoolkit, the code is defined inside the package, after the imports.
By the way, is this code executed when I compile in flash IDE?
Thanks,
.am
That's actionscript's metadata tags. These specific ones declare that the class below them throws these kind of events of these types.
http://livedocs.adobe.com/flex/3/html/metadata_3.html#159710
This metadata gets bound to the class at runtime and is available for access
[Event] metadata is for the Flex framework and are not used by the Flash IDE, but you can use of the [Embed] metadata under Flash CS4