Is there any fl.control.* classes that exist in Flex AS3? - apache-flex

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

Related

Using mx components in an "actionscript project" in Flash Builder

In Flash builder, I want to create an "Actionscript Project" that uses the mx datagrid component. Unfortunately the mx/spark components don't seem to be available unless your project is a "flex project". Is there a way around this? (I really don't like using that mxml mark-up, and just want to write pure code)
thanks!
In ActionScript Build Path, you have to manually add SWC libraries outside Flex library as shown below (add additional libraries as per your requirement):

How to convert a flex mx component to AIR?

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.

Moving Flex MXML Application into Flash

is it possible to move a flex mxml project into flash?
i have the project complete in mxml with actionscript but due to the fact that flex is limited in its visual animations ( no timeline! ) i would prefer to switch to using flash.
the project is relatively huge, all done in mxml and i cant just re-create it in flash, it will take months!
what do you think? is there a conversion ability or a use of flex component inside flash? if so, how?
Thanks.
There is no conversion utility, but as noted in the comments you can build your animation in the Flash authoring tool and import it to Flex (Flash Builder.)
The way you do this will depend on what type of animation you're trying to do. If it's just a simple path or the animation of some type of built in shape you'll want to export the animation to FXG to easily import it into Flex. Select the object you're trying to export and hit file->export->Export Selection. In the export window select "Adobe FXG" as the export format. Try this article for more information.
If you're building an animation that needs to be controlled via scripting or is more complicated you'll need to export it as Flash content (SWF or SWC are fine.) Then load the object in to your Flex application dynamically and script it accordingly. Be aware that cross-swf scripting security issues may arise if you use a swf loaded at run time.
You might consider converting the Flex project into a Flex library project and placing the resulting swc into the class path of the Flash project.

what package I should import to use DataProvider class

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.

How can I export part of a Flex Application to a SWF?

I have a Flex App that allows you to dynamically build an animation. It has a UI and a display of the resulting animation, which is a custom Class extending UIComponent. Is there some way to allow users to save/export the dynamically generated Component to a SWF, for reuse in other Flash/Flex Apps?
You can easily export a screenshot, but i don't think you can save a swf.
see this thread:
http://www.actionscript.org/forums/showthread.php3?t=145846
You can export the component (or components) in a SWC design-time library or an RSL run-time library to share between applications.

Resources