At first glance you are not importing the Alert class import mx.controls.Alert;
-----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of nelson_geoff Sent: Wednesday, March 05, 2008 12:32 PM To: [email protected] Subject: [flexcoders] Shared Object in Flex 2 Can anyone help me figure out why this won't work? <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"> <mx:Script> <![CDATA[ private function storeVisitDate():void { var visitDate:SharedObject = SharedObject.getLocal ("userVisitedDate"); if(visitDate.data.lastVisitedDate != null) { Alert.show("Welcome back, you visited last on " + visitDate.data.lastVisitedDate); } visitDate.data.lastVisitedDate = new Date(); visitDate.flush(); } ]]> </mx:Script> <mx:Button label="Click Me" click="storeVisitDate()"/> </mx:Application> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links

