3 Replies Latest reply on Aug 26, 2008 10:04 PM by Newsgroup_User

    textInput.enter

    MughalShahzad
      I am using TextInput Flash Component in an assignment, I want to enable enter key on TextInput field but does not work no help avaialbe on iNet, if someone had used this please tell me and opt me out from this problem.

      Thanks and Regards
      Shahzad
        • 1. textInput.enter
          robdillon Most Valuable Participant
          You want to look at the key events. Enter is a key, so you want to trap the key press event for that key. Look at the information on the keyDown handler in the online help.
          • 2. Re: textInput.enter
            MughalShahzad Level 1
            I have checked keyDown event for enter key for TextInput Flash Component but it does not work, in the absence of flash object following code works but in the presence of flash object it does not work,

            what should I do I want to use flash objects provided in director's library/toolbar.

            Thanks & Regards,
            Shahzad
            • 3. Re: textInput.enter
              Level 7
              The following was posted to a listserve recently. In order to use it,
              you should paste it into a behavior (#score) script and make sure the
              scriptSyntax is set to #JavaScript. Then attach it to your TextInput
              component.

              //AstrO Controls :: TextInput.js
              //version 1.0b3-17Jul08
              //Created by Toby De Ieso


              function getPropertyDescriptionList() {
              var description = propList();
              var tProp = propList();
              var tRange = propList();

              tProp =
              propList();tProp.addProp("comment","enable:");tProp.addProp("format","boolean");tProp.add Prop("default",true);
              description.addProp("pStartEnabled",tProp);
              tProp =
              propList();tProp.addProp("comment","password:");tProp.addProp("format","boolean");tProp.a ddProp("default",true);
              description.addProp("pPassword",tProp);
              tProp =
              propList();tProp.addProp("comment","restrict:");tProp.addProp("format","string");tProp.ad dProp("default","0-9A-Za-z");
              description.addProp("pRestrict",tProp);
              tProp =
              propList();tProp.addProp("comment","maxChars:");tProp.addProp("format","integer");tProp.a ddProp("default",16);
              tRange =
              propList();tRange.addProp("min",0);tRange.addProp("max",256);tProp.addProp("range",tRange );
              description.addProp("pMaxChars",tProp);
              tProp =
              propList();tProp.addProp("comment","themeColor:");tProp.addProp("format","string");tProp. addProp("default","haloBlue");
              tRange =
              list("haloGreen","haloBlue","haloOrange");tProp.addProp("range",tRange);
              description.addProp("pThemeColor",tProp);
              tProp =
              propList();tProp.addProp("comment","fontFamily:");tProp.addProp("format","string");tProp. addProp("default","_sans");
              description.addProp("pFontFamily",tProp);
              tProp =
              propList();tProp.addProp("comment","fontSize:");tProp.addProp("format","integer");tProp.a ddProp("default",12);
              tRange =
              propList();tRange.addProp("min",8);tRange.addProp("max",96);tProp.addProp("range",tRange) ;
              description.addProp("pFontSize",tProp);
              tProp =
              propList();tProp.addProp("comment","fontStyle:");tProp.addProp("format","string");tProp.a ddProp("default","normal");
              tRange = list("normal","italic");tProp.addProp("range",tRange);
              description.addProp("pFontStyle",tProp);
              tProp =
              propList();tProp.addProp("comment","fontWeight:");tProp.addProp("format","string");tProp. addProp("default","normal");
              tRange = list("normal","bold");tProp.addProp("range",tRange);
              description.addProp("pFontWeight",tProp);
              tProp =
              propList();tProp.addProp("comment","textDecoration:");tProp.addProp("format","string");tP rop.addProp("default","normal");
              tRange = list("normal","underline");tProp.addProp("range",tRange);
              description.addProp("pTextDecoration",tProp);
              tProp =
              propList();tProp.addProp("comment","color:");tProp.addProp("format","color");tProp.addPro p("default",color(11,51,60));
              description.addProp("pFontColor",tProp);
              tProp =
              propList();tProp.addProp("comment","disabledColor:");tProp.addProp("format","color");tPro p.addProp("default",color(132,131,132));
              description.addProp("pFontDisabledColor",tProp);

              return description;
              }


              function beginSprite() {
              this.pSprite = sprite(this.spriteNum);
              this.pMember = this.pSprite.member;
              this.pActive = false;
              this.pObject = false;

              this.pMember.eventPassMode = symbol("passNever");
              this.pMember.buttonsEnabled = true;
              this.pMember.actionsEnabled = true;

              if (this.pMaxChars == 0) {
              this.pMaxChars = null;
              }
              }


              function exitFrame() {
              if (!this.pActive) {
              this.pObject = this.pSprite.getVariable("_root",false);
              this.pSprite.enabled = this.pStartEnabled;
              this.pSprite.password = this.pPassword;
              this.pSprite.restrict = this.pRestrict;
              this.pSprite.maxChars = this.pMaxChars;
              this.pSprite.setStyle("themeColor",this.pThemeColor);
              this.pSprite.setStyle("fontFamily",this.pFontFamily);
              this.pSprite.setStyle("fontSize",this.pFontSize);
              this.pSprite.setStyle("fontStyle",this.pFontStyle);
              this.pSprite.setStyle("fontWeight",this.pFontWeight);
              this.pSprite.setStyle("textDecoration",this.pTextDecoration);
              this.pSprite.setStyle("color",("0x" &
              this.pFontColor.hexString().substring(2,8)));
              this.pSprite.setStyle("disabledColor",("0x" &
              this.pFontDisabledColor.hexString().substring(2,8)));
              this.pSprite.addEventListener("enter", this);
              this.pActive = true;
              trace("activated");
              }
              }


              function enter() {
              trace("enter is working");
              if (this.pActive) {
              trace("sub section is working");
              }
              }