1

我正在制作动画。我正在使用 .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>

4

0 回答 0