360 Flex - Day 2 (Monday Afternoon) - Live Blogging

360flex_6_robot.png

Obey: Building a Rules Engine with AS3 and the Hamcrest API – Drew McClean & RJ Owen

360flex_7_rules.png

How are rules defined and implemented?

Rules Engine Anatomy: Facts → Rules [Conditions=>Actions] → Output

Battery is down!

Flex + Phidgets = Beer – Kevin Hoyt

Kevin’s presentation was how to drive a phidgets board to control dispensing beer to users with an rfid, taking a picture along the way and counting the numbers of beers that user had so far. The board is driven from a Flex application. It was really impressive presentation.

Intro to Flex Typography – Matt Guest

  • Flash Text Engine
  • Text Layout Framework

Posted by Daniel Wanja Tue, 09 Mar 2010 00:03:10 GMT


360 Flex - Day 2 (Monday Morning) - Live Blogging


360flex_1_ebay.png

360flex_2_ebay.png

Actually today is the first day of the conference. Yesterday was a tutorial day which was really fun. Today there will be a bunch of 1h20m sessions throughout the day. The conference is at the ebay headquarters.

360flex_3_keynote.png

I was with three other guys from Denver and we nearly missed the start of the keynote as we took the light rail in the wrong direction. How can 4 engineers go so wrong? :-) Anyhow it doesn’t seem we missed to much as it’s starting with a talk from the sponsor (ebay/paypal) about the eBay developer program.

Keynote

Now onto the main keynote by Deepa Subramaniam on the Adobe Flash Platform for her first keynote given ever. She is the new Product Manager of the Flex SDK.

  • The Flex 4 release is coming really soon.
  • Overview of Flex 4
  • Demo of spark components
  • Data-Centric Development
  • Video from the Flex team (geek funny)
360flex_4_ Deepa.png

It’s great that Deepa become the project manager of Flex 4, she understand what’s programming is about. She now continues her talk on the Open Screen project.

Developing multi-screen applications (phone .vs. desktop…)

Cross screen challenges/Cross device challenges

  • Screen size
  • Input mechanisms
  • Performance
  • Context/use case changes
  • Screen size, orientation

Flex can help – Slider (Mobile Flex Framework)

  • Deliver top quality experience
  • Across multiple platforms
  • Within performance constraints

