PDA

View Full Version : Controller should always display current pano name. Any AS3 gurus?


Scott Witte
09-16-2007, 02:39 AM
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???

cheathamlane
09-16-2007, 02:58 PM
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.

Scott Witte
09-16-2007, 06:36 PM
Denis pre-coded it so it "sniffs" the pano name, and adjusts accordingly.

OK. I see the problem but not a workaround. The data field in the controller property must exactly match panoName for this to work. But I add positioning instructions so the pano doesn't open to some random place. For example, "Images\Entrance&panHome=150". Obviously this isn't equal to the the value controller gets from FPP for panoName.

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" ;)

cheathamlane
09-16-2007, 07:18 PM
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).

Gary
09-16-2007, 09:21 PM
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>

cheathamlane
09-16-2007, 09:55 PM
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:


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


You can also load the rest of the panoramas by using the dropdown menu, removing the need to load different Web pages.

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:

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 lets your panoName match up every time with the data in your controller, and lets you append whatever you want to it when you make the loadPano call.

?

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:


_lc.send(masterSlot,"execute","pano.leash=free;loadPano(?panoName="+name+"&xml_file="+truncatedName+"/"+truncatedName+".xml"+",3000,stripes);");

Where in my case the XML's filename would be "Office/Office.xml", and the hardcoded call would look like:

_lc.send(masterSlot,"execute","pano.leash=free;loadPano(?panoName=Office/Office/Office&xml_file=Office/Office.xml"+",3000,stripes);");

Easier, IMHO. :)

cheathamlane
09-16-2007, 10:14 PM
I edited the above, so it may have changed since your email notifications.

Scott Witte
09-16-2007, 10:26 PM
I can't verify this completely... but I believe it will work fine only if you are passing ONLY the panoname (with path info) without any additional parameters (panhome, etc).

Gary,

You can verify here: Entrance (http://www.scottwitte.com/temp/Flash_Test/Entrance.html)

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.

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.

I'm not sure. Consider if you have two panoNames, "Pano" and "Pano1". Although they are unique both return true if you just search for existence of "Pano". (Effectively it would be the first matching instance that would return true, I expect.) So, your solution would probably work 95+% of the time but maybe not 100%?

Patrick,

I'd like to followup on the debug issue in another thread.

Thanks both of you! Your knowledge and experience is very helpful.

cheathamlane
09-16-2007, 10:42 PM
I'm not sure. Consider if you have two panoNames, "Pano" and "Pano1". Although they are unique both return true if you just search for existence of "Pano". (Effectively it would be the first matching instance that would return true, I expect.) So, your solution would probably work 95+% of the time but maybe not 100%?


Well, in the Flash help, do a search for "Pattern matching" or "regular expressions". One way to think about it is to search for things which surround what you want to match -- that is, if you have "panoName=blah&xml_file=...", then you'd search for any-number-of-characters that exist between "panoName=" and "&".

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. :)


Patrick,

I'd like to followup on the debug issue in another thread.

No problem -- there's already one or two forum posts about it here...

Cheers

Scott Witte
09-16-2007, 11:12 PM
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 Witte
09-16-2007, 11:24 PM
... then you'd search for any-number-of-characters that exist between "panoName=" and "&".


Which is exactly what I was thinking in my very first suggestion... or at least what I think I was thinking :confused:

The thing is, I'm a total AS noobie and not sure I want to become an expert. My original post was intended to entice one of you AS gurus to make a small change that would benefit the entire community. Fame and fortune, or at least brownie points would surely follow:rolleyes:

cheathamlane
09-16-2007, 11:57 PM
Hey Scott:

Yeah, there's always as many ways to skin a cat as it has lives, no? ;)

Regarding things being difficult for folks -- My thinking is that FPP isn't wholly a one-stop shop. Denis has layed the groundwork for us, and left it so that we can create our own plugins (basically what we're doing with modifications to the combobox/controller). That means we gotta use Flash and do some coding. FPP can't anticipate every need or idiosyncracy that might crop up.

re: trailing spaces -- Not sure. It depends on where you mean. :) I'm pretty sure that Denis strips all whitespace, but that Flash automatically is URL encoding what's inside a parameter.

Back in the day? I think that's still a good rule. ;)

If you really want to create something that is duplicatable with minimal re-rendering of SWFs or re-coding in the Flash environment, then you will almost certainly have to rely on external XML files.

Yet another approach would be to add your own set of elements to your panorama's XML file, which FPP will simply ignore, or create a separate XML file. You could have the combobox SWF then read in the XML and parse it out to populate your combobox's data on-the-fly. There's stock examples for using XML and doing on-the-fly population right in the Flash help.

Say:

