calculator-$14.lzx

<canvas width="100%" height="400">
  <!-- Uncomment to include fonts for SWF -->
  <!-- fonts -->
  <!-- 
  <font src="helmetbi.ttf" name="obliqueText" />
  <font src="helmetr.ttf" name="displayText" />
  -->
  <!-- art assets -->
  <resource name="calc_body" src="resources/body.png"/>
  
  <!-- includes -->
  <include href="calculator_button.lzx"/>
  <include href="calculator_display.lzx"/>
  
  <!-- global variables and functions -->
  <script>
  
        // utility function that finds an item in an array
        //
        function isInArray(x, theArray) {
            var isThere = false;
            for (var i=0; i<theArray.length; i++) {
                if (theArray[i] == x) {
                    isThere = true;
                }
            }
            return isThere;
        }
  
  </script>
  
  <view name="calculator" resource="calc_body" x="20" y="20">
    <!-- display -->
    <calcDisplay id="display"/>
      <!-- 5 rows of buttons -->
      <view name="buttons" x="19" y="88">
        <simplelayout axis="y" spacing="7"/>
        
        <!-- row 1 -->
        <view name="row1" width="100%">
          <calcButton buttLabel="C" resource="button_red"/>
          <calcButton buttLabel="/" align="right" labelX="13"/>
        </view>
        
        <!-- row 2 -->
        <view name="row2">
          <simplelayout axis="x" spacing="7"/>
          <calcButton buttLabel="7"/>
          <calcButton buttLabel="8"/>
          <calcButton buttLabel="9"/>
          <calcButton buttLabel="*" labelX="13"/>
        </view>
        
        <!-- row 3 -->
        <view name="row3">
          <simplelayout axis="x" spacing="7"/>
          <calcButton buttLabel="4"/>
          <calcButton buttLabel="5"/>
          <calcButton buttLabel="6"/>
          <calcButton buttLabel="-" labelX="15"/>
        </view>
        
        <!-- row 4 -->
        <view name="row4">
          <simplelayout axis="x" spacing="7"/>
          <calcButton buttLabel="1"/>
          <calcButton buttLabel="2"/>
          <calcButton buttLabel="3"/>
          <calcButton buttLabel="+"/>
        </view>
        
        <!-- row 5 -->
        <view name="row5">
          <simplelayout axis="x" spacing="7"/>
          <calcButton buttLabel="0"/>
          <calcButton buttLabel="+/-" labelX="1"/>
          <calcButton buttLabel="." labelX="16"/>
          <calcButton buttLabel="=" resource="button_grn" labelX="12"/>
        </view>
      </view>
  </view>
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2007, 2008 Laszlo Systems, Inc.  All Rights Reserved.                   *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->

Cross References

Includes

Resources

Name Source Image
calc_body resources/body.png

Named Instances