![]() |
|
#1
|
||||
|
||||
|
In the tour I'm building you can arrive at any pano by either the controller (combobox) or hotspot links. If you jump there by controller the correct panorama name (label) is displayed. If you arrive by hotspot the controller continues to display the last pano it jumped to. It just looks amateurish to have the combobox display "Entrance" when you are actually in "Auditorium".
Additionally, lets say you are in "Auditorium" and want to return to "Entrance" directly via the controller, but controller still list "Entrance". When you click Entrance controller essentially says, "What? According to my records we are still in Entrance so sorry, I just won't do that!" This should be easy to fix for someone with actionscript skills. I can see where controller.swf queries flashpano every half second for the current panoName. It stores that in a variable. It should be easy for controller to compare that variable to the panoName it lists and if different, change the label to the correct one. Alas, I know nothing about actionscript so I'm at a loss how to do this. But this minor challenge could be a real coup for someone who can understand this strange language. Any takers????? Please???
__________________
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 |
|
#2
|
|||
|
|||
|
Hi Scott:
If you're using the controller example as supplied with FPP, you should experience "normal" behavior where the correct pano name is displayed in the combo box (whether you get there via hotspot or dropdown). Denis pre-coded it so it "sniffs" the pano name, and adjusts accordingly.
__________________
Patrick http://cheathamlane.net -- Tutorials: Embed Pano 101, Pano auto-presentation |
|
#3
|
||||
|
||||
|
Quote:
To work properly controller should compare only the data up to the & with panoName. Or is there another solution? I bet Denis could fix it in a Flash, being as AS3 is his "first language" ![]()
__________________
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 |
|
#4
|
|||
|
|||
|
Hi Scott:
The controller as scripted _does_ only read in the panoName (and not other parameters past the & symbol). If you're putting images in a subfolder or other places, then the panoName might read something like "images/subfolder/coolPano/coolPano". In the controller.fla, the data for a certain pano would then read "images/subfolder/coolPano/coolPano". You can either hardcode this pano name in the data, or use AS to parse it together for you. For small projects, I just hardcode it. Without seeing your FLA, it's hard to say where the issue is -- but the controller.fla example _as written_ works just fine, when you feed it proper panoName info that jibes across the controller's data and what you're loading in. If you aren't using it, I suggest you download a "debug" version of the Flash player, and then sephiroth's Flash Tracer for Firefox. This is a huge help when trying to trace out scripting issues in the browser. Search for sephiroth's Flash Tracer; it's also linked to from a post in the forums here (I forget where).
__________________
Patrick http://cheathamlane.net -- Tutorials: Embed Pano 101, Pano auto-presentation |
|
#5
|
|||
|
|||
|
Hi Scott,
I believe you are on the right track in fixing this. Your problem is that the data element in the controller is not matching the panoName because you are stuffing the data element with additional parameters. I can't verify this completely, but I believe Patrick is correct in saying this should be working fine, but I believe it will work fine only if you are passing ONLY the panoname (with path info) without any additional parameters (panhome, etc). (I haven't verified it, and I may be wrong here... but this is what I see in reading the code) I'd suggest a slightly different approach than you suggest above... You basically just want to verify whether panoName is in your data string from your controller. The indexOf() function should do the trick. Just search the data string from the controller for the existence of panoName. If panoName doesn't exist, it will return -1. Otherwise, it will return a positive integer which is the offset into the datastring where panoName is found. It's tough to know without testing, but here are the changes I'd try: 1) at the top of the callback function, I add two string vars to be sure the compiler interprets my calls as being from two string vars: var tempstring1:String; var tempstring2:String; 2) Substitute the following 2 lines for the first if statement: tempstring1=_cb.selectedItem.data; if(tempstring.indexOf(panoName)> -1) { 3. the 2nd if statement below, should be replaced by the following 2 lines: tempstring2=_cb.getItemAt(i).data; if(tempstring2.indexOf(panoName)>-1) { That's it... give it a try... can't guarantee it will work, but it should get you close... <gary> |
|
#6
|
|||
|
|||
|
Gary & Scott:
I really think you guys are overthinking it... http://www.swainsart.com/flash/office.html The example at the link above opens a page with links. Each link lets you open one of the panoramas in the tour directly, at its own Web page. When the page/pano loads, the controller goes to the appropriate choice. If you view source, you'll see that I'm passing a whole host of information via the URL. For example: Code:
<script type="text/javascript">
var thePanoFiles;
thePanoFiles = "_files/pano.swf?panoName=Office/Office/Office&panHome=-47&tiltHome=-12&zoomHome=0.57&xml_file=Office/Office.xml&";
</script>
<script type="text/javascript" src="_files/swfobject.js"></script>
</head>
<body>
<!--<script type="text/javascript" src="files/swfobject.js"></script> -->
<div id="flashcontent">This content requires <a href="http://www.adobe.com/go/getflashplayer/">Adobe Flash Player</a> 9. Please, visit <a href="http://www.adobe.com/go/getflashplayer/">adobe.com</a> to install it</div>
<script type="text/javascript">
var so = new SWFObject("_files/show_pano.swf", "pano", "100%", "100%", "6.0.65", "#282828");
so.addVariable("movie", thePanoFiles);
so.addVariable("redirect", window.location);
so.addVariable("xml_file","_swains.xml");
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.write("flashcontent");
window.document["pano"].focus();
</script>
</body>
If you're using the Flash Tracer add-on for Firefox (or a similar debugger), you'll be able to watch the calls get made as you load the page and/or panoramas. -- Now, if the problem is that in the controller you're putting extra parameters on the end of the data... Hmm. You need to break it up into pieces, then put it all back together. This would be my approach, anyway. In my controller, the data for the above example looks like "Office/Office/Office". If you're appending extra parameters to the end of your data, then maybe it looks like "Office/Office/Office&panHome=247". In this situation, I'd place a switch statement inside your loadPano call in the controller. For example: Code:
function loadPano(name) {
//case = panoName (data from controller)
switch (name) {
case "Office/Office/Office" :
myExtraParam_pan = "-256";
break;
case "Paints/Paints/Paints" :
myExtraParam_pan = "180";
break;
case "Pens/Pens/Pens" :
myExtraParam_pan = "32";
break;
default :
myExtraParam_pan = "0";
}
if (masterSlot != null) {
_lc.send(masterSlot,"execute","pano.leash=free;loadPano(?panoName="+name+"&panHome="+myExtraParam_pan+",3000,none);");
}
}
? This is a fairly easy way to do things, but slightly more difficult to extend if you do a bunch of different tours. Another approach would be to use a second (or additional) XML file for each panorama. This is much easier to maintain and alter than it is to re-render out your SWF everytime you make a change. In the above example, instead of passing the "panHome" parameter, you could pass the "xml_file" parameter. In this case, I'd use AS in the SWF to truncate the panoName parameter into something more filename-friendly. Then, outline all your "panHome" and "tiltHome" and etc parameters in the XML file. so your loadPano call would end up looking something like: Code:
_lc.send(masterSlot,"execute","pano.leash=free;loadPano(?panoName="+name+"&xml_file="+truncatedName+"/"+truncatedName+".xml"+",3000,stripes);"); Code:
_lc.send(masterSlot,"execute","pano.leash=free;loadPano(?panoName=Office/Office/Office&xml_file=Office/Office.xml"+",3000,stripes);"); ![]()
__________________
Patrick http://cheathamlane.net -- Tutorials: Embed Pano 101, Pano auto-presentation Last edited by cheathamlane; 09-16-2007 at 10:05 PM. Reason: added a thought |
|
#7
|
|||
|
|||
|
I edited the above, so it may have changed since your email notifications.
__________________
Patrick http://cheathamlane.net -- Tutorials: Embed Pano 101, Pano auto-presentation |
|
#8
|
||||
|
||||
|
Quote:
You can verify here: Entrance Data element for Entrance is "Entrance". For Reception it is "Reception&panHome=55". (No further path needed in this test.) Use the controller to move from Entrance to Reception. "Reception" is displayed as the label. Use the hotspot to move back to Entrance and the lable changes to "Entrance". NOW, use the hotspot to move to Reception. The label doesn't change. Further, if you use controller to move to Entrance nothing happens. (Already there, it thinks?) But use controller and select Reception and Reception gets reloaded. Quote:
Patrick, I'd like to followup on the debug issue in another thread. Thanks both of you! Your knowledge and experience is very helpful.
__________________
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 |
|
#9
|
|||
|
|||
|
Quote:
But, again, I think it's overthinking the issue. If you read thru and/or try out some of my suggestions, I think your issue may go away. ![]() Quote:
Cheers
__________________
Patrick http://cheathamlane.net -- Tutorials: Embed Pano 101, Pano auto-presentation |
|
#10
|
||||
|
||||
|
Patrick,
I expect your approach would work and may be easier for a one off. But it may be harder for the majority of people and might get more awkward as your tour gets larger. It may be easily broken. Are trailing spaces automatically truncated, for instance? If not that would be a problem and debugging would be difficult. Back in the day you had a rule that data stayed in data and process stayed in code as much as possible, for good reasons. Your first solution puts a lot of data in the code. Your XML solution keeps them separate (and personally I like better), at a small performance hit for opening and loading more files. Here, too, things get a bit awkward as the tour grows and it ends up like a database with a separate file for each record, whereas they should all be kept in one file. So, except for some easier upfront coding (not to be dismissed), I'm not sure your solution would remain the easiest. But I definitely appreciate where you are coming from.
__________________
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 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|