<myArbitraryTour>
<metadata subfolder="somefolder" />
<panos>
<myCoolPano label="blah" data="someName" extraXML="myXMLfile" initialPan="200" initialTilt="-13" initialZoom=".78" />
<myCoolPano label="blah2" data="someName2" extraXML="myXMLfile2" initialPan="300" initialTilt="13" initialZoom=".78" />
<myCoolPano label="blah3" data="someName3" extraXML="none" initialPan="100" initialTilt="-13" initialZoom=".78" />
</panos>
</myArbitraryTour>

Sorry, I'm on deadline with project requiring me to do scripting in both QuickTime and Flash, so I'm in problem solving mode. :)

cheathamlane
09-17-2007, 12:01 AM
The thing is, I'm a total AS noobie and not sure I want to become an expert. My original post was intended to entice one of you AS gurus to make a small change that would benefit the entire community. Fame and fortune, or at least brownie points would surely follow:rolleyes:

Hah, gotcha... Well, as I can when I can. Hopefully my last post with all the examples/code will help nudge someone in the right direction. Or nudge someone else to show me what I'm doing all wrong. :P

I'm pretty active in the various development forums that pertain to what I do. It's always a fine line between helping out a comrade, and consulting. ;)

Cheers

Gary
09-17-2007, 01:01 AM
Hi Guys,
I'm becoming increasingly less sure that this is going to be cleared up in a forum format. In the controller, I modified it so I could populate it with all parameters via an XML file for the controller. This way I could set pan, tilt, zoom, brightness, contrast, hue, and virtually every parameter, with timing information as when invoked by the user via thecontroller... I had to rewrite a line of Denis' code to in loadpano call to do this. I basically deleted everthing after the word "execute" and dumped the data string from the controller into the 3rd parameters of the _lc_send call. For me, this approach provided a way to load any number of panoramas into the controller with parameters without having to ever recompile the controller. That's why I did it.

Scott, perhaps I wasn't clear, but I agreed that your system didn't update the controller properly. I was just taking a stab at fixing it... perhaps one that didn't work. Did you try the changes I suggested?

Patrick, I haven't checked your code to see whether you're able to set all of the parameters I mention above in your XML file for any number of panoramas while using the controller. Or, perhaps this combination isn't one you've wanted or needed to implement. At any rate, I could never find a reliable way to set parameters and have them work properly with the controller without making the changes I've outlined in these posts.

At any rate, I wish you both the best of luck with these issues.

Regards
<gary>

cheathamlane
09-17-2007, 01:03 AM
Hey Gary:

And yet another approach. ;)

Have a FLA to post, in the spirit of camaraderie? I'd be curious to see what you rewrote in the controller.

Cheers

Scott Witte
09-17-2007, 01:45 AM
In the controller, I modified it so I could populate it with all parameters via an XML file for the controller.

Gary,

Brilliant! That brings everything together in the easiest, most flexible way -- one XML file loaded once. A snap for anyone to modify. Essentially you have three fields to work with: label, panoName and parameters rather than combining panoName with parameters. That eliminates all the problems. I'm curious how you load data from the file into the controller.

Like Patrick I would love to see what you've done and, ahem, would dearly love to use it.... If you were in a mood for sharing.

Regardless, nice thinking.

Gary
09-17-2007, 04:05 PM
Hi Guys,

In the spirit of sharing, here is how i got the controller work from an external XML file. Also, it supports passing any additional parameters you wish in the data element of the controller... It took considerable effort for me to find the right combination... after the fact it seems completely obvious...

I'll outline everything in 3 steps:

1. MODIFY THE LOADPANO FUNCTION IN THE CONTROLLER: Here is my revised loadpano function... it enables me to pass anything I want thru the controller.
// load new panorama:

function loadPano(name) {
if (masterSlot != null) {
_lc.send(masterSlot, "execute", name);
}
}

2. CREATE AN XML FILE
I use only the two standard data elements in the controller: label and data.

A sample xml file looks like this:

<?xml version="1.0" encoding="utf-8"?>
<panoparams>
<item label="Frontyard" data="pano.leash=free;loadPano(?panoName=vt1&panHome=45.2)" />
</panoparams>

Note that you can additional parameters in the data variable above provided that you precedd them by an '&' character.

3. USE THE FLASH 8 (Actionscript 2) xmlConnector component to populate the controller with the XML data.

