PDA

View Full Version : Another WML parser error (doneFunction)


Scott Witte
09-12-2007, 10:52 PM
THIS took a while to figure out, too. Could someone confirm or is it just me?

pano.zoom=1,1000,,move2 <-- correct systax, works

pano.zoom=1.5,1000,,move2 <-- correct systax, does NOT work
pano.zoom=2,1000,,move2 <-- correct systax, does NOT work

pano.zoom=1.5,1000,,,move2 <-- incorrect systax (extra comma) but WORKS
pano.zoom=2,1000,,,move2 <-- incorrect systax (extra comma) but WORKS

cheathamlane
09-13-2007, 12:31 AM
Scott:

Without looking too deep into why one of your statements' syntax works/doesn't work (and without seeing the full code context), I think the answer could be that in something like:

pano.zoom=2,1000,,,move2

What you have is:

pano.zoom=amount,duration,typeOfMovement,functionT oCallWhenDone,functionToCallIfInterrupted

In your example:
amount = 2
duration = 1 second
typeOfMovement = default
functionToCallWhenDone = null or default
functionToCallIfInterrupted = move2

--
I referenced "Assignments and motion tweens" in the "Hotspots plugin" section of the documentation to parse that out. :-)

HTH

Scott Witte
09-13-2007, 02:23 AM
I referenced "Assignments and motion tweens" in the "Hotspots plugin" section of the documentation to parse that out. :-)

Yup. I spent a lot of time reading, re-reading and re-re-reading that trying to understand what was going wrong. :(

The point is, the parsing behaves differently depending on what the value is. In this code: onClick="pano.qualityStatic=low;pano.pan= -138,600;pano.tilt= -5,600;pano.zoom=1.5,1000,,,move2"
move2="loadPano(?panoName=Images/Entrance&panHome=80,600)"

move2 is the "functionToCallWhenDone". If the value for pano.zoom is 1, it requires 2 comas to execute, as it should (type of movement being set to default). But if it is 1.5 or 2 or who knows what else, it requires 3 comas! That isn't consistent, or correct according to documentation we both read, or am I missing something?

cheathamlane
09-13-2007, 02:39 AM
Hey Scott:

I think your syntax may be wrong. Until you're certain that your syntax is right, and your functions are working, it's frustrating to spend time on what-ifs. :-) It may be that there are issues elewhere in your code/functions which are causing these examples to behave erratically.

Scott Witte
09-13-2007, 03:06 AM
I think your syntax may be wrong. Until you're certain that your syntax is right, and your functions are working, it's frustrating to spend time on what-ifs. :-)

I hear you. Not that I look forward to more debugging. But inspired by your suggestion I will redouble my efforts :( and report any new findings here.

Scott Witte
09-13-2007, 03:25 AM
Welllll. That didn't take so long after all. (Just this once the coding gods took pity.) Although it sure isn't a syntax problem in my way of understanding. It goes deeper.

In the <parameters> section I had "zoomMax = 1.4" Apparently, if I then set pano.zoom=[any value greater than zoomMax] it somehow results in an extra coma being required before the doneFunction value.

I'm guessing that isn't how it should work. (It seems, to me at least, like a bounds limit issue that should be handled as an exception in the program code.) Hope Denis is noting.

cheathamlane
09-13-2007, 02:06 PM
Well, good news!

I'll light a candle to the coding gods today in commiseration. ;-)

Yes, that's interesting about the zoomMax setting -- I haven't used it, so it hasn't gotten in my way yet.

Not to be too nitpicky, but... Why set zoomMax, if you're going to go over it? :-)

--
If zoomMax is something that can be set elsewhere in the code (say, in a function)... Maybe you can set it, then override it while you do things? That is, the user gets a default zoomMax, but when the panorama is running through it's auto-rotations you override it (then set it back). Just a thought.