The Slider team is hard a work and hope to have a preview available this year :-(… I want it earlier!

Growing Flex Ecosystem:

  • Functional Testing Tools
  • Performance and Load Test Tools
  • Flex Components
  • Frameworks
  • AMF servers
  • Tooling Extensions
  • Licensing+Encryption
  • Security Testing

All data visualization components now available in the free open-source Flex SDK!

Cool John is saying that they are recording the videos of each session.

Appocalypse Soon? The remaking of ‘Flex Components’ – Michael Labriola

It’s full house for Michael’s talk. I’m not sure how much live blogging I should do has they are video tapping each session.

This session is part of his continuing quest to teach Flex from the inside out. To learn about the Flash Player and the Flex framework.

Going to derive the Flex framework. Implement a custom component.

  • Flex 3 and Flex 4 components both descend from UIComponents

Michael is not explain how the code execution is managed by the Flash Player and executed during a frame.

  • All the basic Flex 3 methods also apply to Flex 4.
  • Flex 3: A base class and then a descendent class for each Layout. Problem i.e. verticalScrollPolicy=“off” to avoid unwanted scrollbars.
  • Flex 4: doesn’t derive layout behavior but can assemble it. Frame (Horizontal, Vertical, Diagonal). So the visuals don’t exist inside of the class.
  • Flex 4 are based on two separate pieces: the form and the function.
  • Separating these pieces favors composition over inheritance. By separating these we gain and we loose…
  • Gain: have one set of functionality look many different ways
  • Loose: a lot of dead weight and lots of extra classes
  • Two type of components: Controls and Containers
  • Flex 4: two types of things… those that can be skinned and those that cannot
  • Groups are the base type of container
  • Groups don’t have visual identify
  • BasicLayout, HorizontalLayout, VerticalLayout, TileLayout

New Hierarchy:

UIComponent
	SkinnalbeComponent
	SkinnableContainerBase
		SkinnableContainer
			Applicaiton
			Panel
			Window
		SkinnableDataContainer
  • Skins are classes defined in MXML
  • Applied to components using the skinClass or by CSS
  • Components: declare skin parts and declare skin states

Skins: specify a HostComponent

<fx:Metadata>
   [HostComponent("spark.components.Button")]
</fx:Metadata>

Declare states

   <s:states>
	<s:State name="up" />
	<s:State name="over" />
   </s:states>
  • How it all works: components need to size themselves, need to be created at runtime, need to interact with parents and children
  • Instanciation: all Flex components start with a constructors. Constructors in Flex add event listeners and setup initial properties…That’s it.
  • Display List: list of all the components that are on the screen at one point or another
  • Creating children: all visual children of a component are created in the createChildren method. The visual children of a component exists in the skin and so the skin is first created at this time.
  • Skin Methods: attachSkin, detachSkin, partAdded, partRemoved
  • Sizing: each component implements the measure() method. Flex works on the principle that children must be sized before their parent and it makes the sizing process potentially asynchronous. It works via a priority queue. Priority based on nest level.
  • Flex 4: children leave inside a skin and not the parent. The skin is a component, so we ask it the size of it’s children.
  • Measured Data: measure is only a suggestion.
  • Sizing: parents size children. A component does not size itself.
  • Sizing and Positioning: sizing and positioning is done in a method called updateDisplayList().
  • UDL: components are given a size. One the size is given, the component is free to do what is wishes. For the most part, this information is simply passed down to the skin. Again recursion.

This was a great talk and clarifies many things which is great timing as I’m starting to dive deeper into Flex 4.

To be continued…

Posted by Daniel Wanja Mon, 08 Mar 2010 19:16:15 GMT


360 Flex - Day 1 (Sunday) - Live Blogging

We just had a great breakfast at Peggy Sue’s Dinner…and moved over to the Ebay Headquarters where the conferences is about to start.

I’ll be taking notes during the day and updating this page as we go one.

UPDATE: Now that I typed all that I realized that Justin put up the slides and code on his blog: http://blog.classsoftware.com/.

Connecting Arduino Hardware to Flex: Justin Mclean

twitter: justinmclean
Justin is from Sydney, Australia.

Content:

  • Arduino platform, how to program and how to connect to Flex
  • 2/3 Arduino 1/3 Flex
  • Hands on

So we’ll go through the followings:

  • Digital Inputs
  • Digital Outputs
  • Analogue Inputs
  • Pulse Width Modulation
  • Serial Communication
  • Connecting to Flex
  • Review and wrap up

So Justin gave each attendee one board and a set of components. The board is open source hardware. I think that’s pretty cool. Feels like the hardware kit I bought for my 6 years son. The board is $25 and with all the components it’s about $40.

arduino.png

The hardware is provided to all participants by sparkfun.com

Software

http://arduino.cc/en/Main/Software

arduino_software.png

Also install the serial driver: FTDIUSBSerialDriver_10_4_10_5_10_6

Other Hardwares

  • ATmega micro-controller from Atmel. It mostly runs in cars.
  • Arduino Duemilanove
  • Arduino Pro and Pro mini
  • Lyllypad (warable)
  • Funnell IO
  • Mega
  • Many others

ATMega328

  • Hight performance low power RISC
  • 16 Mzh up to 16 mips (faster as your first pc you owned – if you are a bit older)
  • 32K of Memory
  • SPI and 2 wire serial interfaces
  • External interrupts, timers, pulse width modulation

IDE

  • IDE open sourcee and cross platform.
  • Based on the Processing language
  • Many open source sketches (projects) and libraries availables. Ethernet library, servers, …

First Program

int ledPin =  13;    // LED connected to digital pin 13

// The setup() method runs once, when the sketch starts
void setup()   {                
  // initialize the digital pin as an output:
  pinMode(ledPin, OUTPUT);     
}

// the loop() method runs over and over again,
// as long as the Arduino has power

void loop()                     
{
  digitalWrite(ledPin, HIGH);   // set the LED on
  delay(1000);                  // wait for a second
  digitalWrite(ledPin, LOW);    // set the LED off
  delay(1000);                  // wait for a second
}

Now this will make the led blink:

Programming

  • C like language based o wiring
  • Write code and compile in IDE
  • Upload compiled code using USB
  • Hard to debug

Circuit Basics

  • Ground and power
  • Potential difference required for current ot flow
  • Conductors and resistors

Digital Inputs/Outputs

  • Digital pins on Arduino are dual purpose
  • Digital logic and voltage on = 5V off = 0V
  • Can be set to be input or output via pinMode

Variables

  • boolean, char, byte, int, long, float, double, string and array
  • int 16 bits, long 32 bits, float 32 bits
  • Strings are nul terminated ‘\0’
  • Declare by ; eg int i;

It’s actually C++…What?! At a Flex conferences :-)

