2 Replies Latest reply on Dec 13, 2012 5:11 PM by Sleepy Lion

    How to create Text field?

    Sleepy Lion

      I can create symbols on the stage using "sym.createChildSymbol" command.

      But how can I cretare textFields with script?

       

      regards

        • 1. Re: How to create Text field?
          joel_pau Level 5

          Hi,

           

          Well, you can create a text symbol (better solution).

          You can also use jQuery but you should rewrite properties panel: position, font, width, height...

          One case:

          $('<p id="textField">a new paragraph</p>')

                      .appendTo("#Stage")

                      .css({'position': 'absolute','top':'40px', 'left':'40px', 'color':'blue'});

          You can use other tags: <h1>, <div>... See html5 tags.

           

          Using classes.

          $('<p id="textField" class="redText">a new paragraph</p>')

                      .appendTo("#Stage")

                      .css({'position': 'absolute','top':'40px', 'left':'40px'});

           

          sym.$(".redText").css({'color': 'red', 'background-color': '#EEEEEE'});

           

          I want to hide this paragraph.

          $("#textField").hide();

          or

          var myParagraph = $("#textField");

          myParagraph.hide();

          later:

          myParagraph.css('color','black').show();

           

          and so on...

          • 2. Re: How to create Text field?
            Sleepy Lion Level 1

            Thank you for the kind advice, joel_pau.

             

            Both your examples worked fine.

             

            ARIGATO !