3 Replies Latest reply on Aug 19, 2006 8:12 AM by peterent

    converting textfield into a MovieClip

    RajeshatOinam
      hey guys can anyone help me....what i want to do is i want a hand cursor to be displayed when i move my mouse on the textfield....i do not want user to see the capital I cursor when user moves his mouse over the textfield...i had made that textfield.selectable property false also...but it didn't work.....and also i read somewhere that only MovieClip's possesses this property...like....mc.useHandCursor = true and mc.buttonMode = true.....but both these properties do not work for Textfield..........I even tried adding textfield to a MovieClip object but in vain...it did not worked out.....i tried casting it also...as in
      var mc_text:MovieClip = MovieClip(textfield);

      but this thing also gave me error...
      plzz help...

      var textfield:TextField = new TextField();
      textfield.text = " Start ";
      textfield.x=20;
      textfield.y=20;
      textfield.selectable = false;



        • 1. Re: converting textfield into a MovieClip
          peterent Level 2
          If you can use a Text or Label control, do this:

          <mx:Text id="output" selectable="false"
          text="This is a test. Output will go here"
          useHandCursor="true" buttonMode="true" mouseChildren="false" />
          • 2. Re: converting textfield into a MovieClip
            RajeshatOinam Level 1
            hey peter....i am not using any mxml...i am making through a pure actionscript....how do i do that....plz reply..
            • 3. Re: converting textfield into a MovieClip
              peterent Level 2
              <mx:Text> is the same as mx.controls.Text:

              var textField:Text = new Text();
              textField.test = "Start";
              // etc
              textField.useHandCursor = true;
              textField.buttonMode = true;
              textField.mouseChildren = false;

              I do see that you are using TextField and not Text. TextField is a Flash object which is what Text uses. I don't know if a flash TextField has useHandCursor, buttonMode, or mouseChildren properties. You might post your question on the Flash forums if you intend to use TextField over Text.

              Using a Flex Text control allows you to add the control to containers:

              var box:VBox = new VBox();
              box.addChild( textField );

              which you would not be able to do with a Flash TextField.