Learning Flex 4 | O'Reilly Media

Archive for the ‘Uncategorized’ Category

Primer on Byte-Level Development in AS3

leave a comment »


Lee Brimelow posted a fantastic primer on byte-level development using ActionScript 3.  This tutorial is a 30-minute screencast where Lee demonstrates how to read a format spec and develop a solution for handling an unsupported file format with ActionScript 3.  This is a fantastic tutorial and well worth the time of anyone interested in byte-level programming in ActionScript.

Written by elrobis

11 December 2010 at 10:27 am

The Book’s Source Code by Chapter

with 11 comments

Just in case people come here looking for the book’s example code:

2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16


[Update: It seems the Yahoo searching service has gone offline. I modified the code from pages 232-233, as follows, and using debugging techniques, I see that the application is catching errors in the searchFault() method.]

<?xml version=”1.0″ encoding=”utf-8″?>
<s:Application xmlns:fx=”http://ns.adobe.com/mxml/2009
import com.yahoo.webapis.search.events.SearchFaultEvent;
import com.yahoo.webapis.search.events.SearchResultEvent;
import mx.collections.ArrayCollection;

private var searchResultAC:ArrayCollection;

private function onSearch():void {
searchService.query = queryTI.text;

private function searchResult(e:*):void {
// breakpoints here won’t hit…………………….
searchResultAC = e.result as ArrayCollection;
resultsList.dataProvider = searchResultAC;

private function searchFault(e:SearchFaultEvent):void {
// this breakpoint catches every time…………
<yahoo:SearchService id=”searchService”
<s:VGroup left=”10″ right=”10″ top=”10″ bottom=”10″>
<s:Label text=”Yahoo! Search:” fontWeight=”bold”/>
<mx:FormItem label=”Query:” fontWeight=”bold”>
<s:TextInput id=”queryTI” width=”350″/>
<s:Button id=”searchButton” label=”Search”
<s:List id=”resultsList” width=”100%” height=”100%”/>

This screenshot came right out of FlashBuilder 4.5, with a breakpoint set in the searchFault() method:

The Variables pane showing errors attached to the SearchFaultEvent object.

I’ll give this problem some thought. Perhaps I can post an alternative API example here. Does anybody have an API they’d like to recommend for an example application? If so, I’m open to suggestions.

Written by elrobis

7 November 2010 at 11:13 pm

Posted in Uncategorized

Drag From a List, Drop in a TextInput

leave a comment »

Today I wanted to drag an item from a List and drop it into a TextInput. I had never used the DragManager in this manner, but Kumar Gandhi’s post exposed the task for its simplicity. Check it out here:


Written by elrobis

27 August 2010 at 12:33 pm

Posted in Uncategorized