Setup Function

  • Used for initialization
  • Run when program loaded or board reset
  • Best place to place calls to pinMode

LEDs

  • Current will only flow in one direction
  • Longest pin connect to positive side, shortest to ground
  • Dont’ connect directly to power source use in series with resistors
leds.png

Resistors

  • Resistors limit current flowing through them
  • Value and tolerance indicated by cooler bands
  • Resistor values for LEDs
  • For RGB or LEG digits you need multiple resitors
  • REG/GREEN/BLUE 180 oms, WHITE/ULTRAVIOLET 100 oms
resistors.png

Debugging ia Serial Port

  • Use Serial.begin to set speed
  • Serial.print, Serial.println to output
  • Use serial monitor in IDE to view

Blinking LED

Same program that the first program but this time we just set the led to the pin 3 which is connected to the board.

Digital Inputs

  • Some logic as inputs; hight 95V0 or low (0V)
  • Simplest digital input switch
  • Call pinMode to set as digital input as input

Connect Switch

  • Wire up push button on breadboard
  • Change code to turn light on/off

Now switches have three states (on, off, and in between) to the board needs to be wired to take that into account so you can program it accordingly. We added a very high resistence (10k) next to switch to ensure that the switch reports 0V when not clicked.

int led = 3;
int button = 4;

void setup() {
  Serial.begin(9600);
  pinMode(led, OUTPUT);
  pinMode(button, INPUT);
}

void loop() {
  if (digitalRead(button) == HIGH)  {  
    Serial.println("on"); 
    digitalWrite(led, HIGH);    
  } else {
    Serial.println("off"); 
    digitalWrite(led, LOW);  
  }
}  

So let’s look at the wiring and how the switch operates:

Internal Pullup Resistors

  • Set mode to input
  • digitalWrite to HIGHT to turn on
  • digitalWrite to LOW to turn off

So there is something like the 10K resistor built-in the board to avoid using an extra resistor on the board to make sure the switch values are on or off.

Switch Issues

  • Switches can bounce and give and off values while switching
  • Noise can give false results
  • More a problem when switching needs to be counted
  • Use timer to solve issue (time = millis())

Analog Inputs & Potentiometer

  • Can read values via analogRead
  • Result is in range 0 to 1023 (10 bits)
  • Potentiometer is Variable resistor
  • Eg Read potentiometer values with Analog Inputs
int led = 3;
int pot = 0;

void setup() {
  Serial.begin(9600);
  pinMode(led, OUTPUT);
}

void loop() {
    int value = analogRead(pot);
    digitalWrite(led, HIGH);    
    // Set delay based on analog input
    delay(value);
    digitalWrite(led, LOW);  
    delay(value);
}  

So now when the potentiometer is turned to the right a value of 1023 is returned and the lights blinks on and off for about 1 seconds. Turning to the left makes the delay shorted (down to 0) and you can get it to run blink really fast.

potentiometer.png

LDR

  • Light dependent resistor (high resistance)
  • Set flash rate based on value of LDR

This is a great full day tutorial and everyone seems to have fun. It’s pretty basic, but it’s the first time I program hardware.

Now we are writing fadeIn and fadeOut functions and get the light to pulse on and off

