Macromedia Flash Server - Problems with Remote Shared Object

This is Interesting: Free IT Magazines  
Home > Archive > Macromedia Flash Server > April 2005 > Problems with Remote Shared Object





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 Problems with Remote Shared Object
Airton Toyansk

2005-04-30, 8:45 pm

Hi, everyone!

I'm having problems with RSO.
In my application, there're buttons that load others files, using RSO, like
this:

File1.swf
=============================

var main_nc;
var myload;

main_nc = new NetConnection();
main_nc.onStatus = function(info) {
trace(info);
if (info.code == "NetConnection.Connect.Success") {
trace("connected");
init();
}
};

main_nc.connect("rtmp:/sample_panel_presentation");
function init() {
col_so = new SharedObject();
col_so = SharedObject.getRemote("col", main_nc.uri);
col_so.connect(main_nc);
trace("hello");
//OK, this is the thing that recieves the load movie
//this will update all clients as the load action goes through the onSync
//function instead of the onRelease of the buttons
col_so.onSync = function(list) {
trace("has hit");
if (col_so.data.myload != null) {
myload = col_so.data.myload;
if(myload == 1){
movieHolder_mc.loadMovie("testeSwf.swf");//in the broadcaster's
file
holder_mc.loadMovie("testeSwf2.swf");//in the viewer's file
}else if (myload == 2){
movieHolder_mc.loadMovie("movie2.swf");
holder_mc.loadMovie("movie4.swf");
}else if (myload == 3){
movieHolder_mc.loadMovie("movie3.swf");
holder_mc.loadMovie("movie5.swf");
}
col_so.data.myload = null;
}
};
col_so.connect(_root.main_nc);
}

//Buttons actions

btn1.onRelease = function() {
col_so.data.myload = 1;
};
btn2.onRelease = function() {
col_so.data.myload = 2;
};
btn3.onRelease = function() {
col_so.data.myload = 3;
};

But each one of these loaded files are just like the PresentationSWF
component. They have this code:

Loaded Files
========================

var main_nc;
var myapp;

main_nc = new NetConnection();
main_nc.onStatus = function(info) {
trace(info);
if (info.code == "NetConnection.Connect.Success") {
trace("connected");
init();
}
};

main_nc.connect("rtmp:/app_presentation");
function init() {
app_so = new SharedObject();
app_so = SharedObject.getRemote("app", main_nc.uri);
app_so.connect(main_nc);
trace("hello");

app_so.onSync = function(list) {
trace("has hit");
if (app_so.data.myapp != null) {
myapp = app_so.data.myapp;
if(myapp == 21){
_root.movieHolder_mc.conteudo.gotoAndStop(1);
_root.holder_mc.demo.gotoAndStop(1);
_root.movieHolder_mc.gotoAndStop(1);
}else if (myapp == 22){
_root.movieHolder_mc.conteudo.gotoAndStop(2);
_root.holder_mc.demo.gotoAndStop(2);
_root.movieHolder_mc.gotoAndStop(2);
}else if (myapp == 23){
_root.movieHolder_mc.conteudo.gotoAndStop(3);
_root.holder_mc.demo.gotoAndStop(3);
_root.movieHolder_mc.gotoAndStop(3);

}
app_so.data.myapp = null;
}
};
app_so.connect(_root.main_nc);
}

But this "second moment" didn't work...
What's wrong in this code?
How can I do it right?

Thanks in advance for helps,

Airton Toyansk.

________________________________________
_________________________
MSN Messenger: instale grátis e converse com seus amigos.
http://messenger.msn.com.br


=-----------------------------------------------------------
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