PDA

View Full Version : Adding custom parameters into pano XML files


miplap
06-08-2007, 07:04 AM
Hi,
I want to add my own parameters into the pano XML files that can be read by a custom Flash plugin.
I would preferable like to add my own section within the XML similar to that already used for the autorotator.
Please could you provide some guidance on doing this?
Cheers
Mark

Denis
06-08-2007, 12:45 PM
Yes. All plugins get the parametrers in standard way.

Examine glassMeter.fla plugin, it implements the standard plugin interface. There is a function newParams(str:String) - this function will get all parameter you place between <myPlugin></myPlugin> (don't forget to change identificator in the fla file: var id:String="myPlugin";.

miplap
06-08-2007, 07:42 PM
Thanks.

I don't quite follow the GlassMeter example though.
I see the newParams function defined as:
function newParams (str:String) {
}
What I can't follow in this example is how this function is called, what the parameters are passed to and how they are then accessed.
For example, how would I access the following?
<myPluginParams>
param1=hello
param2=there
</myPluginParams>
Would you mind expanding on this please?
Kind regards
Mark

fotocubo
06-26-2007, 06:05 PM
Hi all,

Inside a multinode tour I'd like to include a new pano with limits in pan range but no idea what parameters I need in LoadPano to make it work. I tried "&pan_min=-50&pan_max=50" from the hotSpot which loads it but no way. Any suggestion highly appreciated.

Thanks!

Denis
06-28-2007, 06:15 PM
Thanks.

I don't quite follow the GlassMeter example though.
I see the newParams function defined as:
function newParams (str:String) {
}
What I can't follow in this example is how this function is called, what the parameters are passed to and how they are then accessed.
For example, how would I access the following?
<myPluginParams>
param1=hello
param2=there
</myPluginParams>
Would you mind expanding on this please?
Kind regards
Mark
If your plugin has newParams function, it will get "param1=hello param2=there" as a single string, you can parse it manually.

Denis
06-28-2007, 06:19 PM
Hi all,

Inside a multinode tour I'd like to include a new pano with limits in pan range but no idea what parameters I need in LoadPano to make it work. I tried "&pan_min=-50&pan_max=50" from the hotSpot which loads it but no way. Any suggestion highly appreciated.

Thanks!
1st variant: Load new panorama with new XML. XML contains new parameters for Borders plugin: <borders>pan_min=-100;pan_max=100<borders>

2nd variant: Use script to set new parameters external.borders.pan_min=-100

cheathamlane
08-01-2007, 10:00 PM
If your plugin has newParams function, it will get "param1=hello param2=there" as a single string, you can parse it manually.

Can you expand on this a little? I see the "glassMeter.fla", and the text file, but no example of it being embedded or using custom parameters...

Thanks!

cheathamlane
08-02-2007, 10:10 PM
Hey there:

If anyone could give me just a push in the right direction, it would be appreciated -- It's still a little murky to me.

Thanks!

cheathamlane
08-07-2007, 08:16 PM
OK... So I was helped offline a little bit, but I'm still stuck...

function newParams (str:String) {
var lines:Array = str.match(/[^\s\n\r;]+[^;\n\r]+/g);
for (var i:int=0;i<lines.length;i++) {
var pair:Array = lines[i].split(/[\s]*=[\s]*/);
switch (pair[0].toLowerCase()) {
case "speed": params[0] = pair[1]; break;
case "interval": params[1] = pair[1]; break;
case "pause": params[2] = pair[1]; break;
case "quality": params[3] = pair[1]; break;
case "disabled": params[4] = pair[1]; break;
}
}
reset(params);
}


So, the above shows me how to parse the text which is returned; I understand using regular expressions, no problem... But I'm still not clear on what gets passed to newParams(), nor when to call it.

In glassMeter.fla I currently have:
var id:String="glassMeter";

And in my XML file:
<glassMeter>
param1=hello
param2=there
</glassMeter>

Attempting to call newParams() like so:
newParams(id);

I either get "undefined" or "glassMeter" returned to me... not the actual parameters.

What am I missing?