2 Replies Latest reply on Oct 6, 2006 11:57 PM by SamCantCode

    Number in Beta3 is now NaN in Final Release?

    SamCantCode
      Hello, I am going through a Flex tutorial by Lynda.com and I have run across a glitch. In the video training, they are using Flex Builder 2 Beta3. I am using Flex Builder 2 retail version.

      in Beta3, the following two .as files produce the traced statement:
      Actionscript 3.0 Essential Training
      1000
      2000

      In the retail version they produce:
      Actionscript 3.0 Essential Training
      NaN
      NaN

      Here's the code:
      ProgrammingBasics.as
      package {
      import flash.display.Sprite;
      import com.lynda.as3et.programmingbasics.InventoryItem;

      public class ProgrammingBasics extends Sprite {

      public function ProgrammingBasics() {
      var item:InventoryItem = new InventoryItem("Actionscript 3.0 Essential Training", 1000);
      trace(item.getProductName());
      trace(item.getQuantity());
      item.addItems(1000);
      trace(item.getQuantity());
      }

      }
      }

      InventoryItem.as
      package com.lynda.as3et.programmingbasics{

      public class InventoryItem{

      private var _productName:String;
      private var _quantity:Number;

      public function InventoryItem(productName:String, quantity:Number){
      _productName = productName;
      _quantity - quantity;
      }

      public function getProductName():String {
      return _productName;
      }

      public function getQuantity():Number {
      return _quantity;
      }

      public function addItems(quantity:Number):void {
      _quantity += quantity;
      }

      }
      }

      I checked to see if there was any errata section on their website, but couldn't find one. So, if anyone can help me understand what might have changed it'd be greatly appreciated.

      -sam