Archive for the ‘ActionScript’ Category

Add conditional links to text labels in Flex

Posted on: December 7th, 2010 |

Adobe Flex icon

On a recent project the client wanted the functionality to have some text labels turn into active links when certain conditions occurred and the rest of the time for them to have no active link. The code is pretty straight forward for doing this, for example you could do.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
protected function checkCondition():void
{
    if ( some_condition_is_true )
    {
        somelabel.buttonmode = true;
        somelabel.addEventListener(MouseEvent.CLICK, handleClick);
    }
    else
    {
        somelabel.buttonmode = false;
        somelabel.removeEventListener(MouseEvent.CLICK, handleClick);
    }
}
 
protected function handleClick(e:MouseEvent):void
{
    // Do something because they clicked on the text label
}

And here is a video of the process with a complete explanation

(more…)

Adobe Flex – Convert a number into hours and minutes

Posted on: October 22nd, 2010 |

Adobe Flex icon

Adobe Flex – Convert a number into hours and minutes

I have a need to convert a number to hours and minutes. I thought it would be simple, I was wrong. The Flex framework offered no direct solution and after searching the web I found other peoples solutions to be overly complicated and code heavy.

After a few hours of thinking and lots of failures I devised this method, now I have to warn you that I only needed this to work for a maximum of 24 hours and therefore anything over 1440 minutes you will need additional checking and processing to convert to days, hours and minutes. However I hope this helps put you on the right path.

YouTube Preview Image

Follow @uibuzz on twitter to be notified when new content hits the site or to interact with us.

Adobe AIR – Get and set the application window size with ActionScript

Posted on: October 2nd, 2010 |

Adobe AIR icon

Adobe AIR – Get and set the application window size with ActionScript

There comes a time when you either need to access the width and height of an Adobe AIR application window or set it ( think cool resize animation maybe! ). Well it is pretty straight forward, let me show you how with ActionScript.

YouTube Preview Image

Follow @uibuzz on twitter to be notified when new content hits the site.

Adobe AIR – Detect operating system and platform

Posted on: September 23rd, 2010 |

Adobe AIR icon

Adobe AIR – Detect operating system and platform

When creating Adobe AIR applications there may come a time that you need to detect which platform or operating system the user is running. An example would be putting an icon on the OS-X or Windows system tray, clearly these are specific to their respective platforms. With one simple line of code we can detect the platform and operating system, I’ll show you how.

YouTube Preview Image

Follow @uibuzz on twitter to be notified when new content hits the site.