Perhaps the easiest way to get the xml file read is to use the Flash 8 xmlConnector component (Flash CS3 doesn't have the controller and requires actionscript). This won't require any programming. It takes a little digging,but there is FLASH online help on this component. To see it, select Flash Help, select actionscript 2 components, then help for the xmlConnector component. Additionally, Chapter 34 of the Flash 8 Bible has an excellent example of this which describes the process of data binding. Go thru their example if you run into trouble.

Finally, this doesn't cover how to keep the hotspots in sync with the controller as Scott requested initially. However, I believe the code changes I mentioned previously in this thread will either work or at least get you close... I'm not using hotspots, so I haven't had a need to support this.

I realize there are a number of steps in putting this together, but it makes for a good general case solution for the controller.

<gary>

Scott Witte
09-17-2007, 08:05 PM
Gary,

Thanks for sharing! While still brilliant, it isn't quite what I was hoping for, as you say.

For my purposes it might be better to use a little more sophisticated version of the pattern matching you suggested, along the lines of what Patrick suggested.

Now, if I were to do this using my old school knowledge, I would set up a three field data array (Do they still call them data arrays in Flash?) consisting of Label, PanoName and Parameters. All the code of the controller would stay the same, I think, except you need to modify the loadPano line. Very simple.

Currently controller has a two field array. Is it possible to make it three field in the Flash code or is that hard wired into the combo box code?

Gary
09-17-2007, 08:28 PM
Hi Scott,

I fail to see any advantage in what you're suggesting. My earlier code in this post will search any string in the controller's data field for a panoname match. Everything needs to be passed in a single _lc_send call anyway, so why break it up? Another very old school concept... if the car runs, don't fix it.

Seriously, the controller, of course, can be reprogrammed. There's always more ways than one to skin a cat... the only price of admission is to know how to program in actionscript.

Good luck in your programming endeavors.

<gary>

cheathamlane
09-17-2007, 09:05 PM
For my purposes it might be better to use a little more sophisticated version of the pattern matching you suggested, along the lines of what Patrick suggested.

Now, if I were to do this using my old school knowledge, I would set up a three field data array (Do they still call them data arrays in Flash?) consisting of Label, PanoName and Parameters. All the code of the controller would stay the same, I think, except you need to modify the loadPano line. Very simple.

Currently controller has a two field array. Is it possible to make it three field in the Flash code or is that hard wired into the combo box code?

Well, this brings us back almost full circle. :)

If you go the route of using an external XML file to "outline" your tour and its individual panoramas' parameters, why don't you just parse the XML?

The XML file can be a human-readable way to organize your information, and you can use AS to parse it into whatever you want. You'll read in the XML, parse the individual parameters, then pass these parameters to the loadPano function. This is what I was hinting at in earlier posts.

You can reference my previous XML examples for a way to structure things, or Gary's XML example. If you go with something based on Gary's latest, then you could use something like the below to break it apart.

//look up "decode" in Flash help
var my_parameters_from_xml: Object = new Object();
//Convert the variable string to properties
my_parameters_from_xml.decode("panoName=vt1&panHome=45.2");
trace(my_parameters_from_xml.toString());
// Iterate over properties in my_parameters_from_xml
for (var prop in my_parameters_from_xml) {
trace(prop+" -> "+ my_parameters_from_xml[prop]);
}


But, really, this approach limits you.

You can use arrays in Flash (called arrays), or you can simply iterate through the XML. Think of the XML as an array. :) In my example, an example of Key/Value pairs would be "label" and "blah". The controller takes only Data and Label, but you don't need to have other fields in the controller -- all you need is to assign your information (value) to a key (attribute in the xml), then using AS concatenate the keys/values in your loadPano function (using the + signs).

Also, moving to AS3 would be recommended because the dot syntax is easier. You can use the dot syntax to access your arrays, xml, whatever.

This is all of course hugely off-topic of the original issue in this thread (combobox not reflecting name of current pano), but there you go. ;)

Scott Witte
09-17-2007, 09:33 PM
Patrick and Gary,

