I want to make a hotspot show up draggable text field on iphone but it doesn't work.
It works fine on the desktop.
Could you please help to solve this problem?
1. tour.xml
<scene name="scene_AAA" title="AAA" onstart="point();" thumburl="panos/AAA.tiles/thumb.jpg" lat="" lng="" heading="">
<include url="include/scene1.xml" />
.
.
.
<hotspot name="textdrag" url="img/text.png" scale="1.0" ath="14.021" atv="-20.639"
onclick="set(layer[textbox].enabled,true);set(layer[textbox].alpha,1);" />
--------------------------------------------------------------------------------------------------------------------------------------------
2. include/scene1.xml
<action name="draglayer">
if(%1 != dragging,
copy(drag_currentx, x);
copy(drag_currenty, y);
copy(drag_stagex, mouse.stagex);
copy(drag_stagey, mouse.stagey);
set(drag_sx, +1);
set(drag_sy, +1);
if(align == righttop, set(drag_sx,-1); );
if(align == right, set(drag_sx,-1); );
if(align == rightbottom, set(drag_sx,-1); set(drag_sy,-1); );
if(align == bottom, set(drag_sy,-1); );
if(align == leftbottom, set(drag_sy,-1); );
draglayer(dragging);
,
if(pressed,
sub(dx, mouse.stagex, drag_stagex);
sub(dy, mouse.stagey, drag_stagey);
mul(dx, drag_sx);
mul(dy, drag_sy);
add(x, drag_currentx, dx);
add(y, drag_currenty, dy);
delayedcall(0, draglayer(dragging) );
);
);
</action>
<!-- a special action for dragging the text only vertically with a certain range -->
<action name="draglayer_text">
if(%1 != dragging,
copy(drag_currenty, y);
copy(drag_stagey, mouse.stagey);
draglayer_text(dragging,%2);
,
if(pressed,
sub(dy, mouse.stagey, drag_stagey);
add(y1, drag_currenty, dy);
add(y2, y1, pixelheight);
sub(y2, %2);
if(y1 GT 0, set(y1,0));
if(y2 LT 0, sub(y1,y2));
copy(y,y1);
delayedcall(0, draglayer_text(dragging,%2) );
);
);
</action>
<!-- the example layers -->
<layer name="textbox" type="container" align="center" alpha="0.0" enabled="false" visible="true" handcursor="false" x="0" y="0" width="500" height="500"
bgcolor="0x000000" bgalpha="0.7" bgcapture="true" ondown="draglayer();" onclick="set(layer[textbox].visible, false);" >
<layer name="title" url="%SWFPATH%/plugins/textfield.swf" children="true" enabled="false" align="top" y="5" width="100%" autoheight="true"
border="false" background="false"
css="text-align:center; color:#FFFFFF; font-family:Arial; font-weight:bold; font-size:14px;"
html="Textbox" />
<layer name="textmask" type="container" align="lefttop" x="10" y="30" width="480" height="440" bgcolor="0xFFFFFF" bgalpha="1.5" cellpadding="5px" maskchildren="true">
<layer name="text" url="%SWFPATH%/plugins/textfield.swf" children="true" align="lefttop" visible="true" x="0" y="0" width="100%" autoheight="true"
border="false" background="false"
css="text-align:left; color:#000000; font-family:Arial; font-size:15px;"
html="data:textdetail"
ondown="draglayer_text(start,260);" />
</layer>
</layer>
<!-- text html -->
<data name="textdetail">
<p align="center">
<font face="times" size="16px" style="font-family:times; font-size:20px; padding:15px;">
<b>Hello!</b><br/>
</font>
</p>
</data>