Forums  

Go Back   Forums > Talk > General FPP Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 11-07-2007, 06:38 PM
360DegreeViews 360DegreeViews is offline
Junior Member
 
Join Date: Jul 2007
Posts: 11
Downloads: 0
Uploads: 0
Default Help with controller and loading new xml file

I'm having trouble when attempting to load a new pano using controller.swf. I can get things to work fine when NOT loading a new xml file, but when I try to load a new xml file with each pano, only the first one will load, then the controller becomes inoperative (I can select entries, but nothing happens).

Each pano's xml file contains the same controller hotspot but other hotspots are different, thus the need for a new xml file with each newly loaded pano. In controller.fla, I have the usual:

_lc.send(masterSlot, "execute", "loadPano(?panoName="+name+",2000,stripes);");

where the 'name' comes from the data associated with the drop down control:
label:Exterior 1; data: flash/ext1.swf&xml_file=flash/ext1.xml
label:Exterior 2; data: flash/ext2.swf&xml_file=flash/ext2.xml
label:Exterior 3; data: flash/ext3.swf&xml_file=flash/ext3.xml
etc. etc.

The xml file for each pano contains the same lines:
<global LocalConnectionID="lc_test" >
<spot id="controller" static="1" salign="RT" align="RT" staticX="-3" staticY="3" url="flash/controller.swf" />

When I first tried this, I got a lot of errors about sendQuery and a null object during the transition time. I assume it's something with the controller going away when the new pano loads. I tried to solve this by adding a
timer.stop();
right before the execute of the loadpano. That made the flash errors go away, but I'm still stuck with a non-functioning controller after the new pano loads, and I can't load any other panos. What am I doing wrong? Can a series of controller-loaded panos share the same controller.swf hotspot?

Thanks for any help.....I'm stuck.

Bob S.
Reply With Quote
  #2  
Old 11-07-2007, 11:24 PM
zleifr's Avatar
zleifr zleifr is offline
Senior Member
 
Join Date: May 2007
Posts: 609
Downloads: 0
Uploads: 0
Default

I believe this is the same problem:

http://flashpanoramas.com/forum/showthread.php?t=482

and that is a solution.
Reply With Quote
  #3  
Old 11-08-2007, 03:29 PM
360DegreeViews 360DegreeViews is offline
Junior Member
 
Join Date: Jul 2007
Posts: 11
Downloads: 0
Uploads: 0
Default

Thanks for the suggestion, but that's not it. I still think it has something to do with unloading/loading the same controller for the panos while it (the controller code) is still active.

Without the timer.stop() call right before the execute loadpano() call in the controller, when I select a new pano, I get these error messages in a Flash 9 popup window every 1/2 second:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at controller_fla::MainTimeline/sendQuery()
at flash.utils::Timer/flash.utils:Timer::_timerDispatch()
at flash.utils::Timer/flash.utils:Timer::tick()

They keep coming until I say "dismiss all". At that point the controller is non-functional. I can select entries in the dropdown, but nothing happens.

Again, the controller works just fine if I take the &xml_file=xxxx.xml off of the data values in the combo box. As soon as I add the &xml_file parameter, I can load one pano, but no more.

Is there some way to disconnect the linkage between the pano and the controller flash code just before loading the new pano, and then re-establish the connection with the next pano? It seems like that should be happening automatically, but it doesn't appear to be working that way for me.

Thanks
Bob.
Reply With Quote
  #4  
Old 11-08-2007, 09:10 PM
zleifr's Avatar
zleifr zleifr is offline
Senior Member
 
Join Date: May 2007
Posts: 609
Downloads: 0
Uploads: 0
Default

I don't know why this would fix it, but this is what you asked for.

There is no linkage between the fpp and the controller per se. What there is a established "listener" for messages on both sides. This is established with the connect() command on the localConnection object. Controller listens on slaveSlot and fpp listens on masterSlot.

Stopping and restarting the "listener" in the controller is not too complicated:

at the end of loadPano function add this code:
timer.stop()
timer.removeEventListener(TimerEvent.TIMER, sendQuery);
timer = null; //I believe null is the right value, or it is undefined
_lc.close();
_lc = null;

Then up at the top where it establishes the connection, find this code:
var dumpSlot = controllerName+"_dump_"+Math.random();
var _lc:LocalConnection = new LocalConnection();
_lc.allowDomain("*");
_lc.connect(dumpSlot);
_lc.addEventListener(StatusEvent.STATUS, onStatus);
_lc.client = this;
and replace it with this:
var dumpSlot:String;
var _lc:LocalConnection;
startLocalConnection();
function startLocalConnection() {
dumpSlot = controllerName+"_dump_"+Math.random();
_lc = new LocalConnection();
_lc.allowDomain("*");
_lc.connect(dumpSlot);
_lc.addEventListener(StatusEvent.STATUS, onStatus);
_lc.client = this;
}

So what you have done is after the command is sent to load the pano, you nullify and remove everything which has been set up: the localConnection listener, _lc; the timer; and the timer eventListener, and then you call startLocalConnection to restart the connection.

