|
In browsing the latest Developer Center Update email, I noticed that they have chosen to include 4 chapters from our Flex Book on their site. It looks like they have put the pdf's and files for Chapters 11 (DataGrids), 16 (Styles and Skins), 20 (FDS Data Push) and 21 (FDS Data Services).
One thing any readers on DevNet should be aware, is there is an issue with one block of code in chapter 11, running in the updated Flex Builder 2.0.1. On page 275, when creating the inline item renderer for a DataGrid cell, you need to modify it slightly for it to compile in Flex 2.0.1.
The book has you right the code like this:
<mx:DataGridColumn editable="false">
<mx:itemRenderer>
<mx:Component>
<mx:VBox>
<mx:Button
label="Remove"
click="outerDocument.removeItem(valueObjects.ShoppingCartItem(data));"/>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
To get it to compile with the updated FlexBuilder, you need to modify it like this:
<mx:DataGridColumn editable="false">
<mx:itemRenderer>
<mx:Component>
<mx:Script>
import valueObjects.ShoppingCartItem;
</mx:Script>
<mx:VBox>
<mx:Button
label="Remove"
click="outerDocument.removeItem(valueObjects.ShoppingCartItem(data));"/>
</mx:VBox>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
We are still actively trying to get the publisher to put up an errata site for the book, but this is the only issue with the book code that I have heard about from our readers.
Enjoy the sample chapters!
public function Category (id:int, catName:String) {
catID=id;
this.catName=catName;
}
If the "catName" argument were called something else, then the "this"
keyword wouldnt be required for either, like this:
public function Category (id:int, cat:String) {
catID=id;
catName=cat;
}
Hope this helps...
Great book. I've recommended it to my company. I'm still trying to get the
itemrenderer to happen. But with the revision to add mx:script I'm now
getting a parse error. Any thoughts?
hi, i have the problem :" parse error at <mx:script>". i'm use flex
builder 3 b2, some idea thanks.
hello, i'm try this
click="import valueObjects.ShoppingCartItem;
outerDocument.removeItem(valueObjects.ShoppingCartItem(data));"
and works in flex builder 3 b2... thanks anyway