What's exactly "not working" about this?  I copied your code into an
mxml doc, added the missing import, and ran it.  It looked like it
worked to me.

Charlie

On Wed, Mar 5, 2008 at 12:32 PM, nelson_geoff <[EMAIL PROTECTED]> wrote:

> 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>
>
>  

Reply via email to