Resetting the connection in FPP:
First off, this may not be necessary, and it may be simpler not to restart it here too. Since we don't have control over fpp's code, I can only tell you that I am pretty certain that putting this in the <global> section will reset the localConnection listener there:
onNewPano="LocalConnectionID=lc_test"

or you might try this:
onNewPano="LocalConnectionID=;LocalConnectionID=lc _test"

And finally, you might need to set up a timer to wait a bit before restarting the localConnection in your controller, because the localConnection might still be setting itself up in FPP....
Reply With Quote
  #5  
Old 01-30-2008, 11:09 PM
cbc's Avatar
cbc cbc is offline
Junior Member
 
Join Date: Sep 2007
Posts: 27
Downloads: 0
Uploads: 0
Default Help !!!

Hello,

I have the same problem and am unable to implement your solutions. Could you put an exemple of such controller_as3 loading multiple pano.xml. For me it deadlock after hours of testing.

Thank you for all your responses,
Sincerely,
Cbc.

Reply With Quote
  #6  
Old 01-31-2008, 04:01 PM
360DegreeViews 360DegreeViews is offline
Junior Member
 
Join Date: Jul 2007
Posts: 11
Downloads: 0
Uploads: 0
Default

I was never able to make the controller work the way I wanted it to, loading a new xml file with each pano. I finally resorted to using hotspot buttons to load new panos instead of the controller, and it does load a new xml file with each pano, doing something like this for the hotspot:

Code:
loadPano(panoName=flash/pano&xml_file=flash/Outside1_l.xml,1000,coverDown);
I think others have made the controller work (and load a new xml file with each pano), but I couldn't figure it out.

Bob S.
Reply With Quote
  #7  
Old 01-31-2008, 04:25 PM
cbc's Avatar
cbc cbc is offline
Junior Member
 
Join Date: Sep 2007
Posts: 27
Downloads: 0
Uploads: 0
Default There must be a solution!

I want from an as2 swf to load different views from their XML file. It is possible as3 in embedPano for example:

panorama.externals.hotspots.loadPano(xml_file=pano 1/pano.xml);

I would like to also know the solution to recharge the "LocalConnection" so that the controller works once a new xml loaded.

I can not get the solutions proposed by "Zleifr."

I hope you can help me.

Thank you!

Reply With Quote
  #8  
Old 01-31-2008, 07:35 PM
Scott Witte's Avatar
Scott Witte Scott Witte is offline
Senior Member
 
Join Date: Sep 2007
Location: Milwaukee, WI USA
Posts: 593
Downloads: 0
Uploads: 0
Default

Quote:
Originally Posted by zleifr View Post
So what you have done is after the command is sent to load the pano, you nullify and remove everything which has been set up: the localConnection listener, _lc; the timer; and the timer eventListener, and then you call startLocalConnection to restart the connection.
Zephyr,

I wonder about this (Fully acknowleging that you know several thousand times more than me on the subject ) I noticed that on loading new xml all existing hotspots end up getting unloaded and then all hotspots in the new xml get loaded, or reloaded as the case may be. So... if you call startLocalConnection as part of your "remove" function local connections will be re-established, then the controller gets unloaded with those connections still intact just as if you never removed them. When the controller gets reloaded it will attempt the startLocalConnection as part of its initialization only to find the connections are already taken and therefore fail.

My suspicion is that it might work if you don't call startLocalConnection as part of your unloading process.

At least, that is what I seemed to find in my Flash journeys. But it all got very messy which is a big part of why I have dumped local connections in favor of direct calls and am so glad I did.
__________________
Scott
Tour de Force 360VR
Scott Witte Photography
----------------------
Auto Quality Plugin: Guarantee the best FPP experience possible for every viewer on every computer.
Motion Zoom Transition Plugin: Move from Node to Node
Reply With Quote
  #9  
Old 03-13-2008, 03:23 PM
Virtualguide's Avatar
Virtualguide Virtualguide is offline
Senior Member
 
Join Date: Sep 2007
Posts: 224
Downloads: 2
Uploads: 0
Default

Hi all FPP panoramers
Seems that I met the same problem here:
http://flashpanoramas.com/forum/show...ted=1#post5862

So I just tried to change
LocalConnectionID="lc_test" to be unique for both each .xml and corresponding controller_as3.swf (You are to find in actions in controller_as3.fla the LocalConnectionID="lc_test" and rename it ...)

e.g.>
01.xml -> LocalConnectionID="lc_test1"
.
.
.
10.xml -> LocalConnectionID="lc_test10"

Now the FPP understand them as unique and controller works OK!

Regards,
Igor
Reply With Quote
  #10  
Old 03-14-2008, 11:07 AM
cbc's Avatar
cbc cbc is offline
Junior Member
 
Join Date: Sep 2007
Posts: 27
Downloads: 0
Uploads: 0
Default Still no solution ...

Virtualguide Hello,

I do not understand your explanation. Can you develop?

Thank you,
Cbc.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 10:42 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.