void fadeIn(int led) {
  for (int i=0; i<256; i++) {
    analogWrite(led, i);
    delayMicroseconds(5000);
  }
}

void fadeOut(int led) {
  for (int i=255; i >= 0; i--) {
    analogWrite(led, i);
    delayMicroseconds(5000);
  }
}

void loop() {
    fadeIn(led);    
    fadeOut(led);  
}  

Now we replace the light sensor by a temperature sensor. There are also air quality sensors, breathalyzers.

Flex

Communication between Flex and Arduinos.

  • Software on Arduino (Firmata)
  • USB serial to socket proxy
  • Flex event based library to talk to socket (as3Glue)

Firmata is an Arduino library that support a binary protocol over serial interface. It’s Bi-directiona. Use version 2.

In the Arduino IDE let’s load the StandardFirmata program (File|Examples|Firmata|StandardFirmata). It’s a 286 lines program similar to the code we wrote so far, but more complex.

Server Proxy

From http://arduino.cc/en/Main/Software the server proxy (end of page)

To configure proxy first find what your serial device is.
In terminal do: ls /dev/cu*

/dev/cu.Bluetooth-Modem
/dev/cu.Bluetooth-PDA-Sync
/dev/cu.usbserial-A600ailA

Then add this line to your serproxy.cfg:
serial_device=/dev/cu.usbserial-A600ailA

Then we just start the server proxy:
$ ./serproxy
Serproxy – ©1999 Stefano Busti, ©2005 David A. Mellis – Waiting for clients

Now in Flex you need to add the as3glue code (http://code.google.com/p/as3glue/) then you can drive arduino as follows:

private var arduino:Arduino = new Arduino();

private function init():void {
	arduino.addEventListener(ArduinoEvent.FIRMWARE_VERSION, turnLedOn);			
}

private function turnLedOn(event:ArduinoEvent):void {
	arduino.setPinMode(13, Arduino.OUTPUT);
	arduino.writeDigitalPin(13, Arduino.HIGH);
}

A qik look at the class room in the middle of coding their Flex app to drive their Arduino device:

Now we are going to write some Flex code to have some buttons that turn on/off some functions of the board.

private var arduino:Arduino = new Arduino();
private const pin:int = 3;
private const button:int = 4;


private function arduinoInit(event:Event):void {
	arduino.enableDigitalPinReporting();
	arduino.setPinMode(pin, Arduino.OUTPUT);
	arduino.setPinMode(button, Arduino.INPUT);
	
	arduino.addEventListener(ArduinoEvent.DIGITAL_DATA, buttonChanged);
}

private function buttonChanged(event:ArduinoEvent):void {
	if (event.pin==button) {
		event.value == Arduino.HIGH ? turnOn() : turnOff();
	}
}

private function turnOn():void {
	arduino.writeDigitalPin(pin, Arduino.HIGH);
}

private function turnOff():void {
	arduino.writeDigitalPin(pin, Arduino.LOW);
}

Thanks Justin, great talk!

Posted by Daniel Wanja Sun, 07 Mar 2010 23:17:00 GMT


vault.ncaa.com : under the hood of a cool Flex project.

vault.png

Thought Equity Motion and NCAA two days ago officially released the Ncaa Vault. A cool Flex app backed by an incredible video database with awesome metedata about each game…and released just in time for March Madness.

Here are a few of the announcements and online articles describing the services:

In fact with the Vault you can have a URL right into a specific moment of any game and Wired picked out a great last second tying shot.

The twittersphere feedback is also pretty impressive.

This is the most visible Flex app I worked on :-) Late January Cameron Pope contacted me to ask if I could help on a Flex project for NCAA and Thought Equity. The funny part is that I didn’t know that Cameron was such a great Flex developer, I met him via the Denver Ruby on Rails User Group (derailed) and I also didn’t know what NCAA was (don’t shoot, I didn’t grow up in the US and we don’t have TV). So when I asked my father in law about NCAA and realized it was about Basketball I was intrigued by what type of application we needed to build. Cameron showed me the mockups built by Donny Wells which is just an awesome graphical designer. These mockups where just incredible and then I was presented the video service technology the Thought Equity Motion team put together, and I was just blown away and though that this would be a cool project to work on.

