Problems with Remote Shared Object
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Macromedia Flash Server > Problems with Remote Shared Object




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Problems with Remote Shared Object  
Airton Toyansk


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
05-01-05 01:45 AM

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






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:32 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register