Hi Michel,
I finally figured this out. It was a scoping issue. This works (look at the
loadobject function):
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
var swf = createswf("viewer.swf", "viewerSWFObject", "100%", "500", "#FFFFFF");
swf.addVariable("xml", "01.xml");
swf.embed("viewerDIV");
function viewer()
{
return document.getElementById("viewerSWFObject");
}
function loadobject(xmlname,myframe)
{
var myframe = viewer().get("image.frame");
viewer().call("loadpano(" + xmlname + ", image.frame=" + myframe +" , MERGE, BLEND(1));");
}
|
The variable myframe has to be declared inside the
loadobject function in order for it to be available to the loadpano call. I suppose it could have also been declared outside the
loadobject function, but it has to be done explicitly using the
var statement.
I am now having a problem replicating this using xml code. The following DOES NOT work (but I am getting results from both
trace(myframe) commands in debug mode):
|
Source code
|
1
2
3
4
5
6
|
<action name="my_load_pano">
set(myframe,get(image.frame));
trace(myframe);
loadpano(%1,image.frame=myframe,KEEPALL,BLEND(0.5));wait(blend);
trace(myframe);
</action>
|
This triggers the above:
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
|
<plugin name="object_01"
url="preview/08.png"
scale="1"
edge="center"
align="lefttop"
x="75"
y="60"
onclick="action(my_load_pano,08.xml)"
onhover=""
onover=""
onout =""
/>
|
The following also does NOT work:
|
Source code
|
1
|
loadpano(08.xml,image.frame=get(image.frame),KEEPALL,BLEND(0.5));wait(blend);
|
This on the other hand works (as it should):
|
Source code
|
1
|
loadpano(08.xml,image.frame=36,KEEPALL,BLEND(0.5));wait(blend);
|
I am starting to suspect that there is something specific about the way the loadpano() call or function gets assembled and the way in which it accepts variables.