Cameron was the main Flex developer and I just worked part time on Monday’s on this project. If you need and incredible Flex developer just contact Cameron.

Now let’s dive more into the Flex nitty-gritty details:

For the mvc architecture we used the Swiz Framework and this turned out to work exceptionally well. Swiz sports some dependency injection features that can be enabled via the [Autowire] tag and I was surprised when I realized I could also just use that feature in an item render. Let’s look at a little detail…For the play by play timeline if a play is in the future it is displayed in bold:

timeline.png

So each line of the timelime is rendered by the TimeLineItemRender and you can just autowire the model which contains the playhead position.

      [Autowire]
      [Bindable]
      public var vaultModel:Vault;

The we can set the style name accordingly based on the play’s start time and the current playhead position:

   styleName="{data.startTime < vaultModel.playheadPosition ? 'past' : 'future'}" 

The style of the application was created by the designer and Cameron did a great job reproducing it using Degrapha for skinning () using an approach similar to this example (example source)

Most of my work was around the searching, bug fixing and general architecture overview. We took a similar approach to the one I described here in order to avoid most of the server round trips during searching.

The Flex app is just a pretty face, behind the scene Thought Equity provides an incredible services that they will expose in many ways, the start can be seen here and all that data will be able to be accessed via API and other means.

This was a short but incredible project for me, the guys at Though Equity have such an incredible vision on how to turn these sport videos into something so much bigger! Thank you guys for getting me on board.

thoughtequity.png

Enjoy!
Daniel Wanja

Posted by Daniel Wanja Fri, 05 Mar 2010 19:10:03 GMT


Behind the scene: Quiltivate.com a beautiful Flex on Rails website.

