PDA

View Full Version : How to load only the videos of xml?


stonyx
08-03-2006, 06:40 PM
Anyone knows whats the code for make a filter search only trough the video tags


my xml
<catalog>
<book>
<name></name>
<desc></desc>
<video></video>
</book>
</catalog>

this is some of the AS code
public function loadData():void
{
srv.url = "estosomos.xml";
srv.send();
}
private function filtrar(item:Object):Boolean
{
return item.name.match(new RegExp("^" + inputText.text, "i\*\t\s[']"));
}

....
<mx:Button id="ES" height="32" width="42" cornerRadius="6" click="loadData()">
</mx:Button>

<mx:Button id="videos" height="32" width="42" cornerRadius="6" click="loadVideos()">
</mx:Button>
...

stonyx
08-07-2006, 06:52 PM
help :D

flexy
08-14-2006, 06:13 PM
You're going to need to post more code than this. I can't see where you're defining 'item' or where you're passing it into the function from.

stonyx
08-14-2006, 08:01 PM
You're going to need to post more code than this. I can't see where you're defining 'item' or where you're passing it into the function from.

thanks for the reply i solved this problem

maybe you could help me with something else
my problem is with arrays i think

the code below is for a back and forward buttons
this take you to the one row after or before in the datagrid component
what i want to do (hope is posible) is to go to the last row clicked in the datagrid not the next one something like the browser back and forward buttons

var sBy: String = '';
var sTitle: String = '';
var iDGLastIndx: Number;
var iIndx:Number;
function getGridRowInfo(selItm) {
if (selItm.uploadtitle!=undefined) {
sTitle = selItm.uploadtitle;
} else {
sTitle = '';
}
if (selItm.uploadby!=undefined) {
sBy = selItm.uploadby;
} else {
sBy = '';
}

}
function getNextFile(selIndx):void {
datagrid.selectedIndex = selIndx + 1;
getGridRowInfo(datagrid.selectedItem);
}

function getPreviousFile(selIndx) {
datagrid.selectedIndex = selIndx - 1;
getGridRowInfo(datagrid.selectedItem);
}

<mx:Button label="&lt;" width="24" click="getPreviousFile(datagrid.selectedIndex)" enabled="{datagrid.selectedIndex==0?false:true}"/>

<mx:Button label="&gt;" width="24" click="getNextFile(datagrid.selectedIndex)" enabled="{datagrid.selectedIndex==iDGLastIndx?false:true}"/>