I am using Flex to build a web based viewer, although I can build it in a pure actionscript 3.0 project, but I thought using Flex will save us time building complex UI components ..
So, as the question implies, can we use those Flex UI components with starling?
Is it as easy as adding the UI component to the Starling ex .. starling.display.Sprite rather than to the conventional display list? is that all?
I hope I can find a clear answer here, otherwise Flex as an option will be questionable or canceled ..
Well?
Flex components inherit Flash sprites which are not the same as Starling's sprites. So the answer is no, Starling won't let you add a Flex component.
Flex component are coded using the native Flash display list, you would have to recode them entirely using Starling.
Related
What are the advantages of mxml based project over a pure actionscript based project in Flash Builder. Especially, when after Flash Builder 4.6, the design mode has been removed off.
If you are after smallest filesize: go for pure AS3.
If you are after ease-of-use (dev & user): go for Flex.
There is no "I'm using MXML, so I'm not using AS3", rather Flex is an extension to AS3 which will increase your filesize and RAM usage a bit but for that you can do a lot of UI related things way quicker (not just because of MXML).
So, even without design mode, using Flex for the UI design will be much more comfortable than AS3. Think about nested relative sizes ("box in a box in a box is 25% percent the width of the parent"), with Flex that is easily managed (it does it for you), with pure AS3 you will wind up in a nightmare of possible relations to calculate.
Or colors: how to transform the actual hue of a color? Modifying the RGB channels will turn out to be tricky, Flex has an HSB class, so you can convert a color to HSB (hue, saturation, brightness), manipulate it and then return it as RGB.
Eventually, especially with larger projects, you will end up with a mixture of pure-ActionScript and Flex.
MXML is just a declaritive markup language for Flex. Reasons for using MXML instead of AS3 in a Flex project are the same as any markup language, such as HTML in the browser.
A "pure AS3 project" typically refers to not using Flex, so it's more than not using MXML, it's also not having access to the Flex library of components.
I need to build a mobile application using starling by creating a FlexMobileApplication project and not an ActionScriptMobileApplication project.
Can i have both MXML controls and Stage 3D (strarling content) at the same time in my app.
Yes you can mix them, but take note of the following:
Starling is a framework for stage3D which runs on a lower layer than the normal Flex (non stage3D) content.
You need to set your Application backgroundAlpha to 0 in order to be able to see the starling content.
You will only be able to display Flex controls over Starling (and not mix them or have the reverse layering)
there may be other points to disuss, as performance and so on but since you picked already Starling you should know the basics by now.
Update
If you need flex like controls on the Stage3D leyer, use Feathers Framework for Starling.
Here are some samples: http://feathersui.com/examples/components-explorer/
Here is the framework wiki: http://wiki.starling-framework.org/feathers/start
I'm creating a flex drag and drop interface of sorts that will have a range of different components. Is there a standard way of adding resize handlers to a component or does the component need to be overridden?
Do you mean front-end resizing?
Senocular wrote an excellent transform class for that:
http://www.senocular.com/flash/tutorials/transformtool/
http://www.senocular.com/demo/TransformToolAS3/TransformTool.html
I found quite a useful example that is easy to implement. It gives support for changing cursors, setting bounds, rotation and fixed aspect ratio. I think its worth a look for anyone needing to add resize support.
https://github.com/marc-hughes/ObjectHandles/tree/master/flex-object-handles
The above link is a flex project download. Import the flex project and run the MoveAndResize.mxml example.
I am using Flex with Flash Builder 4 and it provides two classes to work with Custom Flash Professional components, the ContainerMovieClip and UIMovieClip.
I am confused on when to use a ContainerMovieClip and when to use a UIMovieClip.
Since ContainerMovieClip can hold only one component, I don't see how is it better than just placing the component directly on the design area.
I would have thought of using it as a inner frame to arrange multiple components that can be moved together by modifying the X,Y coordinates of the container, but I understand this isn't how it works, right?
I'd appriciate if you could answer this or direct me to an article on
1) When to use UIMovieClip and when to use a ContainerMovieClip?
2) Why ContainerMovieClip can hold only a single component?
Thanks.
RaamEE
Adobe's help docs are very useful and 90% of the time they will answer your questions.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/flash/UIMovieClip.html
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/flash/ContainerMovieClip.html
How can I make a DisplayObject popup like Flex PopUpManager in AS3?
You might use the PopUpManager of AS3Commons UI Layers. A pure and slim AS3 implementation that I am developing - meant to be an alternative to the Flex thing.