I met Phil several years ago at Derailed, the (Denver Ruby on Rails user group, and for a long time he was curious about how Flex can be integrated with Rails, about the graphical possibilities that Flex offers, the advantages over plain HTML/CSS/Javascript. Then he told me Kacie, his wife, had an idea about a website. She is passionate about quilts and has an eye for details and excellence. Phil is a geek that loves Rails, Kacie loves quilts, it's like Quilting meets Web 2.0 and quiltivate.com was born. In fact Phil and Kacie hired me to create a Quilt Builder that integrates with Quiltivate.com. Kacie had the vision for the whole concept, a simple to use quilt builder that removes lots of the hassle of calculating how much fabric of what color is needed and allows to play with blocks, shapes and colors. She drew a paper prototype that really highlights the tag line of their site" Innovating Traditional Quilting". Quiltivate.com offer much more than a Quilt Builder, it's a blog and a community centered around the art and craft of quilting. Over the last year I spent a couple of hours here and there, well a little more than that, to transform the paper prototype into a real Flex application. Rather than writing about what the tool does and how it does it, let's have a little look at behind the scene of the Quilt Builder with this video:

Behind the scene: Quiltivate.com a beautiful Flex on Rails website. from daniel wanja.

Check out quiltivate.com for a video on how to really use the Quilt Builder and go try it out. As it's fresh out of the gates their may be a little quirks here and there, so please let me know what you find. So thank you Kacie and Phil for getting me on this project, it was really fun! Enjoy, Daniel.

Posted by Daniel Wanja Thu, 16 Jul 2009 04:20:01 GMT


Screencast: Testing Flex Apps with Cucumber - Take 2

I was not really happy with last week's screencast I did on testing Flex with Cucumber. Effectively doing screencast is not an easy endeavor and trying to it myself is making me appreciate all the other screencast I watch so much more. So last week I just wasn't comfortable while I recorded it, not sure why, but I thought I should try to capture it again. And the second time around I felt better, maybe I should alway take two takes (or even more :-). So here is the new one...

Screencast: Testing Flex Apps with Cucumber - Take 2 from daniel wanja.
To run this code you need to have all the gems installed. So config your Rails to run Cucumber with FunFx (in config/environments/test.rb):

config.gem "rspec", :lib => false, :version => ">= 1.2.7"
config.gem "rspec-rails", :lib => false, :version => ">= 1.2.7"
config.gem "webrat", :lib => false, :version => ">= 0.4.4"
config.gem "cucumber", :lib => false
config.gem "funfx"
config.gem "safariwatir"
Config Cucumber to have @flex available (in features/support/env.rb)
require 'funfx'
require 'funfx/browser/safariwatir'

browser = Watir::Safari.new
browser.goto("http://localhost:3000")

Before do
  @flex = browser.flex_app('flashContent', 'flashContent')
end

at_exit do
  browser.close
end
In the same file disable transactional fixtures
Cucumber::Rails.use_transactional_fixtures
Ensure that your Flex application is compiled with the funfx library and the automation library linked in.
<flex-config>
  <compiler>
  <include-libraries append="true">
    <library>../../lib/funfx-0.2.2.swc</library>
    <library>../../lib/automation.swc</library>
    <library>../../lib/automation_agent.swc</library>
    <library>../../lib/automation_dmv.swc</library>
    <library>../../lib/automation_agent_rb.swc</library>
  </include-libraries>
  </compiler>
</flex-config>

Posted by Daniel Wanja Mon, 13 Jul 2009 17:04:11 GMT


Screencast: Testing Flex Apps with Cucumber

I was playing with Cucumber and FunFx to drive a Flex application and it's really cool and created this screencast to show how this all works together. The first 5 minutes I build a Restfulx scaffolded Flex application. The following 5 minutes I configure the Flex app with FunFx, which is required to be able to drive the app from Cucumber. Then the main part which is 20 minutes of creating three cucumber scenarios that drives the Flex application. Check it out:

Testing Flex Apps with Cucumber from daniel wanja The source code can be found on github Enjoy! Daniel
UPDATE: An updated version (and slightly) different version of the screencast can be found here.

Posted by Daniel Wanja Wed, 08 Jul 2009 07:03:00 GMT


Flex On Rails talk in Denver - Thursday 22nd

Tony and I will be giving a talk on Flex on Rails at Derailed, the Denver Rails User Group. This will take place at Forest Room 5 in LODO at 6:30pm, this coming Thursday 22nd.

On the agenda.

  • 6:30 – 7:00: Meet and mingle
  • 7:00 – 8:30: Flex on Rails – From the authors Daniel Wanja and Tony Hillerson
  • 8:30 – … : Book raffle and spirits.

We will show highlights of each of the chapters and samples from the book.

I hope to see you there!
Daniel

Posted by Daniel Wanja Mon, 19 Jan 2009 23:40:21 GMT


New Book: "Flex on Rails: Building Rich Internet Applications with Adobe Flex 3 and Rails 2"

2009.01.02 CoverSmall.jpg

Finally our book on using Flex with Rails is released and will appear over the next few days in stores around the US and is available on Amazon. I received a couple of copies from the publisher and it felt like an accomplishment to hold a physical version in my hands. I am sure my co-author, Tony, felt the same. Good job man! With this release we are also launching http://flexonrails.com where you can find all the source code of the book as well as other resources related to Flex and Rails, and our blog http://blog.flexonrails.com the blog for everything on Flex with Ruby On Rails…

So here are the top 10 reasons why should you absolutely buy this book even if you are not a programmer….1) Your vision will improve 2) You’ll run faster 3) Aging gets reverted 4)… Just kidding, the main reasons for us to write this book was that we really wanted to share many of the experiences and findings we had on using Flex and Rails on many projects, and we are proud of the outcome. It’s a book by developers for developers. I’ll be blogging in a next entry about the process of writing this book, and will create a screencast presenting the different applications we are creating in the book, so stay tuned. When writing the book we assumed that you where a developer, either a Flex developer or a Rails developer that needed to interact with the other side and wanted to add Rails or Flex to it’s battery of languages. You will certainly find your way around even if you don’t know Flex or Rails. In either case we didn’t create a reference book so you won’t find all the answers about each api that is available in both frameworks, but you will find everything you need to get started integrating Flex with Rails, and delve into wonderful world of Flex on Rails applications. For the example code we didn’t want to build a large application and refine it over time through the chapters, so most chapter contain one or several working applications used to highlight the major integration aspects explained in that chapter. And Rails is just fantastic to create small applications on the fly, and Flex and Actionscript is pretty good for that too. So to give you a better overview of the content of this book I have attached the official description and the table of content. For more info come back to http://blog.flexonrails.com and http://flexonrails.com. I hope you enjoy the book and the sample applications. So go check it out and let us know what you think.