You guys have been extremely generous with your time and knowledge, especially since you are putting up with a guy who knows just a sliver more than nothing about AS. :( There are several approaches that could work. Doing any of them just require more AS skill. Guess I'll have to learn more anyway....

Oh, for anyone who doesn't know, Denis wrote an AS3 version of controller. He says there are "just a few changes". The most promising aspect to me may be that the components appear to be (more) editable so I can change its look -- I think.

Find it here:

Again, Thanks!http://flashpanoramas.com/player/sources/controller_as3.zip

cheathamlane
09-18-2007, 01:46 AM
Oh, for anyone who doesn't know, Denis wrote an AS3 version of controller. He says there are "just a few changes". The most promising aspect to me may be that the components appear to be (more) editable so I can change its look -- I think.

Find it here:

Again, Thanks!http://flashpanoramas.com/player/sources/controller_as3.zip

Ah, cool -- would've been nice to know about that before writing an AS2 example to post here! :-P

Thanks for the link...

(oh, I see -- the file's not functionally different, just AS3 friendly)

Gary
09-18-2007, 03:17 PM
Scott, Patrick,

Perhaps we've about beat this to death, but I thought I take one final step and provide what Scott's to to finish up here. No program changes are needed to the controller to support virtually any xml schema that you wish. If you use the Flash 8 xmlConnector, there is a step in the data binding process in which Flash automagically deciphers the schema for the XML file which is bound to the controller instance. This need be done only once when you initially start using the xmlConnector. (I knew of the AS3 version of Denis' controller, but didn't use it because flash 9 doesn't support an xmlConnector component and requires more programming)

The following XML would add 3 fields to the controller: label, data and mytext:

<?xml version="1.0" encoding="utf-8"?>
<panoparams>
<item label="Frontyard" data="vt1" mytext="This is the frontyard"/>
</panoparams>

<gary>

Scott Witte
09-18-2007, 05:09 PM
Gary,

You have never beat something to death if you continue to move forward... or something pithy like that.

Thanks for this programing insight! AS is still all Greek to me, without the benefit of Google Translate to turn it into rough English :( But slowly I am picking up a glint of understanding now and then so maybe I'll be able to blend some of your and/or Patrick's suggestions into a version of controller that works better for me (and hopefully for some others). Heck, I somehow hacked through "fixing" FPP's MP3Player. (And I do mean hacked!)

Just to be sure, could I use Denis's "AS3" version of controller with xmlConnector and just export it as Flash 8? Or must I start with the original controller?

Gary
09-18-2007, 05:31 PM
Hi Scott,

AS3 doesn't support the XMLConnector, because starting in Flash3, Adobe started checking for errors in XML files (a good idea). The FLash 8 XMLConnector component, as I mention before, is handy as an extremely fast,intuitive way to integrate XML data into apps without programming. Importing XML files in AS3 requires programming and is more involved.

It means that you need to use Denis' Flash 8 (AS2) controller instead of the AS3 controller that he subsequently resleased if you want to use the XMLConnector component.

<gary>

Scott Witte
09-24-2007, 03:14 PM
For anyone still interested, I came up with a nearly clever and certainly easy stopgap solution to my problem. I changed the pano loading code like so:
_lc.send(masterSlot, "execute", "loadPano(?panoName="+name+"&xml_file="+name+".xml,1000,fade);");

Note that I simply added an xml_file parameter using the same name as the pano. Obviously that XML file has to be in the same folder as the pano. I then loaded the initial data (and only that data) into a separate XML file for each pano. For example:
<?xml version = '1.0'?>
<panorama>
<parameters>
panHome=135
tiltHome=0
</parameters>
</panorama>

Any variable which isn't changed here will keep its previous value. (So, if you have no XML file for a pano it still loads, but with the existing panHome, tiltHome etc values.

This isn't nearly so flexible as what Gary and Patrick have suggested but until I understand AS better it will do.

Downside is that you need a separate XML file for each pano. Upside is that to change the initial values for a pano you only need to change a simple XML file, not edit and recompile the Controller.fla.

You can only use the panoName in the data section of the combobox. If you add paramaters as I did before the pano will fail to load.

Many thanks again to Patrick and Gary. Without their help I may not have thought of this. And yes, I continue my efforts to learn actionscript to make proper changes to these components.

cheathamlane
09-24-2007, 03:23 PM
Hey Scott:

:)

While I'm sure it got buried in the barrage of posts in this thread, this is the exact approach I outlined in post #6 early on...

http://flashpanoramas.com/forum/showpost.php?p=1577&postcount=6

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 (snip)

I do this myself, without the fancy truncating or string concatenation; since the tours I'm working on right now are small & generally not getting expanded, I just hardcode the basic panoNames or file paths into the controller.

Personally, I'm OK with a sidecar XML file for each panorama; I don't think the hit to the server/flash app is going to be that great (unless you're an extremely popular site).

Scott Witte
09-24-2007, 05:13 PM
While I'm sure it got buried in the barrage of posts in this thread, this is the exact approach I outlined in post #6 early on...

Patrick,

OMG, your right! And I totally spaced on it. The only difference is where you suggested "In this case, I'd use AS in the SWF to truncate the panoName parameter into something more filename-friendly." and then used truncatedName in the XML file. Of course I didn't know how to do even that, simple as is it may be for you. (maybe soon for me, too.) So I put it aside mentally. When it bubbled back to consciousness, without the truncation part, I knew it was inspired by your help. I didn't realize how directly. So even more clearly, without your help I wouldn't have done even this simple fix. Again, many thanks.

cheathamlane
09-24-2007, 07:20 PM
Hey Scott:

:P

Yeah, that whole truncation thing -- I always try to make things more difficult than necessary, at first... ;)

Cheers!