topical media & game development

talk show tell print

actionscript-book-GeometricShapes-com-example-programmingas3-geometricshapes-GeometricShapeFactory.ax

actionscript-book-GeometricShapes-com-example-programmingas3-geometricshapes-GeometricShapeFactory.ax [swf] flex


  package  
  {
          public class @ax-actionscript-book-GeometricShapes-com-example-programmingas3-geometricshapes-GeometricShapeFactory 
          {
              public static function createShape(shapeName:String, len:Number):actionscript_book_GeometricShapes_com_example_programmingas3_geometricshapes_IGeometricShape
              {
                  switch (shapeName)
                  {       
                  case "Triangle":
                      return new actionscript_book_GeometricShapes_com_example_programmingas3_geometricshapes_EquilateralTriangle(len);
                      
                  case "Square":
                      return new actionscript_book_GeometricShapes_com_example_programmingas3_geometricshapes_Square(len);
                      
                      case "Circle":
                          return new actionscript_book_GeometricShapes_com_example_programmingas3_geometricshapes_Circle(len);
              }
              return null;
              }
          }
  }


(C) Æliens 27/08/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.