我正在制作动画片。我正在使用.swf图片,我用下面的代码旋转。 我的问题是:当我点击按钮“Abfrage”时,我想要读取视图“MoAuxid”的实际旋转角度或位置。我怎样才能得到这个结果?
祝你好运
主程序:
<Mond width="400" height="400">
<view name="Bedienung_rot" x="800" y="10">
<simplelayout axis="y" inset="8"/>
<text text="Output:"/>
<edittext id="outputID" text = "0"/>
<text text="Arc:"/>
<edittext id="WinkelID" text = "51"/>
<button x="000" y="160">
Rotation
<!-- Handler to execute the Method -->
<handler name="onclick">
var x = WinkelID.getText();
MoAuxid.rotate(x);
outputID.setAttribute('text',x);
</handler>
</button>
<text text="Output2:"/>
<edittext id="output2ID" text = "x"/>
<button x="000" y="160">
Abfrage
<!-- Handler to execute the Method -->
<handler name="onclick">
var x = MoAuxid.getAttribute('y');
output2ID.setAttribute('text',x);
</handler>
</button>
</view>
</Mond>
Mond4.lzx包含以下代码:
<!-- IMAGE RESOURCES -->
<resource name="Mo_Bkgnd" src="images/Kalender.jpg" />
<resource name="Mo_Aux" src="images/Mo_Zeiger_Aux.swf" />
<!-- CLASS: Mond -->
<class name="Mond" resource="Mo_Bkgnd">
<attribute name="stretches" value="both"/>
<attribute name="width" value="${this.unstretchedwidth *.5}"/>
<attribute name="height" value="${this.width}"/>
<attribute name="act_height" value="${this.unstretchedheight}"/>
<attribute name="act_width" value="${this.unstretchedwidth}" />
<attribute name="lasthour" value="00" />
<attribute name="lastminute" value="00" />
<attribute name="timezoneoffset" value="00" />
<attribute name="StdZeigWinkel" value="00" />
<attribute name="TagNachtWinkel" value="00" />
<attribute name="kalZeigWinkel" value="20" />
<attribute name="JahresWinkel" value="00" />
<attribute name="FeiertWinkel" value="00" />
<!-- Aux Zeiger -->
<view name="MoAux" resource="Mo_Aux" x="200" y="201" opacity="1" id="MoAuxid">
<method name="rotate" args="Arc">
var rotincrement = 0 + Arc;
var dur = 0;
this.animate('rotation',rotincrement,dur);
</method>
</view>
</class>