Samsung Smart TV Development with HaXe and MVC

haxemvc

Next step with my project was to implement MVC framework. The most popular one called mmvc provided by massive interactive seemed a bit broken when used with HaXe 3 RC, but as all those sources are available, I managed to do some small updates in order to compile it without errors. Normaly you would just install the mmvc library using haxelib and the install process grabs the necessary dependencies like msignal, minject, mcover, mcore… But in order to fix HaXe 3 issues, I decided to just download it into my projects src folder.

Read the rest of this entry »

Flex Arc Preloader Without SparkDownloadProgressBar

There is a lot of flex preloader tutorials all over the internet. If you take a closer look at each, you may notice those all extends DownloadProgressBar or SparkDownloadProgressBar classes. You may decide that these classes do not fit your needs, and it that case you can extend regular Sprite with IPreloaderDisplay implementation. Soon you realize there is some other Preloader in use, that communicates with your custom one through events. Following example contains a preloader implementation that renders a filled arc based on application load progress and RSL load progress. Lets have a look how to handle it properly.

Read the rest of this entry »

A Sound In Image Experiment

There are some usefull apis since Flash Player 10, I have never been playing with. Yesterday, I realized one experiment with Sound + SampleDataEvent and created quick demo for converting music into a bitmap and vice versa.

There is a Sound.extract() method in ActionScript allowing you to grab raw sound data from a sound object. It provides you ByteArray of 32-bit floating-point values, which can be converted to a Number using ByteArray.readFloat(). The resulting values are -1 < value < 1...

Read the rest of this entry »

SequenceParser – Simple yet Mighty

With my latest approach to create universal parser, I came up with something simple yet mighty. SequenceParser is a simple (30 lines) class that crawles any source and matches specified list of highly customizable ISequences. While each sequence can contain list of nester sequences, you are able to parse any type of source with nested conditions and sequences. A good example can be an attribute inside a xml node, a xml node inside a xml node, an escape character inside quotas etc.

I have also created some example sequences like MatchAnything, MatchRegexp, MatchString, StartRegexpEndRegexp, StartRegexpEndString, StartStringEndString that should help to cover almost any possible parsing scenario. These sequences notifies back via callback containing parsed string, that is vital for further bulding additional logic like highlightning, validation over parsed phrases.

Read the rest of this entry »

Quick Tip: OSMF VideoPlayer Screenshot

Your video is usualy resized and played in a custom sized rectangle, but if you need to capture the fullscreen screenshot you may be tempted to gather the original size screenshot by resizing the whole component or its part. Its not the best practice, while you need to resize and move back and forth the component etc. Here is a quick tip to make a fullsize screenshot from spark osmf based VideoPlayer using Matrix.

Read the rest of this entry »

ActionScript 3 Date

Did anyone alse than me wondered about Date.toString() output format in AS3? I mean what standard is it? It looks like something that adobe created for flash purpose and is not used anywhere else(?). According to the documentation AS3 output format for date is.

Day Mon Date HH:MM:SS TZD YYYY
Fri Sep 2 14:49:30 GMT+0200 2011

Read the rest of this entry »

Layout For A Table

There are some hidden treasures deep in flex framework, you just have to dig for. Yesterday I hit by coincidence ConstraintLayout. Its a part of 4.5 SDK and is a nice layout for defining rows and columns for a table. Once columns and rows are created, your elements are not automaticaly aligned into a block, but rather any element can refer to any column/row using correct formula in style attributes. E.g. forumla left=”{columnId}:{value}” will attach your element into position of a column and offsetting it by some value. This layout also easily let you merge cells or rows etc.

Read the rest of this entry »

What was first: the chicken or the egg?

Here is a little experiment (that was hanging in my drafts for some months already) with static method, static code block, [Mixin] and class constructor. Can you guess correct order of trace()s dispatched by using the following Item class? Notice [Mixin] will only be understood and init() called with flex application.

Read the rest of this entry »

SWZ, RSL and Flexmojos Build Setup

With default Flexmojo build setup your clients may easily fall into .swz load issue. Why clients? Because you already have .swz files cached in your player but they dont. Sure, you can turn off caching easily. The issue is textLayout and osmf uses a different version numbering and .swz location than the rest of the flex sdk .swzs. The exception by flex application may look something like this:

Error #2032: Stream Error. URL: http://fpdownload.adobe.com/pub/swz/flex/4.1.0.16076/textLayout_4.1.0.16076.swz
Error #2032: Stream Error. URL: http://fpdownload.adobe.com/pub/swz/flex/4.1.0.16076/osmf_4.1.0.16076.swz

Read the rest of this entry »

Getting hands dirty with molehill

Few weeks ago I played with molehill and Away3D engine. Creating 3D scene is straightforward with an engine, but I still wanted to get deeper inside and understand the low level api and agal. So I took another approach and created pure molehill version of 3ddm. Soon I realized that I have been already familiar with some procedures from drawTriangles version so I could easily use algorithm for defining vertices, indices and uv.

Read the rest of this entry »