Openlaszlo 5.0.x getattribute, rotation

110 Views Asked by At

I am working on an animation. I am using .swf pictures which I rotate with code like below. My problem is: I want to read the actual rotation angel or position of the view "MoAuxid" when I klick on button "Abfrage". How can I get this result?

Best regards

Main Program:

   <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>   

The Mond4.lzx includes the following code:

<!-- 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>

0

There are 0 best solutions below