;

PDA

Click to See Complete Forum and Search --> : Server/Client SharedObject Nightmare


Aware0
09-08-2002, 02:17 AM
**RANT: IGNORE**
First off, I am extremely new to FlashCom scripting. The first thing i did however, was to swear (almost)never to use the netComponents. Components are like Americans, they just promote lethargy, they are narrow-minded, and they are way too fat for their own good. No offense to us Americans.
**RANT: IGNORE**


On to the nightmare. I am having some troubles setting and getting variables from a permanent SO on the server. At the moment I am just testing out the scripts, learning how to use them, and I am not understanding why they are not working

a snippit:
//main.asc
application.onAppStart = function()
{
nc = new NetConnection();
nc.connect("rtmp://localhost/so_test");
so = SharedObject.get("foo", true, nc);
so.setProperty("address", "655321 E Droog Dr.");
so.setProperty("city", "Videywell");
var names = so.getPropertyNames();
for (x in names) {
var propVal = so.getProperty(names[x]);
trace("Value of property "+names[x]+" = "+propVal);
}
};


And I end up with an error instead of my two values: line 10: TypeError: names has no properties

can someone out there see my error. In my mind(however entangled it is), I would assume that "names" has at least 2 properties, which i had set earlier.

psychlonex
09-08-2002, 06:19 PM
Hey -
Looking at your code, and then looking at the docs.. have you tried not putting quotes around the property names?


so.setProperty(address, "655321 E Droog Dr.");
so.setProperty(city, "Videywell")


psx

Aware0
09-08-2002, 09:55 PM
I get an error again, different this time.

line 9: ReferenceError: address is not defined

I was wondering if anyone knew of a good example of server-refrenced SOs or server-created SO "slots."

I just need one to actually look at for syntax.

psychlonex
09-09-2002, 02:16 AM
Just a thought - you know me - all about doing it all on the client end :)

Do you have to connect the so like you do on the client?

ie.

so.connect(nc);

psx

At any rate - why not just set the so in your application.start, and define it's properties there?

Aware0
09-09-2002, 02:27 AM
well this is only a test, just to see the capabilities.


Anyways, why aren't you ever getting on AIM, John.

Yeh, I agree with the suggestion by Somar. I think that we should (the people on the board) create an online, development center, or at least something for the "community."