Daniel.

Description

“There’s no question you’re going to be a better Flex and Rails developer when you’re done reading this book.”
–From the Foreword by Matt Chotin, Senior Product Manager, Adobe Systems, Inc.

 
Adobe Flex enables the rapid development of rich and engaging user experiences. Ruby on Rails dramatically simplifies the development of database-driven web applications. Now there’s a book that shows how to use the newest versions of both frameworks together to create state-of-the-art Rich Internet Applications (RIAs).

 
Flex on Rails begins with the absolute essentials: setting up your environment for Flex and Rails, passing data with XML, and integrating Flex front-ends with Rails back-ends. Then, using practical, easy-to-understand code examples, the authors take you from the basics to advanced topics only discussed in this book. Techniques covered here include 

  • Constructing sophisticated interfaces that can’t be created with AJAX alone
  • Using RESTful services to expose applications for access via APIs
  • Testing Flex and Rails together
  • Using Flex Frameworks
  • Getting Flex into your build/deploy process
  • And more… 

The authors also offer practical introductions to powerful complementary technologies, such as RubyAMF and Juggernaut.
 

Written by developers with extensive experience using both frameworks, this book covers the new Adobe Flex 3 and Ruby on Rails 2 from the ground up. Even if you have minimal experience with Flex or Rails, you’ll learn all you need to know to use them to build exceptional production applications.

Table of Contents

Foreword xv
Preface xvii
Acknowledgments from Tony Hillerson xxi
Acknowledgments from Daniel Wanja xxii
About the Authors xxiv
 
<strong>PART I: Flex and Rails Essentials</strong>
 
Chapter 1: Developing with Flex and Rails 3
Installation: What You Need to Get Running 3
The Structure of a Flex and Rails Application 6
The Example Code 9
Compiling MXML 9
Running the Rails Server 9
Summary 9
 
Chapter 2: Passing Data with XML 11
XML in Rails 11
XML in Flex 14
Getting XML to Flex 17
Sending XML to Rails 19
Mapping Data Types 21
Error Handling 25
Summary 28
 
Chapter 3: Flex with RESTful Services 29
Creating the Stock Portfolio Rails Application 29
Accessing Our RESTful Application with Flex 39
Summary 48
 
Chapter 4: Using Fluint to Test a Flex with Rails Application 49
Using Fluint to Write Your Flex Unit Tests 50
The Basics of Testing a Flex Application 51
Testing a Cairngorm-Based Application 59
Using Fixtures 79
Summary 83
 
Chapter 5: Passing Data with AMF 85
What Is AMF? 85
Benefits of AMF 86
RubyAMF 87
A Simple RubyAMF Example 95
A RESTful RubyAMF Integration 101
Summary 103
 
Chapter 6: Debugging 105
Logging 106
Debuggers 110
Command Line Debuggers 117
Debugging Communication 127
Summary 129
 
Chapter 7: Data Visualization 131
Online Analytical Processing (OLAP) 133
Advanced DataGrid 144
Charting 147
Summary 152
 
Chapter 8: Flex MVC Frameworks 153
What Do We Mean by a Framework? 153
Roll Your Own 154
Cairngorm at a High Level 154
PureMVC at a High Level 159
Stuff 163
Summary 182
 
Chapter 9: Performance and Optimization 185
Flex Performance 185
Rails Performance 206
Summary 211
 
<strong>PART II: Cookbook Recipes</strong>

Chapter 10: Source Control Flex and Rails Projects 215
Goal 215
Solution 215
Ignoring Files in Subversion 215
Git 217
Discussion 218
Summary 219
 
