3 Replies Latest reply on Dec 10, 2006 2:37 AM by Newsgroup_User

    Dynamic Text + Mask + Style Sheet , a solution ?

    Level 7
      It turn me crazy :

      - I have a dynamic text field which reads its contents from an XML file.
      - The text is then formatted with some basic CSS from an external style
      sheet
      - There is a scroll bar which controls the textfield.

      All of the above works absolutely sweetly.

      BUT then, I then added a mask over the textfield so that the scrollbar
      looks effective...., the text disappears.


      Here the code :

      _root.ticker.createTextField("mytext", 50, 20,20, 300, 200);
      _root.ticker.mytext.autoSize = true;
      _root.ticker.mytext.multiline = true;
      _root.ticker.mytext.wordWrap = true;
      _root.ticker.mytext.border = false;
      _root.ticker.mytext.type = "dynamic";
      _root.ticker.mytext.border = false;
      _root.ticker.mytext.background = false;
      _root.ticker.mytext.password = false;
      _root.ticker.mytext.multiline = false;
      _root.ticker.mytext.html = true;
      _root.ticker.mytext.selectable = true;
      //_root.ticker.mytext.embedFonts = true; //??? I try it uncomment or not ???
      _root.ticker.mytext.maxChars = null;
      _root.ticker.mytext.htmlText = myDataNews; //FROM external Html

      // Loading the CSS
      var myStyle:TextField.StyleSheet = new TextField.StyleSheet();
      myStyle.load("news/sample.css");
      _root.ticker.mytext.styleSheet = myStyle;
      //IT WORKS !

      _root.ticker.setMask(this.masque);
      //BUT WITH MASK NO !!!!

      Can someone help me ?


        • 1. Re: Dynamic Text + Mask + Style Sheet , a solution ?
          Level 7
          In dynamic textfield the used font should be embedded and the
          manipulation with text will work.


          --
          Regards,
          Erick Souza
          www.ericksouza.com
          • 2. Re: Dynamic Text + Mask + Style Sheet , a solution ?
            Level 7


            Erick Souza wrote:
            > In dynamic textfield the used font should be embedded and the
            > manipulation with text will work.

            The code alreay has embed fonts _root.ticker.mytext.embedFonts = true;
            what he needs now is to linkage the font in library and reference to in
            in that text object.

            Yan:
            Open library CTRL L, in the top right side menu look for NEW FONT.
            Find one you want to use, select it. It will now appear in the library.
            Select that font and right click, go to linkage, select the export for action
            script option and give it some ID name.

            Here is how you would use it :


            myFormat.size = 20;
            myFormat.font = "IDnameComesHere";
            myFormat.color = 0x000000;

            _root.ticker.createTextField("mytext", 50, 20,20, 300, 200);
            _root.ticker.mytext.autoSize = true;
            _root.ticker.mytext.multiline = true;
            .....................................

            _root.ticker.mytext.embedFonts = true;;
            _root.ticker.mytext.setTextFormat(myFormat);


            --
            Best Regards

            Urami


            --


            <urami>
            If you want to mail me - DO NOT LAUGH AT MY ADDRESS
            </urami>
            • 3. Re: Dynamic Text + Mask + Style Sheet , a solution ?
              Level 7
              I said because in the code the line is commented out.

              In this script it is necessary to declare the TextFormat Object, I'm right?


              var myFormat:TextFormat = new TextFormat();
              myFormat.size = 20;
              myFormat.font = "IDnameComesHere";
              myFormat.color = 0x000000;


              --
              Regards,
              Erick Souza
              www.ericksouza.com