resultFormat="e4x" this no longer works. I also get this error:
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
eg
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
backgroundAlpha="0"
creationComplete="srv.send();showCategories();">
<mx:Script>
<![CDATA[
public function showCategories() : void
{
cat1.title = [EMAIL PROTECTED];
cat2.title = [EMAIL PROTECTED];
}
]]>
</mx:Script>
<mx:HTTPService id="srv" url="" useProxy="false"
resultFormat="e4x" />
<mx:Model id="activityModel">{srv.lastResult.activity}</mx:Model>
<mx:Label id="Title" text="{activityModel.title}" fontSize="16" />
<mx:VBox width="100%" height="100%">
<mx:HDividedBox width="100%" height="75%">
<mx:Panel id="cat1" width="100%" height="100%" >
<mx:TileList height="100%" width="100%" id="tl_Category1"
itemRenderer="Item" rowHeight="130" columnWidth="175"
allowMultipleSelection="false"
dragEnabled="true"
dropEnabled="true"
dragMoveEnabled="true" />
</mx:Panel>
<mx:Panel id="cat2" width="100%" height="100%" >
<mx:TileList height="100%" width="100%" id="tl_Category2"
itemRenderer="Item" rowHeight="130" columnWidth="175"
allowMultipleSelection="false"
dragEnabled="true"
dropEnabled="true"
dragMoveEnabled="true"/>
</mx:Panel>
</mx:HDividedBox>
<mx:Panel title="Items to be classified:" width="100%" height="25%"
>
<mx:HorizontalList id="ItemsDsp" width="100%"
dataProvider="{activityModel.items.item}"
itemRenderer="Item" allowMultipleSelection="true"
dragEnabled="true"
dropEnabled="true"
dragMoveEnabled="true" />
</mx:Panel>
</mx:VBox>
</mx:Application>
code for itemRenderer - Item
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" backgroundAlpha="0"
borderStyle="none" width="165" height="120" verticalAlign="middle"
verticalGap="0" verticalScrollPolicy="off">
<mx:Image id="img" height="100" width="50" source="{data.imageurl}"/>
<mx:VBox width="100%" paddingTop="0" horizontalGap="4">
<mx:Label text="{data.title}" fontWeight="bold"/>
</mx:VBox>
</mx:HBox>
The xml file I am trying to read:
<?xml version="1.0" encoding="utf-8"?>
<activity title="Classification" type="Classification">
<categories>
<category name="Category 1" />
<category name="Category 2" />
</categories>
<items>
<item title="One" imageurl="assets/products/DoCoMo_901_ic.png" />
<item title="Two" imageurl="assets/products/DoCoMo_F900_i.png" />
<item title="Three" imageurl="assets/products/Casio_W21CA.png" />
<item title="Four" imageurl="assets/products/DoCoMo_901_ic.png" />
<item title="Five" imageurl="assets/products/Siemens_SX1.png" />
<item title="Six" imageurl="assets/products/Casio_W21CA.png" />
<item title="Seven" imageurl="assets/products/DoCoMo_901_ic.png" />
</items>
</activity>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Web site design development | Computer software development | Software design and development |
Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.