Server/Client SharedObject Nightmare
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Server/Client SharedObject Nightmare

  1. #1
    ASR | FlashComm Ceasar Aware0's Avatar
    Join Date
    Aug 2002
    Location
    Aurora, Colorado, USA
    Posts
    110
    **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:
    Code:
    //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.

  2. #2
    psx = new Moderator();
    Join Date
    Jan 2001
    Posts
    923
    Hey -
    Looking at your code, and then looking at the docs.. have you tried not putting quotes around the property names?

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

  3. #3
    ASR | FlashComm Ceasar Aware0's Avatar
    Join Date
    Aug 2002
    Location
    Aurora, Colorado, USA
    Posts
    110

    Attempted

    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.

  4. #4
    psx = new Moderator();
    Join Date
    Jan 2001
    Posts
    923
    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?

  5. #5
    ASR | FlashComm Ceasar Aware0's Avatar
    Join Date
    Aug 2002
    Location
    Aurora, Colorado, USA
    Posts
    110
    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."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com