0 Replies Latest reply on Mar 21, 2007 3:09 AM by salimsdesign

    Bug in function

      I am new to Flex. I have just started learning Flex2 and I followed a tutorial from Adobe site.
      The link: http://www.adobe.com/devnet/flex/articles/first_flexapp.html

      I followed all the steps but when I play the Project I found an error (1046: Type was not found or was not a compile-time constant: Void.).

      Here is the code:

      <?xml version="1.0"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">
      <!-- data model -->
      <mx:Array id="coffeeArray">
      <label>Red Sea</label>
      <data>Smooth and fragrant</data>
      <data>Rich and pungent</data>
      <label>Blue Mountain</label>
      <data>Delicate and refined</data>

      private function addToCart():Void

      <!-- view -->
      <mx:Panel title="My First Flex App">
      <mx:Label text="Coffee Blends"/>
      <mx:ComboBox id="coffeeCombo" dataProvider="{coffeeArray}"/>
      <mx:Text text="Description: {coffeeCombo.selectedItem.data}"/>
      <mx:Button label="Add to Cart" click="addToCart()"/>
      <mx:List id="cart"/>

      I guess the tutorial that I followed is not meant for Flex2 and it was for Flex2. So I am getting the error message.