Something else I've been meaning to post... I recently have started experimenting with creating Android apps in Flash builder (burrito) so I'm going to post some of the tests and hopefully final version of an app i've been working on here soon.
I've been testing my apps on my HTC desire which I've had for about 6 months now, i really like it although I would really like an upgrade to the Nexus S if anyone fancies buying me one. Picture of my Desire running Android 2.3(gingerbread)[Oxygen]
HTC Desire + Flash Builder burrito
Nike Plus + Flex 4 + Robotlegs
I should have posted this ages ago. Still better late then never. In October I was playing with robotlegs, anyhow this is what i created:
This is a Nike plus client that will display all the publicly available information from your account. This is just the run information. You need to know your NikePlus ID. By default the application has my NikePlus ID pre-populated.
Click on the screen shots below to find more information or view the running application here. You can download the source directly here or using the context menu in the running application.
Robot legs is the best framework!
I recently attended Flex and the city; I was most excited to hear Richard Lord’s talk about frameworks. As I have been experimenting with Flex 4 (Flash Builder) and looking to move away from the cairngorm framework 2 as it is no longer developed and it has been superseded by cairngorm 3. Which is more designed to complement another framework and isn’t one itself. I’ve looked into various frameworks and was recommended by a friend to use experiment with robot legs.
Although he Richard didn’t say what framework was the best (for many reasons or although the most important was on the type of project). He did surmise that robot legs fitted the requirements of the majority of projects, and he seemed to highly recommend it!
You can view his slides here
I much preferred the 2nd Flash camp meet up in London then the 1st one as it was aimed at Flex developers rather than Flash. Although it would have been useful for Flash developers to attend as well.
Finally got some good freebies at the event! Thanks Adobe
I’ll post my experiments with robot legs here and hopefully it will help other learn the framework.
Posters for a good cause!
Creating custom components library (swc)
So you have created your custom components and you want to use them in multiply projects, you could add the source to every project, or you could create a swc. A swc is a compiled collection of classes.
Click to view the previous example with the custom component compiled into a swc.
Example
Source
You can easily create a swc from within Adobe Flex builder; simply create a new Flex library project. The example used above to build the swc can be found here.
Source
Custom components with CSS attributes
package indecentmonkey.controls
{
import flash.events.Event;
import mx.controls.TextInput;
import mx.styles.CSSStyleDeclaration;
import mx.styles.StyleManager;
/**
* Colour of the outline of changed text
*
* @default 0x03ce02
*/
[Style(name="itemConfigChanged", type="uint", format="Color", inherit="no")]
/**
* Colour of the outline of unchanged text
*
* @default 0xb7babc
*/
[Style(name="itemConfigDefault", type="uint", format="Color", inherit="no")]
public class TextInputColour extends TextInput
{
public function TextInputColour() {
addEventListener(Event.CHANGE,handleColour);
}
/**
* @private
*
* We initialize the default styles for outline and fill styles by calling
* initStyles() when the component is instantiated.
*/
private static var stylesInitialised:Boolean = initStyles();
/**
* @private
*
* The default styes are defined here.
*/
private static function initStyles():Boolean {
var sd:CSSStyleDeclaration = StyleManager.getStyleDeclaration("TextInputColour");
if (!sd) {
sd = new CSSStyleDeclaration();
StyleManager.setStyleDeclaration("TextInputColour", sd, false);
}
sd.defaultFactory = function():void {
this.itemConfigChanged = 0x03ce02;
this.itemConfigDefault = 0xb7babc;
}
return true;
}
/**
* string to hold set text
*/
private var _setText:String = "";
/**
* Handles initialization of this component.
*/
override public function initialize():void {
super.initialize();
}
override public function set text(value:String):void {
super.text = value;
_setText = value;
handleColour(new Event(Event.CHANGE));
}
private function handleColour(e:Event):void {
if ( _setText == text ) {
setStyle("borderColor",getStyle("itemConfigDefault"));
}
else {
setStyle("borderColor",getStyle("itemConfigChanged"));
}
}
}
}
example
viewsource
Logging panel
package indecentmonkey.logging
{
import mx.controls.TextArea;
import mx.core.mx_internal;
import mx.logging.targets.LineFormattedTarget;
use namespace mx_internal;
public class LogPanelTarget extends LineFormattedTarget {
private var _loggingTA:TextArea;
public function LogPanelTarget(console:TextArea) {
super();
this._loggingTA = console;
}
override mx_internal function internalLog(message:String):void {
this._loggingTA.text += message + "\n";
}
}
}