OSMF Widget based on MXML and AS3 - actionscript-3

I have been searching several days for an example of how to make a OSMF Widget writing some code with MXML (At least the layout code) and some code in AS3.
It is my first time working with this tech.
I have wrote some Widgets for OSMF in AS3, but now I have a design (Write in MXML) which I need to draw in the OSMF ChromeApplication.
I have been reading some OSMF source code and it seems that ChromeApplication extends Sprite, so my problem can be reduced to draw a MXML in a Sprite.
So my questions are:
Is it possible to create a MXML element with AS3 code and add it to a Sprite?
If it is possible, how do I do that?
If not, What is the best aproach to have some MXML Classes inside OSMF?

Use UIComponent and s:VideoPlayer for OSMF integration as noted in the above comments.

Related

How can I load bitmaps into my Flash game to use as reusable blocks?

I'm making a basic platformer game in Adobe Flash using Actionscript 3, based on the tutorial found here. This tutorial uses basic graphics drawing for the various elements of the game, using different shapes and colors. Can anyone show what extra code would be necessary to have the game elements be drawn from various bitmap images? For example, to have a basic pixel pattern tile over for the blocks you stand on. I'm new to actionscript, and this seems fairly complicated. Any help is appreciated!
Basically, this game creates it's blocks using code, not elements on the stage. I was hoping someone could tell me what additional code I could add so that I can create these elements from bitmaps.
PS: The completed source code from the tutorial can found here.

Playing a video with Flex, ActionScript 3.0 - no UI

I am currently trying to make a game on flex and one of the problems I ran in to is how to play a short animation at the beginning. I found plenty of examples on the web about how to may it from MXML and how to add UI - my goal is to just play it from an AS file with no UI (and, if possible, to embed it into the SWF).
I am quite new to flex so sorry if this question is stupid...
Thanks in advance for any help!!
For pure AS3 (you mentioned as3 file) you can use Video object -> check out examples here
For Flex you can utilize VideoDisplay control -> check out examples here
Both options are used only for display video and don't have playback controls.

easeljs Movieclip vs Sprite

i am new to easel js. When we convert a flash/AS3 project to an HTML5Canvas project using adobe flash cc, the animations and movieclips will become easeljs Movieclip. But in easeljs we can use Sprite to show animation. But using movieclip is easy since flash will generate it.
My question is whether is there any benefit of using easeljs Sprite instead of easeljs Movieclip in terms of performance?
Sprite and MovieClip are totally different in EaselJS.
In Flash, MovieClips extend Sprites, so they have similar functionality.
In EaselJS, a Sprite displays frames of a SpriteSheet, and a MovieClip is a content Container, which understands the concepts of frames, including timelines and frame actions.
MovieClips are generally only used with Flash CC output, although you can make them manually. Ideally, Flash could export Sprites and SpriteSheets as well when it makes sense - however because of the nature of Flash timeline animations, this would be incredibly difficult to determine when and how to export Sprites/SpriteSheets vs MovieClips.
Strictly speaking on performance, Sprites should be better performing because they use a single (or a few) bitmap(s) for all frames, which gets GPU benefits. Multiple, large images (which happens with different sprites, or just single sprites with lots of large frames that span across images) can actually cause performance issues when the GPU switches textures.
There is also a SpriteSheetBuilder class (and example) that you can refer to, which takes Flash CC output, and generates a run-time SpriteSheet, giving you the performance benefits of Sprites, with the complex vector/image output of Flash CC.
Hope that clears things up somewhat.

Can I use the effects made in Adobe After Effects in the game developed with Adobe Flash Pro and ActionScript 3? If so how?

I am developing a 2D game using Adobe Flash Pro CS 6 and ActionScript3. I am having some trouble in developing some effects e. g. bomb blast, particle effects etc. I want to know, whether I can use After Effects for those and then use them the game. Please suggest me.
There's no problem of using any graphics data from any program in Flash as long as flash can support the file format.
In case of After Effects graphics, you'll probably have to export them as a PNG file sequence, so they'll most probably be pretty large in file size.
To import:
You can either make a movie clip and just import the first image of a sequence with CRTL/CMD + R and Flash with be "smart" enough to suggest to load the other files of that sequence.
If you want, you can load them during run-time, add them to the array/vector, create a Bitmap object and change it's bitmapData property on enter frame/timer to animate it.
If you are decided on using the actual After Effects graphics rather than emulating them using an Actionscript 3 particle effect, I'd actually recommend exporting them as video on an alpha channel and then converting that to flv and then hosting them individually and streaming them in via Netstream and placing them on the proper layer via an addchild. If bandwidth isn't a huge concern here, this would be a good method for achieving this effect.
Here is some documentation on Netstream. http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d4e.html
If this seems like it might achieve the desired result, I can explain further if needed.

How to use starling with Flex, mixed MXML and Stage 3D AS3 code

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