Lives On Board

/ My MetaSphere /

Wed Jul 16, 2003

Flash MX Hosting
Web Hosting
Web Tools
Help FAQ
Marketing
Portfolio
Contact
Site Chat
Web Search
Asheville NC
Boards
Network Log
Got Flash?
Web Links

Need Help?
We are online if image is green.
We are online if this image is green. Click here to chat live with metasphere.net.

Just Another Perl Hacker

Flash Hosting with MetaSphere

Today in History:
1948: John J. Pershing, military commander whose brilliant career earned him the title General of the Armies of the United States, died.

Metasphere.net
Asheville, NC



Help FAQ Index / Search
Help FAQ FCS
Previous Page in Help FAQ Tour Next Page in Help FAQ Tour
Help FAQ

FCS SharedObject Example via RTMP Show All FCS Help Files

This example demonstrates the file structure required for a SharedObject in Flash Communications Server. Use this as a guide to making additional shared objects. This example creates a simple web counter in Flash. Below is the ActionScript for frame 1 of your script. All that's required on the main stage is a dynamic text box called "displayText". Place a dynamic text box on the stage and name the variable "displayText". Publish and test your movie. The first time you run it you see the number 1. Reload the swf and it says 2. Reload again and it says 3. You'll have to guess what happens if you load it again. Since we set our third getRemote parameter to true, the counter value will persist on the server.


myNC = new NetConnection();
myNC.connect("rtmp://66.216.97.115/UserName/cnt");
mySO = SharedObject.getRemote("counter",myNC.uri,true);
mySO.connect(myNC);
myNC.onStatus = function(info) {
trace("Level: " + info.level + newline + "Code: " +  info.code+":");
}
mySO.onSync = function(sync) {
goUp();
}
function goUp(){
mySO.data.count = (mySO.data.count*1)+1;
displayText = mySO.data.count;
ad++;
if (ad > 1){mySO.close();}
}

Publish and run this example movie twice. When you do so, FCS creates a folder in your main FTP folder called "sharedobjects". Inside of the sharedobjects folder is another folder called "cnt". Inside of "cnt" is a data file called "counter.fso". This file and the folder's mentioned are automatically created by FCS when you run the app the first time.

Contact Metasphere.net


Add Page to favorites/bookmarks.