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

    How to create Text field?

    Sleepy Lion Level 1

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

      But how can I cretare textFields with script?



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



          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>')


                      .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>')


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


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


          I want to hide this paragraph.



          var myParagraph = $("#textField");





          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 !