My version of 3 State CheckBox

March 8, 2007

I was just looking at the compoenets on Mrinal’s FlexBox when I came across the 3 state checkbox by Alessandro Crugnola. It seemed a useful thing but what struck me was a bit different. This can be extended to a checkbox that can be used for a “Yes/No/Dont Know” Scenario, rather than having the initial state blank. So i edited Alessandro’s code and chnaged it to have 3 states. The 3 states are decided on the status of 2 flags – selected & cross

  • State 1- Undecided State (default) – selected & cross = false
  • State 2 – Crossed State – selected=false, cross=true – Shows the “NO” state
  • State 3 – Checked State – selected=true – Shows “YES” State

I know it could have been made better, but i just spent some 3 hrs on the component + the application below. Use the below Application to vote for my component. You can use the “View Source” to view and download the source of the application and the component.

Let me know what you think… Click this link to see the Application

I have observed that the View Source on the blogger page does not work. So go to the application and see the source


Juan’s collection of awesome Themes

March 7, 2007

All of you looking to make cool Flex apps, especially those eyeing the “Adobe Developer Olympiad” in India, take a look at the cool themes on Juan Sanchez’s Blog. My favourites are as follows

  1. Obsidian
  2. Mac OS X
  3. Napkin Skin
  4. Shadow
  5. Messenger

Download them here…


flexcursion – calling all FLEX enthusiasts

March 7, 2007

I just joined flexcursion.ning.com. It is a social network created by Juan Sanchez. Its motto is…

Meet fellow Flex 2 developers, check out some screen shots of other Flex 2 apps, get feedback on your Flex 2 projects and much more.

Be sure to tell other Flex enthusiasts.

I saw some big names in the FLEX Arena here, including Abdul Qabiz, Tariq Ahmed and Ted Patrick. Check it out…


Me on MXNA’s "Most Popular Posts in the Last Month" list

March 7, 2007

A couple of years back, if someone told me I would be working for Macromedia, I would have had a good laugh. Now 2 years down the line… I’m not only in Macromedia (now Adobe) but also working on this awesome technology called FLEX.

MXNA is Adobe’s (MXNA was started by Macromedia) news aggregator on its technologies. I was really surprised to see a post of mine, 5th on the most popular list of last month’s Flex Blog posts.

I felt like i was floating…

Click on the image to see a bigger image or go here

Error on adding FullScreenListener in creationComplete handler

March 6, 2007

This is an issue i hit upon while i was doing the Full Screen App (you can see it here). I wanted to add a listener to listen for the FullScreenEvent (package flash.events.FullScreenEvent) in my Application. So i put that onto my creationComplete handler on the Application, i.e.

mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” width=”100%” height=”100%” creationComplete=”initStuff()”

and

private function initStuff():void{
stage.addEventListener(FullScreenEvent.FULL_SCREEN, handleFullScreen);
}


But, this threw a real time error (RTE) saying…

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at JustFullScreen/::initStuff()
at JustFullScreen/_Application1_creationComplete()

The above error means that the “stage” object is null when it is trying to set the listener. What perplexes me is that if i put this addListener code in a later part of the application, it works. Which means that the stage is getting intitialized between the Application’s creationComplete and the place in the code where i’m calling it. Is this a bug or does the stage get initialized later, dispatching a different event? I’m still digging.

Addendum (half hour later): I observed now that including the SystemManager class (mx.managers.SystemManager) and then using the following code in the creationComplete handler works.

import mx.managers.SystemManager;

private function initStuff():void{
systemManager.stage.addEventListener(
FullScreenEvent.FULL_SCREEN, handleFullScreen);
}

So why is the systemManager object required if it is in the creationComplete handler and not if it is in a later part of the code… I’m confused now!!! Gotta tread back to the Flex Gurus :)
The code is here…

Addendum again (the next day)Thanks Joan for the info. Thanks to her, i found the solution for the above problem…

It seems that the stage is available only after the updateComplete or applicationComplete Events. Read the post that demystified things for me…


My Full Screen Video App – Ver 1.0

March 6, 2007

I wrote about full screen support in flash, a long time back in Nov ’06 (see that post here). I have been planning to write one myself. So finally i got myself down to write it. Before i put you through the app, some details on the API.

To make your application have a fullscreen support you need to do the following things.

1) Have the latest Flash Player (get it here)

2) Use the new Full Screen API
import flash.display.StageDisplayState into your Application and set the displayState of the stage. I have the following function toggling the FullScreen feature. “fsChk” is a CheckBox, based on which I’m toggling the functionality

private function toggleFullScreen():void{

stage.addEventListener(FullScreenEvent.FULL_SCREEN, handleFullScreen);


if(fsChk.selected) {
stage.displayState = StageDisplayState.FULL_SCREEN}
else {
stage.displayState = StageDisplayState.NORMAL}

}


3) Update the html-template in which you have the flash App

In the object & embed parts of the html code of the page in which the flash app is inserted, you need to add a new parameter allowFullScreen to true. You can refer the source of the app and view the html for details.

If you want to know more about this feature, refer the Adobe DevCenter article on the same or view the PDF that i have created, collating all that information.

Now the Application. This is just a small video player which can go full screen by checking a Flex CheckBox. This is written in Flex2.0 and you can find all the source files here

Click here to view the Application
(confirm that you have the latest Flash player)

P.S – I have muted the video to start with, un-mute it if it pleases you :)

Update March 07 2008: A lot of people have complained that they got a security error when they tried using the code above. Here is a post articulating the problem and the solution.


Follow

Get every new post delivered to your Inbox.