;

PDA

Click to See Complete Forum and Search --> : dataBinding and atributes


jAQUAN
08-25-2006, 07:12 PM
yep, me again.

I'm following the tutorial here (http://www.adobe.com/devnet/flex/articles/flex2_php.html).

It's working fine for me, but I need to extend it a little and I can't seem to find any documentation on it.

Basically, my PHP is sending back an xml string like this:
<results>
<row>
<artist>artist1</artist>
<song>song1</song>
<price cost='99'>clickme.swf</price>
</row>
</results>

I have the HTTPService's result tag call a function named bsResultHandler() shown here:

private function bsResultHandler(event:ResultEvent):void{
// Save a reference to the list of bloggers
resultsCol = event.result.results.row;
trace(resultsCol.toString());
// Hide the busy cursor
CursorManager.removeBusyCursor();
}


My DataGrid's dataProvider is resultsCol.

How can I get one of the DataGridColumns to show the value of cost?
right now I have:
<mx:DataGridColumn headerText="Preview" dataField="cost"/>

jAQUAN
08-26-2006, 06:55 PM
K, I pretty much got that figured out. Seems you can pass simple url vars to the itemRenderer.
So I just had the php send back an xml tag that looked like this:
<buyBtn>buynow.swf?price="99"&id="12345"</buyBtn>

and inside the swf I just used:
price_txt.text = "$0."+price;

So I can have loaded .swf's communicate with loaded vars, that's cool. But now my question is, how do I reference vars inside a flex <mx:Script> tag?

Say I had a script tag as follows:

<mx:Script>
<![CDATA[
public var playState:Boolean = true;
]]>
</mx:Script>


how would I trace playState from an .swf loaded into a cell of a dataGrid?