13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Storing local data<br />

// Use a method of ArrayCollection to remove a feed.<br />

// Because the DataGrid's dataProvider property is<br />

// bound to the ArrayCollection, Flex updates the<br />

// DataGrid wh<strong>en</strong> you call this method. You do not need<br />

// to update it manually.<br />

if (myFeedsGrid.selectedIndex > -1) {<br />

localFeeds.removeItemAt(myFeedsGrid.selectedIndex);<br />

}<br />

}<br />

private function addSite():void {<br />

var o:Object = {name:ti3.text, date:new Date()};<br />

lsosites.addObject(o);<br />

localSites = lsosites.getObjects();<br />

ti3.text = '';<br />

}<br />

private function removeSite():void {<br />

if (mySitesGrid.selectedIndex > -1) {<br />

localSites.removeItemAt(mySitesGrid.selectedIndex);<br />

}<br />

}<br />

]]><br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Last updated 6/6/2012<br />

706

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!