hello everyone,
i ve a problem about my script that should show me entries of an xml file :
<?xml version="1.0" encoding="utf-8" ?>
<videos>
<video name="motion 01" genre="motion" data="thumbs/motion01.jpg" />
<video name="motion 02" genre="abstrait" data="thumbs/motion02.jpg" />
<video name="motion 03" genre="art video" data="thumbs/motion03.jpg" />
<video name="motion 04" genre="motion" data="thumbs/motion04.jpg" />
<video name="motion 05" genre="abstrait" data="thumbs/motion05.jpg" />
<video name="motion 06" genre="art video" data="thumbs/motion06.jpg" />
<video name="motion 07" genre="motion" data="thumbs/motion07.jpg" />
</videos>
inside a dataGrid (myDataP1) versus their attributes “genre”.
the loading in the dataGrid is ok, when i click to btSort with that script it’s ok
function monTri(evt:Event):void {
//myXML = new XML(evt.target.data);
var myDP = new DataProvider(myXML);
myDP.sortOn("genre");// classe les genres
if (myXML.video.(@genre=="motion")) {
for (var i:uint = 0; i < myDP.length; i++) {
myDP.removeItemAt(myXML.video.(@genre!=="motion"));
}
myDataP1.dataProvider = myDP;
}
}
btSort.addEventListener(MouseEvent.CLICK, monTri);
the problem happen when i want to click on a second button that should change entries of dataP1 with another @genre …
function monTri2(evt:Event):void {
//myXML = new XML(evt.target.data);
var myDP = new DataProvider(myXML);
myDP.sortOn("genre");
if (myXML.video.(@genre!=="abstrait")) {
for (var i:uint = 0; i < myDP.length; i++) {
myDP.removeItemAt(myXML.video.(@genre!=="abstrait"));
}
myDataP1.dataProvider = myDP;
}
}
btSort2.addEventListener(MouseEvent.CLICK, monTri2);
i don’t understand and if anyone as an idea of what’s going on it will be very helpfull.
Thanks you.