Macromedia Flash Server - SSAS

This is Interesting: Free IT Magazines  
Home > Archive > Macromedia Flash Server > April 2005 > SSAS





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author SSAS
Simon Lord

2005-04-07, 5:57 pm

I'm new to this whole SSAS stuff and I'm not sure if this should be a
coders list question so I apologize...

I'm trying to build a little SO to contain some weak user stats so I
can say something like "You were here last on <date>":

this.users_log.lock()
this.my_log={username:name};
this.users_log.setProperty(name, this.my_log);
this.users_log.unlock();

.... I add the <date> from within the flash client app. It all works
but the data object is lost when the user reloads. Why is that? The
SO is persistent so I figured it would stick, and I assume that if I
define it on the SS then that would surely reset it.

I could store it locally but that's not the point, I'm trying to learn
SS and SO's this week...

Sincerely,
Simon


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

[*__*]

2005-04-07, 5:57 pm

Simon,
Your date should be included in the object you assign to the SO slot.
Ultimately whether you send it from the Client or define it on the
server its the same remote SO slot therefore you should have something
like so from the client side.

Maybe you retrieve the SO slot values first

var tempName:String = clientSO.data.name[username];
var myclientObj:Object = {username:tempName, date: thedate}

users_log.data.theClientName = myclientObj;

or something of like that

a

> I'm new to this whole SSAS stuff and I'm not sure if this should be a
> coders list question so I apologize...
>
> I'm trying to build a little SO to contain some weak user stats so I
> can say something like "You were here last on <date>":
>
> this.users_log.lock()
> this.my_log={username:name};
> this.users_log.setProperty(name, this.my_log);
> this.users_log.unlock();
>
> ... I add the <date> from within the flash client app. It all works
> but the data object is lost when the user reloads. Why is that? The
> SO is persistent so I figured it would stick, and I assume that if I
> define it on the SS then that would surely reset it.
>
> I could store it locally but that's not the point, I'm trying to learn
> SS and SO's this week...
>
> Sincerely,
> Simon
>
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>




=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

[*__*]

2005-04-07, 5:57 pm

Slightly adjusted.
Maybe you retrieve the SO slot values first

//@param theClientName: the name of the logged user

var tempName:String = clientSO.data[theClientName[username]];
var myclientObj:Object = {tempName:tempName, date: thedate}
if (theClientName == tempName)
users_log.data.theClientName = myclientObj;

or something of that nature
a


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Simon Lord

2005-04-07, 5:57 pm

> Maybe you retrieve the SO slot values first

That's what I'm doing. And they are returned to me with a value of
undefined.

SS:
this.users_log.lock()
// --------------------------------
// notice I only define the username here (because it's constant)
this.my_log={username:name};
this.users_log.setProperty(name, this.my_log);
this.users_log.unlock();

CS:
users_log = SharedObject.getRemote("users_log", nc.uri, true);
users_log.onSync = onSyncLog;
users_log.owner = this;
users_log.connect(nc);

.... onSynclog runs off and populates the datagrid with *just* usernames
as expected.

So far so good. But now I want to add the date to the SO, so I run the
following from the client side:

users_log.data[val].lastVisit = _root.enterDate;

.... this works great until the user leaves. When they come back and I
try to read the lastVisit slot for that user it's undefined, and
because it's undefined it gets set to the current date. I thought it
may have something to do with the fact that on the SS I don't actually
define lastVisit, IE:

this.my_log={username:name, lastVisit:client.lastVisit};

.... but I tried that and it still returns undefined and refuses to keep
the date the client side supplied to it earlier (but works fine for the
period they are logged in). I'm trying not to save this info locally
because the manual says the local info can be wiped if the user resets
their cache settings. So while there is an option for me here I would
rather discover why I can't store an SO written from the client to the
server and retrieve it later.



>
> //@param theClientName: the name of the logged user
>
> var tempName:String = clientSO.data[theClientName[username]];
> var myclientObj:Object = {tempName:tempName, date: thedate}
> if (theClientName == tempName)
> users_log.data.theClientName = myclientObj;
>
> or something of that nature
> a
>
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>

Sincerely,
Simon


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Simon Lord

2005-04-07, 5:57 pm

It's definately something on the server side. If users leave, any NEW
viewer can see their correct last visit date. It's only when you
RE-ENTER that your data gets wiped.

Hope that narrows things down. I'm a little worn out at this point...
:P



On Apr 3, 2005, at 12:15 AM, Simon Lord wrote:

>
> That's what I'm doing. And they are returned to me with a value of
> undefined.
>
> SS:
> this.users_log.lock()
> // --------------------------------
> // notice I only define the username here (because it's constant)
> this.my_log={username:name};
> this.users_log.setProperty(name, this.my_log);
> this.users_log.unlock();
>
> CS:
> users_log = SharedObject.getRemote("users_log", nc.uri, true);
> users_log.onSync = onSyncLog;
> users_log.owner = this;
> users_log.connect(nc);
>
> ... onSynclog runs off and populates the datagrid with *just*
> usernames as expected.
>
> So far so good. But now I want to add the date to the SO, so I run
> the following from the client side:
>
> users_log.data[val].lastVisit = _root.enterDate;
>
> ... this works great until the user leaves. When they come back and I
> try to read the lastVisit slot for that user it's undefined, and
> because it's undefined it gets set to the current date. I thought it
> may have something to do with the fact that on the SS I don't actually
> define lastVisit, IE:
>
> this.my_log={username:name, lastVisit:client.lastVisit};
>
> ... but I tried that and it still returns undefined and refuses to
> keep the date the client side supplied to it earlier (but works fine
> for the period they are logged in). I'm trying not to save this info
> locally because the manual says the local info can be wiped if the
> user resets their cache settings. So while there is an option for me
> here I would rather discover why I can't store an SO written from the
> client to the server and retrieve it later.
>
>
>
> Sincerely,
> Simon
>
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>

Sincerely,
Simon


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Simon Lord

2005-04-07, 5:57 pm

> It's definately something on the server side. If users leave, any NEW
> viewer can see their correct last visit date.


To be clearer, if I leave the room and YOU enter you would see my last
visit date. If I come back then the lastVisit slot goes undefined for
myself AND everyone's datagrid cell containing my last visit date goes
blank. So I can't tell *you* when you were there last, works great when
you leave tho... :P

> It's only when you RE-ENTER that your data gets wiped.
>
> Hope that narrows things down. I'm a little worn out at this point...
> :P
>
>
>
> On Apr 3, 2005, at 12:15 AM, Simon Lord wrote:
>
> Sincerely,
> Simon
>
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>

Sincerely,
Simon


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Simon Lord

2005-04-07, 5:57 pm

Sorry for the noise, takes time for things to sink in....

Ok, so I commented out some code on the SS which appears to have been
resetting things to null (things which were declared on the CS and not
onConnect SS):

// this.users_log.lock()
// this.my_log={username:name};
// this.users_log.setProperty(name, this.my_log);
// this.users_log.unlock();

.... now it seems to work. Black magic. Probably be busted when I wake
up in the morning... ;)



On Apr 3, 2005, at 12:42 AM, Simon Lord wrote:

>
> To be clearer, if I leave the room and YOU enter you would see my last
> visit date. If I come back then the lastVisit slot goes undefined for
> myself AND everyone's datagrid cell containing my last visit date goes
> blank. So I can't tell *you* when you were there last, works great
> when you leave tho... :P
>
> Sincerely,
> Simon
>
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>

Sincerely,
Simon


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com