NTS: Stupid Simple Select Single (Toggle Button) – Flex

December 21st, 2011

This is Note To Self.
I needed to create a multi-button selection in Flex. It was to be tiled so ButtonBar wouldn’t work (even though apparently tiling ButtonBar works). But then, each button needed its own separate and very unique skin. So, ButtonBar just didn’t work.

Keith Peters has a great walk through of his thinking behind refactoring code for something similar.

Here is what I came up with:

Stupid WordPress. See it working here.

It’s pretty simple. I just listen for a click on the group, cycle through the child elements to turn them all off, then select the one I want.

Here’s full source:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
			   xmlns:s="library://ns.adobe.com/flex/spark"
			   xmlns:mx="library://ns.adobe.com/flex/mx"
			   minWidth="400" minHeight="300" frameRate="60" viewSourceURL="srcview/index.html">

	<fx:Script>
		<![CDATA[
			protected function groupButtonsClickHandler(event:MouseEvent):void
			{
				if(event.target.id == "groupButtons") return;
				var element:Object;
				for(var elementNumber:int = 0; elementNumber < groupButtons.numElements; elementNumber++)
				{
					element = groupButtons.getElementAt(elementNumber);
					element.selected = false;
				}
				event.target.selected = true;
			}
		]]>
	</fx:Script>

	<fx:Declarations>
		<!-- Place non-visual elements (e.g., services, value objects) here -->
	</fx:Declarations>

	<s:TileGroup id="groupButtons"
				 horizontalGap="20"
				 verticalGap="20"
				 verticalCenter="0"
				 horizontalCenter="0"
				 orientation="rows"
				 requestedColumnCount="2"
				 click="groupButtonsClickHandler(event)">

		<s:ToggleButton width="89" height="52"
						label="One"
						selected="true"/>
		<s:ToggleButton width="89" height="52"
						 label="Two"/>
		<s:ToggleButton width="89" height="52"
						label="Three"/>
		<s:ToggleButton width="89" height="52"
						label="Four"/>

	</s:TileGroup>

</s:Application>
categories: Uncategorized | no comments »

NTS: AIR 3 Captive Runtime Packaging for Desktop

November 16th, 2011

Note to Self:

There is a particular order to enter arguments in ADT for packaging AIR 3 apps with Captive Runtime (on MAC so far).

adt -package SIGNING_OPTIONS -target bundle <output-package> <app-desc> <input-package> <optional>

Signing options MUST go after -package before -target. I was getting errors any other way.

categories: Uncategorized | no comments »

NTS: StageVideo on iOS with AIR 3 (so far)

October 25th, 2011

I’ve been working on an app with a bunch of video in it. It’s for work so I can’t really share too many details. This is more of a “note-to-self” (NTS) kind of post so I can remember this info later.

When wanting to use StageVideo with AIR 3 on iOS there are a few things to remember:

Continue reading »

categories: Uncategorized | 8 comments »

Flash Pro CS5.5 Mobile (Android/iOS) – Part 3: Project 3 MultiTouch/Gesture Object Manipulation

September 14th, 2011

In October I will be holding a Bring Your Own Device Lab at Adobe’s MAX event. The hands-on labs will be on Flash Pro CS5.5 for Mobile (Android and iOS). This is the third part of a series of posts that are the projects I will be covering in this lab, taken directly from my Workbook. Of course, if you don’t actually attend MAX, and my session, you won’t be able to get the full awesomeness of personal, hands-on training.

This project is designed to be followed along with the example project files. If you haven’t already you can download all of the files needed for these example projects here.

If you have not yet, read through the Part 1: Intro and Hello World and Part 2: Accelerometer and Debugging.

Continue reading »

categories: Uncategorized | no comments »

Flash Pro CS5.5 Mobile (Android/iOS) – Part 2: Project 2 Accelerometer and Debugging

September 8th, 2011

In October I will be holding a Bring Your Own Device Lab at Adobe’s MAX event. The hands-on labs will be on Flash Pro CS5.5 for Mobile (Android and iOS). This is the second part of a series of posts that are the projects I will be covering in this lab, taken directly from my Workbook. Of course, if you don’t actually attend MAX, and my session, you won’t be able to get the full awesomeness of personal, hands-on training.

This project is designed to be followed along with the example project files. If you haven’t already you can download all of the files needed for these example projects here.

If you have not yet, read through the Part 1: Intro and Hello World to learn the first steps of building apps with Flash Pro CS5.5. Hardware and software requirements are listed there.
Continue reading »

categories: Uncategorized | no comments »

Flash Pro CS5.5 Mobile – Part 1: Intro and Project 1 Hello World

September 1st, 2011

In October I will be holding a Bring Your Own Device Lab at Adobe’s MAX event. The hands-on labs will be on Flash Pro CS5.5 for Mobile (Android and iOS). The following series of posts are the projects I will be covering in this lab taken directly from my Workbook. Of course, if you don’t actually attend MAX, and my session, you won’t be able to get the full awesomeness of personal, hands-on training.

Continue reading »

categories: Uncategorized | no comments »

An In-depth Look: Flash Pro’s AIR Mobile Publish Settings

August 26th, 2011

The AIR Publish Settings dialog can be a bit to bear. There is a ton of different settings and information. Let’s take a look at each tab individually.
Continue reading »

categories: Uncategorized | no comments »

Flex Mobile: Skinning ActionBar and Handwritting FXG in Flash Builder

August 2nd, 2011

SEE IT IN HD: Flex Mobile: Skinning ActionBar and Handwritting FXG in Flash Builder.

 

 
(This video is silent, no audio.)

Sometimes it’s easier to hand write an FXG than it is to open Fireworks/Illustrator.

It’s actually pretty simple to skin an ActionBar in Flex mobile.

Here is how to do both.

categories: Uncategorized | no comments »

AIR Apps on iOS and Android (List)

July 1st, 2011

Below is a list (not comprehensive, by any means) of some iOS and Android applications built with AIR (and in no particular order). I’ll try to keep this running as much as I can. Feel free to add yours, or one you like, in the comments.

Continue reading »

categories: Uncategorized | 23 comments »

Designer: Don’t Be a Jerk (Walmart Version)

June 29th, 2011

The clean version so Ben can Retweet it. ;)

 

Continue reading »

categories: Uncategorized | no comments »