Chapter 11: Building Flex with Rake 221
Goal 221
Solution 221
Rake Is Your Friend 221
The Rakefile 222
Summary 225
 
Chapter 12: Deploying Flex and Rails Applications 227
Goal 227
Solution 227
Capistrano 227
Deploying with Capistrano 228
Summary 232
 
Chapter 13: Read the Source! 233
Goal 233
Solution 233
The Beauty of Open Source 233
The Rails Source 235
Flex Source 238
Generated Flex Source 240
Summary 243
 
Chapter 14: Using Observers to Clean Up Code 245
Goal 245
Solution 245
BindingUtils and ChangeWatchers in Flex 245
Taking Action on ActiveRecord Lifecycle Events 248
Summary 250
 
Chapter 15: Authenticating 251
Goal 251
Solution 251
Authenticating Users 251
Installing restful_authentication 251
Summary 257
 
Chapter 16: Reusing Commands with Prana Sequences 259
Goal 259
Solution 259
Sequences 259
Prana’s EventSequence 261
Summary 265
 
Chapter 17: Hierarchical Data with RubyAMF 267
Goal 267
Solution 267
Nested Sets 267
Summary 273
 
Chapter 18: Advanced Data Grid and Awesome Nested Set 275
Goal 275
Solution 275
Overview 275
Create the Rails Application and Database 275
Creating a Script to Load the Data 276
Flex Application 279
Adding CRUD 282
Summary 287
 
Chapter 19: Runtime Flex Configuration with Prana 289
Goal 289
Solution 289
IoC, Eh? 289
Summary 293
 
Chapter 20: Server Push with Juggernaut 295
Goal 295
Solution 295
Push Technology 295
Juggernaut 295
Creating the Rails Messaging Application 297
Creating the Flex Messaging Client Application 299
Summary 301
 
Chapter 21: Communicating between Flex and JavaScript 303
Goal 303
Solution 303
Communication between Flex and JavaScript 303
Security 303
Building the Samples 304
ExternalInterface 304
SWFObject and Prototype 305
ExternalInterface in Action 305
Flex-Ajax Bridge in Action 309
Summary 311
 
Chapter 22: File Upload 313
Goal 313
Solution 313
File Upload 313
Creating the Rails Application and Installing attachment_fu 315
Using Flex’s FileReference Class to Upload
One or Several Files 316
Using Flex URLLoader Class to Upload a PNG File 318
Summary 320
 
Index 321

Posted by Daniel Wanja Sat, 03 Jan 2009 04:15:23 GMT


Flex Job: Full time Flex developer in Denver at Videopros.com

Solomon, who also writes on this blog, is currently doing Ruby on Rails work for videopros.com and they are looking to hire a Flex developer to complement their small development team. Here are the details…

VP_Logo_300x100.jpg

We seek a Flex on Rails Kingpin to lead our development team. This is for a full-time or contract-to-hire position. Private consultants should not apply. Depending on skill level and commitment an equity stake is available.

Compensation

  • 70-100K
  • Potential Equity
  • Potential Profit Sharing

Skills and Experience

  • Ruby on Rails | 2.5 Years minimum
  • Flex | 1 Year minimum
  • Web Services
  • Experience as the lead developer for a commercial project.
  • Agile development
  • Subversion (GIT)
  • Linux
  • MySQL
  • XML

Benefits

  • Competitive Salary
  • Health Insurance
  • Long Term Disability Insurance

About Us – The VideoPros Dojo

Dojo means “place of the Way.” Much like a martial arts practice hall, the WAY we operate at VideoPros is a pursuit for mastery in the face of adversity and challenge. The true challenge is not between people and external things – but within ourselves. 

Working at VideoPros means going within yourself and seeing the work you do as a reflection of who you are on the inside. It’s more than “work” or “my job.” We are a place you go to practice being the best you can be – every day.

Apply

VideoPros is motivated to fill this position quickly. To apply, email your resume and one reason why you want to join us at the Dojo to:
Careers{at}VideoPros{dot}com

Posted by Daniel Wanja Tue, 23 Dec 2008 15:00:00 GMT