Facebook SSO For Flash & Mobile AIR Apps

facebooksso

This implementation is taken from TrainLord as it runs on web (flash), android and iOS (AIR) platforms. Facebook’s authentication flows are based on the OAuth 2.0 protocol. Its recommended you have general undesrtanding of OAuth protocol prior reading this article.

If you run services on your own backend (like TrainLord does), the main point of whole thing is to securely pair a facebook id and user session. So later, whenever user does a request to your backend it automatically recoginzes the facebook id. In my case I used id and name to create an unique user record in my database so I can save some more user related data (score, etc.).

Read the rest of this entry »

YCanvasMaps

ycanvasmaps

6 months before today I released and open sourced YCanvas library. Since it powers some of my projects nicely (onBoard, Train Lord), some of you requested me to create map implementation as well as Feathers UI component so you can easily integrate it into your own projects. I have decided to take this challenge and wrapped the original library by some more specific functionality. It took me some time, but finally, the extended library is out and ready to be used in any flash, AIR or mobile project.

Read the rest of this entry »

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 »