PDA

View Full Version : XML pass spot parameters to global function


psychospiller
02-06-2008, 05:07 PM
Is it possible in the XML file to acheive something like the following :


<global
myFunction="spotmaster.pan=pan"
>

<spot id="spotmaster">
<spot id="spot2" pan="99" onclick="spot2.myFunction()">
<spot id="spot3" pan="66" onclick="spot3.myFunction()">[/


So that when you click on either spot2 or spot3 they send their respective pan value to a global function so that the spotmaster.pan value is set to the pan value of the caller? I want to have one global function that sets spotmaster.pan but could be called from any other spot but cant work out the syntax.

Thanks

cheathamlane
02-06-2008, 10:37 PM
AFAIK, what you want to do can't be done directly from the XML. You could write a plugin which would Get the attribute (eg, 'pan') of the Caller spot, and then do things based on the value.

The long way 'round via XML is to write a function for each spot.

HTH

zleifr
02-07-2008, 05:54 AM
Like Patrick said, the only way to do it in the XML is this:

<spot id="spot2" pan="99" onclick="spotmaster.pan=99">
<spot id="spot3" pan="66" onclick="spotmaster.pan=66">