1 Reply Latest reply on Apr 14, 2010 4:23 PM by Joe ... Ward

    I need some help

    Vvenn

      Hellow I have create an as file with my on class. In this class I import other classes. Then I have create fla file to publilicate in air player, but then I try to test the move it write to me this class not exist. What I done wrong? Plese help me.

       

      AS file:

      package
      {
          import flash.display.*;
          import flash.events.*;
          import flash.text.*;
          import flash.display.*;
          import flash.system.*;

       

          public class Temp1 extends Sprite
          {

       

              public static var no_info:String="Informacijos nera";

       

              // Private Properties:
              private var elementName:String;
              private var elementPower:Number;
              private var elementInfo:String;
              private var elementPrint:String;
              private var clickCount:int=new int(0);

       


              // Initialization:
              public function Temp1()
              {
                  var inputNameText:TextField=new TextField  ;
                  inputNameText.type=TextFieldType.INPUT;
                  inputNameText.restrict="A-Z"+"a-z";
                  inputNameText.width=120;
                  inputNameText.height=20;
                  inputNameText.multiline=false;
                  inputNameText.wordWrap=false;
                  inputNameText.border=true;
                  inputNameText.background=true;
                  inputNameText.x=50;
                  inputNameText.y=50;
                  inputNameText.selectable=true;
                  inputNameText.mouseWheelEnabled=false;
                  inputNameText.maxChars=20;
                  addChild(inputNameText);

       

                  var inputPowerText:TextField=new TextField  ;
                  inputPowerText.type=TextFieldType.INPUT;
                  inputPowerText.restrict="0-9";
                  inputPowerText.width=120;
                  inputPowerText.height=20;
                  inputPowerText.multiline=false;
                  inputPowerText.wordWrap=false;
                  inputPowerText.border=true;
                  inputPowerText.background=true;
                  inputPowerText.x=50;
                  inputPowerText.y=75;
                  inputPowerText.selectable=true;
                  inputPowerText.mouseWheelEnabled=false;
                  inputPowerText.maxChars=10;
                  addChild(inputPowerText);

       

                  var inputInfoText:TextField=new TextField  ;
                  inputInfoText.type=TextFieldType.INPUT;
                  inputInfoText.restrict="A-Z"+"a-z"+"0-9";
                  inputInfoText.width=120;
                  inputInfoText.height=190;
                  inputInfoText.multiline=true;
                  inputInfoText.wordWrap=true;
                  inputInfoText.border=true;
                  inputInfoText.background=true;
                  inputInfoText.x=50;
                  inputInfoText.y=100;
                  inputInfoText.selectable=true;
                  inputInfoText.mouseWheelEnabled=false;
                  inputInfoText.maxChars=110;
                  addChild(inputInfoText);

       

                  var printText:TextField=new TextField  ;
                  printText.type=TextFieldType.DYNAMIC;
                  printText.width=425;
                  printText.height=400;
                  printText.multiline=true;
                  printText.wordWrap=true;
                  printText.border=true;
                  printText.background=true;
                  printText.x=325;
                  printText.y=50;
                  printText.selectable=false;
                  printText.mouseWheelEnabled=true;
                  addChild(printText);

       


                  var enterButton:TextField=new TextField  ;
                  enterButton.text="Ivesti duomenis";
                  enterButton.autoSize=TextFieldAutoSize.CENTER;
                  enterButton.border=true;
                  enterButton.selectable=false;
                  enterButton.addEventListener(MouseEvent.CLICK,clickListener);
                  enterButton.x=70;
                  enterButton.y=300;
                  addChild(enterButton);

       

                  var exitButton:TextField=new TextField  ;
                  exitButton.text="Išeiti";
                  exitButton.autoSize=TextFieldAutoSize.CENTER;
                  exitButton.border=true;
                  exitButton.selectable=false;

       

                  exitButton.x=98;
                  exitButton.y=325;
                  addChild(exitButton);

       


                  function clickListener(event:MouseEvent):void
                  {
                      clickCount=clickCount+1;
                      if (clickCount==5)
                      {
                          printText.text="";
                          clickCount=0;
                      }
                      if (inputNameText.text==""||inputPowerText.text=="")
                      {
                          printText.appendText("\nIveskite duomenis.\n");
                          inputNameText.text="";
                          inputPowerText.text="";
                          inputInfoText.text="";
                      }
                      else
                      {
                          if (inputInfoText.text=="")
                          {
                              elementInfo=Temp1.no_info;
                          }
                          else
                          {
                              setElementInfo(inputInfoText.text);
                          }
                          setElementName(inputNameText.text);
                          setElementPower(new Number(inputPowerText.text));
                          setPrintElement();
                          printText.appendText(getPrintElement());
                          inputNameText.text="";
                          inputPowerText.text="";
                          inputInfoText.text="";
                      }

       


                  }

       

              }

       

              public function setElementName(newName:String):void
              {
                  elementName=newName;
              }

       

              public function getElementName():String
              {
                  return elementName;
              }

       

              public function setElementPower(newPower:Number):void
              {
                  elementPower=newPower;
              }

       

              public function getElementPower():Number
              {
                  return elementPower;
              }

       

              public function setElementInfo(newInfo:String):void
              {
                  elementInfo=newInfo;
              }

       

              public function getElementInfo():String
              {
                  if (elementInfo=='')
                  {
                      elementInfo=Temp1.no_info;
                  }
                  return elementInfo;
              }

       

              public function setPrintElement():void
              {
                  if (elementInfo=='')
                  {
                      elementInfo=Temp1.no_info;
                  }
                  var powerSting:String;
                  var temp:String="";

       

                  powerSting=new String(elementPower);
                  temp+="\nElektro elemento pavadinimas: "+elementName;
                  temp+="\nElektro elemento galingumas: "+powerSting+" W";
                  temp+="\nElektro elemento informacija: "+elementInfo+"\n";
                  elementPrint=temp;
              }
              public function getPrintElement():String
              {
                  setPrintElement();
                  return elementPrint;
              }

       

          }

       

      }

       

       

      FLA file to publish in AIR