Friday, 15 January 2010

actionscript - Flash DataGrid DataProvider Manipulation -



actionscript - Flash DataGrid DataProvider Manipulation -

posting colleague. please don't up-vote or down-vote.

this within same mxml file.

public function togglemonitor(part:object):void { if(part.active == 0) part.active = 1; else part.active = 0; } public function monitorall(monitor:int):void { for(var part:object in blah) { part.active = monitor; } } <mx:datagrid dataprovider="{blah}"> <mx:columns> <mx:datagridcolumn> <mx:itemrenderer> <mx:component> <mx:image source="{data.active == 0 ? img1 : img2}" click="outerdocument.togglemonitor(data)"/> </mx:component> </mx:itemrenderer> </mx:datagridcolumn> </mx:columns> </mx:datagrid> <mx:button click="monitorall(1)"/>

clicking on image right toggles image (i.e. togglemonitor function works). clicking on button doesn't (i.e. monitorall function not work). why isn't button working?

he managed work out issue. method should this:

public function monitorall(monitor:int):void { blah.refresh(); (var i:int = 0; < blah.length; i++){ (blah.getitemat(i) object).active = monitor; } blah.refresh(); }

flash actionscript datagrid dataprovider

No comments:

Post a Comment