Learning Flex 3
Welcome to the companion site for Learning Flex 3.
Here you’ll find the source code and examples for the projects in the book.
This is also your place to submit typos, suggestions for improving the book, and questions about Flex in general.
53 comments53 Comments so far
Leave a reply

I am reading this book on Safari Books, really enjoying it so far.
Love your book and the way it is written… Are you open to freelance Flex training? See our website.
Stumbled across this book at Barnes. I checked it out over coffee and felt it was a great fit for my beginner status at this technology. I especially like the larger page size and the generous use of color. I’m about half way through the book now. I’m happy I bought it.
Besonders das Kapitel mit XML war für mich sehr hilfreich und informativ. Ein sehr gutes Buch.
nice, just bought the book. good stuff!
Excelente libro Alaric!
Muy informativo, práctico y conciso. El contenido me inspira a aprender más.
thanx for this lovely book !
Wow, I can’t believe how easy the author makes it for a non-coder to understand and use flex. Thanks!
Excellent book!! There is enough stuff here so you can learn offline (like on a train or over coffee) then it is easy enough to grab FlexBuilder and then start experimenting online.
Excellent format, easy to read and always appreciate the context of when to use a technique instead of just how to use a technique.
Hi Alaric, great book so far. I’m in chapter 10. I hit a snag on page 148. When using my local contacts.xml file, I was initially able to read in that file fine. However, after the initial run, I get a dialog box with several errors starting with the following error, and the DataGrid is empty in my app:
[RPC Fault faultString="Error #2148: SWF file file:///Users/scott/Documents/Flex Builder 3/ContactManagerForm/bin-debug/ContactManagerForm.swf cannot access local resource contacts.xml. Only local-with-filesystem and trusted local SWF files may access local resources." faultCode="InvokeFailed" faultDetail="null"]
at …
I tried creating a crossdomain.xml in /src following your example, but that didn’t work. I can access http://greenlike.com/…/contacts.xml no problem, though. Is it that I have to publish my app and then place the crossdomain.xml file within my WebServer/Documents root (and if so, why would it have worked fine initially)? Or what? Thanks!
I figured it out. I didn’t have to publish my app. I just put both the contacts.xml and crossdomain.xml files on my webserver documents root, and it worked. Thanks
That’s a common problem. Flex Builder is supposed to set your computer up so that you don’t get this error with local files within Flex projects, but sometimes it’s flaky. It’s correct that your project will work fine when pushed to a server, but you may continue to get this security error otherwise. Another workaround is to use Adobe’s Settings Manager (http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html) to set your computer up to allow local access to files for that particular project/folder.
I am looking to use Flex for RIA application on Linux Red Hat with remote connection to Oracle database or flat files to produce graphs with charting engine, zoom in on graph data to see the details of data points. Can you please point how I can use flex and if it supports these features.
Alex, Flex is server agnostic, meaning you can feed it from a database or flat file such as XML without worry. It comes with a nice set of charting components, though you’d need to write custom code to have the data zoom capabilities.
As a result of this book, I was very excited to start using Flex, but after downloading and installing the demo version, none of the videos or tutorials work! Trying to get help from Adobe was a waste of an hour of my life. My Vista machine has run remarkably well until now, but why not with Flex?
I get “JAVA 2 Platform Standard Edition binary is not responding” and “Exception Processin gMessage 0xc0000013 Parameters 0×761D92A00×0000004 0×761D92A0 0×761D92A0″
I’ve tried reinstalling JAVA and Flex, updating both, rebooting, etc. Oh well. Maybe videos work if you buy Flex Builder 3. Anyway, the book is well-written and I’ll try to use Flex without videos.
Im following Chapter 5, and Im running into a problem. Im doing the section thats called “How to Write a Function” and Im following the text exactly as its written in the book. I have inserted the mx:Script tags after the closing application tags, and I keep getting an error that says
“The markup in the document following the root element must be well-formed”
Im not sure what Im doing wrong, or maybe if there is a type somewhere in the text? Any help would be much appreciated!
Thanks,
Jake Rutter
Jake, if you're inserting the Script tags after the closing Application tag as you stated, that will give you that error. They need to be within the two Application tags.
Ah ha! Yeah I think there is a typo within chapter 5 of the book then. I tried it within the application tags and it works as it should. But in the book it says after the application tags!
Thanks for your help!
Jake
Yeah, page 50 states "Just place the insertion point after your <mx:Application/> tag, begin typing <mx:Script, and then press Enter." The forward slash is a typo. What I mean to say is insert the Script tags after the initial Application tag, so it's within the Application. All Flex code will be within the Application.
After struggling with Flash and Actionscript I came across Flex Builder last night. As a mechanical engineer I plan on creating a software module that brings together all kinds of formulas and calculations I have used in the past. Using Flex instead of Excel allows me to have others in my office take advantage of all these repetitive engineering calculations. I'm excited, does anybody else use Flex to create calculation modules for engineering purposes?
On Chapter 5, been using flash, mostly for animation and design for years. Right when I installed flex and popped opened the book I had the feeling rush through my like I first started using "Flash 4," that "WOW, I really like how this looks and can see the possibilities" type feeling, so far even though I haven't gotten to the real meat of the book, I love the flow.
I recently upgraded from Flex 2 to Flex 3 after not using Flex 2 for several months. I bought this book as a review and get up to speed with Flex 3. I am writing to say that by a huge margin, this is the best Flex book I have read. I say that with several books on Flex 2 in my library that pale by comparison.
In fact, I consider this book up there with the best computer related books I have ever read. Good Job!
First of all I have to say you have written a great book to get me started using Flex 3.
Wanted to notify you about a typo in the photos.xml files (used by photogallery) in the example source files. The lists use @title, as is described in the in the book printed XML, but all XML files have a 'label' instead of the 'title' attribute.
I picked up your book after going through both of the Lynda.com Flex 3 tutorials. I have gained a richer and deeper understanding of Flex 3 by just reading half of your book than I did wasting a lot more time and money on the Lynda.com videos.
This really is a fantastic book. I would recommend this to anyone looking to get up to speed quickly, as it touches on the most important aspects of Flex, while pointing you in the right direction for some of the more complex ones. I suggest working your way through this book first, and then picking up something like the Training from the Source book - in that order. I tried TFTS first and had to find something that didn't throw so much at me all at once. It too is a great resource, but more geared toward programmers - I'm a designer first, programmer when I have to be.
This is an excellent book
Thanks
Excellent book! The simplicity and clarity are refreshing, and yet you don't treat the reader like a jerk. That's actually a tough balance...
Question: What is the best way to handle HTTPRequest() errors? Even the runtime app generates a horrendous debug message that would freak a user. How should I approach handling this error, and preventing it from appearing in raw form? Is this a side-effect of FlexBuilder, or will all users see it?
If there's some way to bump my email when you post a reply, that would be great.
Thanks in advance,
Allen
You can attach a fault listener to the HTTPService class, or otherwise listen to fault events on HTTPRequest calls. That will prevent the default debug alert that shows up.
Thanks, Alaric. That did the trick. It's taking me a while to get familiar with all the mx: component techniques. It's wonderfully simple (most of the time) once you get the hang of it.
the book is easily to read ,it's very useful,especially to someone who is new here.
thanks
Wow. What a great book. This was the best programming book I have ever read. It was a quick read and to the point. Very well written. Chapter 5 on learning the basics of scripting was the most succinct explanation of objects, methods and classes that I have ever read. Learning programming languages is hard and generates a lot of questions during the learning process. You manage to intuitively answer these questions as they arise. Excellent work!
P.S. Using color was a great choice as well.
Great book. This sets the standard for others to follow. The colors and the wide margins were a great idea.
I tried Adobe Flex 3 Training from the source to learn Flex. Took a one day training seminar from the authors, but the book jumps from one thing to another too quickly. Like the speed and style of your book.
In chapter 4 on page 40 you show the source for HellowWorld.mxml as it is at that point. Then in chapter 5 on page 49 you show how to add multiple actions. If typed in, gets an error as the Button doesn't yet have a label of expertCheckBox. id added for TextInput (page 47), but not Button.
Good review of your book in 'Technical Journal: The Quarterly Journal of The Oracle Development Tools User Group' by Neelesh Shah (Fourth Quarter 2008).
In Chapter 7, page 83 you introduce Storing Complex Data using . In the example that begins on page 83 and ends on page 84 you give your model an id of 'model'. But in the source attribute of the data binding you use an id of 'areaCode'. Shouldn't that be 'model', which matches the usage in Multilevel Bindings at the bottom of page 84?
In Chapter 8, page 98 Figure 8-3 is incorrect. Red box was added first, then green box and finally blue box. So red box would be first (bottom), green box second (middle) and blue box last (top). If green box is removed and then added it would be on top. But red box would still be on the first (bottom) and blue box would now be second (middle) and green last (top). So the blue box should be displayed on top of the red box and not as shown in the figure. Figure 8-4 is correct for when the layout of the panel is vertical.
Dan, thanks for your comments. There are a few bits of errata in the book. If you could, please submit these to O'Reilly at http://oreilly.com/catalog/9780596517328/errata. That would definitely help for the next version.
Hi Alaric
You have written a great book about a very friendly software with no doubt great potential. However, before I invest in a full version of the Flex Builder, I wanted to ask you if Flex-3 can be used as an alternative to the presentation layer in our library management software which at present uses Java WebStart Applets for the presentation layer. The application uses J2EE Application Server(JBoss) and the PostgreSQL database server.
I would really appreciate your advice.
Jai
Just wanted to add to what Dan commented on Jan 20th. I too stared with Flex 3 "Training From The Source". Found that is was disjointed and choppy in presentation. Jumped in on advanced concepts while trying to explain non-related basics.
You have a gift for taking the fundamentals of this language and presenting them in a clear and readable as well as logically build-able format.
Are you writing any other books? Java, Action Script or PhP perhaps?
I love this wonderful book!
just started your book, IE want to run activeX control to run first example in flex builder(trial) , though adobe's video training example worked f9 without it, I have to run activeX control to let application run, thanks for the wonderful book
Great book so far, but there's a bit of a problem in Chapter 8, page 115. I typed in the code exactly, but it won't compile, giving me the error "could not resolve to component implementation", and the same thing with ConstraintColumns. Was there some external library we were supposed to include for those tags to work?
Hey Alaric thanx for the book,I read it all on my city bus rides before even touching the keyboard.When I opened Fx Builder for the first time I felt at home!One little complain:I think there was no discussion about how to store data submitted by forms.I used the Database Application wizard to build a custom application which hides the database,and presents only a form.(An AIR application using the same database presents the data to the website owner).The PHP code that the wizard generates is a little scary-for a non PHP guru at least-I wonder if there simpler ways to connect form data to a Database for storage.My goal is to build full-Flex/flash websites integrated with Joomla or Drupal for backend functionality.Thanks for a great book,greetings from Athens,Greece!
Hello Alaric, I have been reading your book and I think its great, a good start with Flex. I have a question about chapter 10. When we build the search app. I think I´m having problems with displaying the search results summary. When we add the following code
The summary wont show up in the search results, but if you take out the 100% on the width it will show. But comparing it to the image in the book, it seems that the text control wont do enters. Is it b/c the flex version? Another thing i tried was comenting out the label and not deleting the width of 100% in the text control and it does show in the search result, but with no enteres. What do you think? :p
Hi,
I really enjoyed working through your book thanks, but I have 2 (maybe obvious) questions at the end of it:
1) How do you write a site with multiple pages connected by normal html-like links
2) I keep getting error 1037, packages cannot be nested with a simple action script function that populates a combo box. Is this a common error? It is completely foxing me.
хорошая книга!
I've been learning Flex via your book and I've been really impressed with it. I've found a few minor typos in some of the examples which I've added I've documented on the OReilly web site for your book. I've only run into one area that stumped me for a bit. Chapter 14 - Skinning. Since the previous section had you working on the Search example it wasn't clear to me that I need to go all the way back to the Contact Manager example and select the style sheet and then the button component in order to see the style/skin selector in the flex properties. This subsection could probably use some clarification and it would be nice to have access to the images and a little example to try all this out.
Hi,
I recently picked up your book for learning flex. I am very impressed with your writing style, unlike other authors you cover the small nuances which is very useful for a newbie like me with many doubts.
I am currently reading the data binding chapter and seem to have hit a small roadblock. You have given a example of using mx:String tag to explain data binding. My instance of flexbuilder is not liking the tag. It is giving me errors for mx:String tag and asks me to link visual components with IUIComponent. The error message is
"Component Declarations are not allowed here. (Note: visual children must implement mx.core.IUIComponent). Hope you can help with this. Also what is the best place to involve in flex platform and ask questions like this.
Thanks
Ananth
PS: Sorry my previous posts missed the tag info due to angle brackets.
Alaric,
Please write a second book on flex continuing where this one left off
You make flex easy.
thanks.
patrick
Alaric,
I second Patrick's suggestion. With Flex 4 out, it would be awesome to have a companion book - that builds on the clarity of Learning Flex 3.
I have read a lot of programming books and this is by far the best.
Thanks,
Forrest
hi, I'm following the examples and the book is really well done. I'd like to see a second book from you.
Hi, Is the code on page 88 correct? When I try to run I get a blank browser. When I go into Design Mode I see {..TextInput.text} {lastName...} in the Contact Details Panel. Good book so far. Any help appreciated. Regards Geoff
love this book so far, flow of info. and concepts are straight forward to understand even for beginners in Flex. I am at the end of chapter 6, 156page. I have a problem, design mode for EComm.mxml is blank, don't see a thing there except for the background color. Everything works fine when i run the application though and the Design Mode for all the other .mxml files are proper.Even tried copying the file from the CD in the book, still the same.
Any pointers......please
Priya