Re: [Flashcoders] question SO class

2006-06-17 Thread John Grden

try looking at it at runtime with xray:

http://www.osflash.org/xray

you can check the SO object at runtime to see what values are being stored,
that might help you

JG

On 6/17/06, Caruso Canepari <[EMAIL PROTECTED]> wrote:




John Grden <[EMAIL PROTECTED]> wrote:  I use this SO class ;)

.

Hi, it's interesting but I wanted to use that class. The only thing I
can't do now is to have a method getContent to trace the names of the
properties. That is: if I use it this way --->getContent(A), I get A value,
but I can't see (neither in "List variables") the properties I added the way
suggested by Micha.

Bye CC

Chiacchiera con i tuoi amici in tempo reale!
http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
___
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





--
John Grden - Blitz
___
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] question SO class

2006-06-16 Thread Caruso Canepari


John Grden <[EMAIL PROTECTED]> wrote:  I use this SO class ;)

.

Hi, it's interesting but I wanted to use that class. The only thing I can't do 
now is to have a method getContent to trace the names of the properties. That 
is: if I use it this way --->getContent(A), I get A value, but I can't see 
(neither in "List variables") the properties I added the way suggested by Micha.

Bye CC

 Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 
___
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] question SO class

2006-06-16 Thread John Grden

I use this SO class ;)
http://mirror1.cvsdude.com/trac/osflash/xray/browser/DEV_Source/xray/classes/com/blitzagency/util/LSOUserPreferences.as

Usage:

LSOUserPreferences.load("nameOfSO");
LSOUserPreferences.setPreference(propertyName:String, value,
persistent:Boolean);
LSOUserPreferences.getPreference(propertyName:String);

Events:
load: fired when LSO is loaded
save: fired when flush is attempted.  Includes status message.

be sure to get GDispatcher or switch out the eventdispatcher with MM's or
whatever you like:
GDispatcher.as

hth,

JG

On 6/16/06, Caruso Canepari <[EMAIL PROTECTED]> wrote:


Michael Stuhr <[EMAIL PROTECTED]> wrote:
never tried but you could also use:
http://www.meychi.com/source/actionscript/classes/Cookie.as


Hi, thanks for replying.
Being desperately ignorant, I could be wrong but here meychi code:

public function save(object):Void {
this.localObject.data[this.name] = object;
this.localObject.flush();
}

lets you add only one property (with the name of the cookie): am I wrong?
Instead, I would be able to save many properties in the same cookie.
And: I don't want to add and flush: I just want to add.
Another method, if is the case, will write the cookie.

But, of course, if you think I'm loosing my time, I'd be glad to know it
;-)

CC


Chiacchiera con i tuoi amici in tempo reale!
http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
___
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





--
John Grden - Blitz
___
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] question SO class

2006-06-16 Thread Caruso Canepari
Michael Stuhr <[EMAIL PROTECTED]> wrote:
never tried but you could also use:
http://www.meychi.com/source/actionscript/classes/Cookie.as


Hi, thanks for replying.
 Being desperately ignorant, I could be wrong but here meychi code:
 
 public function save(object):Void {
 this.localObject.data[this.name] = object;
 this.localObject.flush();
 }

lets you add only one property (with the name of the cookie): am I wrong?
Instead, I would be able to save many properties in the same cookie.
And: I don't want to add and flush: I just want to add. 
Another method, if is the case, will write the cookie.

But, of course, if you think I'm loosing my time, I'd be glad to know it   ;-)

CC
 

 Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 
___
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] question SO class

2006-06-16 Thread Michael Stuhr

Scott Hyndman schrieb:

Just out of interest, what benefit exactly does this class provide?
You seem to offer the same methods that the shared object does with
different names (although the names are clearer, I'll give you that).
except for that setData()  i would have expected saveCookie() or sth 
like that.


@Caruso:

you should try it this way: (just out of my head ...)

function saveCookie (props:Object)
{
this._data = props;
}

so now all you have to provide to this function is an object like:

var o:Object = new Object (...);
saveCookie (o);

never tried but you could also use:
http://www.meychi.com/source/actionscript/classes/Cookie.as

micha

___
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] question SO class

2006-06-16 Thread Caruso Canepari


Scott Hyndman <[EMAIL PROTECTED]> ha scritto:  Just out of interest, what 
benefit exactly does this class provide?
You seem to offer the same methods that the shared object does with
different names (although the names are clearer, I'll give you that).

Scott



Hi Scott. By putting all the things in class I can use and reuse the class 
without reading anytime the docs. Let's say it's a "utility" I'm building for 
myself. In any case, if you can understand what am I doing wrong (except for 
the creation of the class itself), help me!:-)

Bye, CC



 Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 
___
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] question SO class

2006-06-15 Thread Scott Hyndman

Just out of interest, what benefit exactly does this class provide?
You seem to offer the same methods that the shared object does with
different names (although the names are clearer, I'll give you that).

Scott

On 15/06/06, Caruso Canepari <[EMAIL PROTECTED]> wrote:


Hi.

I made up this little class to manage Shared Objects.
But there is something (or more than simply "something") in AS I don't 
perfectly understand.

The problem (I imagine there can be many more, but...) is that I can't add more 
than one data property. I post the code with some comment:



---
class
---

class com.FlashCookie extends SharedObject {
var _name:String;
var _data:Object;
var _so:SharedObject;
var _propName:Object;
//
function FlashCookie(name:String) {
if (name == undefined) {
trace("you must pass me something");
return;
}
this._name = name;
this._so = SharedObject.getLocal(this._name);
this._data = this._so.data;
}
// one problem could live here:
public function setData(_propName:Object, _value:Object):Void {
this._propName = _propName;
if (this._data[this._propName] == undefined) {
this._data[this._propName] = _value;
}
}
//
function deleteCookie():Void {
this._so.clear();
}
//
function writeCookie():Object {
var res = this._so.flush();
return res;
}
//
function getCookieSize():Number {
var num = this._so.getSize();
return num;
}
// I only get the array (A):
function getContent() {
trace("!");
//trace(this._data);
var i;
for (i in this._data) {
trace([i]+"--"+this._data[i]);
}
}
}

---
FLA code:

//
import com.*;
//
var coo:FlashCookie = new FlashCookie("foo_bar_baz");
//
var A:Array = [1, 2, 4];
var B:String = "string_";
var C:Number = 6;
//
coo.setData(_propA, A);
coo.setData(_propB, B);
coo.setData(_propC, C);

---


I hope you can help me understand.   :-)
Thanks in advance.
CC




 Chiacchiera con i tuoi amici in tempo reale!
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com
___
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com