Learning Flex 3 (Alaric Cole)

Getting Up to Speed with Rich Internet Applications (RIAs)

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.

43 Comments so far

  1. Adam June 29th, 2008 1:46 pm

    I am reading this book on Safari Books, really enjoying it so far.

  2. Kelvin July 4th, 2008 9:22 am

    Love your book and the way it is written… Are you open to freelance Flex training? See our website.

  3. dbmuse July 4th, 2008 2:07 pm

    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.

  4. gelbmann July 21st, 2008 11:12 am

    Besonders das Kapitel mit XML war für mich sehr hilfreich und informativ. Ein sehr gutes Buch.

  5. Blenjar July 25th, 2008 11:01 pm

    nice, just bought the book. good stuff!

  6. Favio July 29th, 2008 5:50 pm

    Excelente libro Alaric!
    Muy informativo, práctico y conciso. El contenido me inspira a aprender más.

  7. abic August 7th, 2008 12:44 am

    thanx for this lovely book !

  8. Stan G August 12th, 2008 8:22 am

    Wow, I can’t believe how easy the author makes it for a non-coder to understand and use flex. Thanks!

  9. Slojack August 15th, 2008 8:42 am

    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.

  10. Scott Gardner August 25th, 2008 4:23 pm

    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!

  11. Scott Gardner August 25th, 2008 4:32 pm

    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

  12. Alaric August 25th, 2008 7:46 pm

    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.

  13. Alex September 3rd, 2008 12:08 pm

    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.

  14. Alaric September 3rd, 2008 3:52 pm

    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.

  15. MikeC September 6th, 2008 11:10 am

    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.

  16. Jake Rutter September 7th, 2008 2:34 pm

    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

  17. Alaric September 7th, 2008 7:10 pm

    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.

    XML:
    1. <mx:Application>
    2.      <mx:Script>
    3.  
    4.      </mx:Script>
    5. </mx:Application>

  18. Jake Rutter September 7th, 2008 7:54 pm

    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

  19. Alaric September 7th, 2008 9:53 pm

    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.

  20. Jon Bechtel September 19th, 2008 4:58 pm

    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?

  21. Ike September 22nd, 2008 9:55 pm

    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.

  22. Bill Graham October 31st, 2008 8:45 am

    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!

  23. Jorrit November 1st, 2008 3:04 pm

    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.

  24. Ryan November 12th, 2008 11:52 am

    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.

  25. dude467 November 21st, 2008 3:24 pm

    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.

  26. RichE December 14th, 2008 7:58 pm

    This is an excellent book

    Thanks

  27. Allen Cobb December 21st, 2008 11:33 am

    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

  28. Alaric December 21st, 2008 12:40 pm

    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.

  29. Allen Cobb December 23rd, 2008 10:11 am

    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.

  30. Hance Hoo December 27th, 2008 8:34 am

    the book is easily to read ,it's very useful,especially to someone who is new here.
    thanks

  31. Smooph January 1st, 2009 11:11 am

    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.

  32. Mike January 14th, 2009 11:32 am

    Great book. This sets the standard for others to follow. The colors and the wide margins were a great idea.

  33. Dan January 20th, 2009 5:15 am

    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.

  34. Dan January 20th, 2009 6:54 am

    Good review of your book in 'Technical Journal: The Quarterly Journal of The Oracle Development Tools User Group' by Neelesh Shah (Fourth Quarter 2008).

  35. Dan January 21st, 2009 6:16 am

    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?

  36. Dan January 21st, 2009 12:18 pm

    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.

  37. Alaric January 21st, 2009 12:21 pm

    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.

  38. Jai Haravu January 27th, 2009 7:45 pm

    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

  39. Steve February 11th, 2009 8:58 am

    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?

  40. wangyu April 2nd, 2009 2:41 am

    I love this wonderful book!

  41. Vaibhav April 19th, 2009 2:28 pm

    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

  42. Michael May 4th, 2009 1:01 pm

    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?

  43. Spiros Kabasakalis June 27th, 2009 11:40 pm

    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!

Leave a reply