10 Replies Latest reply on Jun 7, 2006 3:02 AM by kokochka

    embedFonts bug the other way around

    kokochka
      Unlike most problems posted, embedFonts = true works for me.
      BUT, I would like to disactivate this function to use devise font and when i do :
      embedFonts = false;
      there is no texte (dynamic) available anymore. Now the text field is BLANK!!!!
      Please Help!!!
      *******************************
      /// TEXT FORMAT FOR BOUTIQUES
      var myFt = new TextFormat();
      myFt.font = "AGaramond";
      myFt.size = 11;
      myFt.color = 0x000000;

      var xR=startX;
      var yR=startY;
      for(var i=1;i<=nbPays;i++){
      //trace("Pays : "+country.attributes.name);
      //trace("Pays : "+country.attributes.id);

      var thisPays = a_list.th_list.button.duplicateMovieClip("pays"+i,i,{_x:xR,_y:yR});
      thisPays.id=country.attributes.id;
      thisPays.rub = "country";
      thisPays.pays=country.attributes.name;
      thisPays.createTextField("pysTxt",1,0,0,140,17);
      thisPays.pysTxt.embedFonts=false;
      thisPays.pysTxt.type = "dynamic";
      thisPays.pysTxt.text=" -- "+country.attributes.name;
      thisPays.pysTxt.setTextFormat(myFt);

      country=country.nextSibling;
      yR+=intVal;
      }
        • 1. Re: embedFonts bug the other way around
          2m Level 2
          There are two possible reasons for that I can think of:

          1. The Font isnt there on the system, at least not under that name (user TextFiled.getFontList() to check)

          2. it is under a mask somwhere, then it wont show up (as long as it is not purly rectangel and attached via script.)
          • 2. Re: embedFonts bug the other way around
            kokochka Level 1
            The answer for the comments :
            1) The font is there, since when i do :
            embedFonts = true;
            all the country name are shown. My problem is exactly the opposite. I want to show the names with devise fonts.

            2) There is no mask. And it's purely the problem of the embedFonts problem for the same reason as above.
            • 3. Re: embedFonts bug the other way around
              kokochka Level 1
              And the thing is another code for another text field element is working (code listed below)!

              There are very little differences (if any) between 2 exemples, except that I don't duplicate movie clip and create a textField in a loop here...
              /////////////////////////
              var my_fmt = new TextFormat();
              my_fmt.font = "AGaramond";
              //my_fmt.size = 12;
              my_fmt.color = 0x000000;

              trace("TEXT:"+ txt);
              a_address.createTextField("myTxt",3,10,10,220,280);

              a_address.myTxt.embedFonts = false;
              a_address.myTxt.wordWrap=true;
              a_address.myTxt.multiline=true;
              a_address.myTxt.html=true;
              a_address.myTxt.htmlText=txt;
              a_address.myTxt.setTextFormat(my_fmt);
              /////////
              • 4. Re: embedFonts bug the other way around
                2m Level 2
                1) The font is there, since when i do :
                embedFonts = true;
                all the country name are shown. My problem is exactly the opposite.


                this is possible, but no definitve proof, as "AGaramond" could have been the identifier of a font symbol in the library as well as a font on the system. I trust you though that that isn't the reason, just proofing my point ;-)

                Can you post the fla somwhere, maybe I can help then. (BTW: mac or PC?)
                • 5. Re: embedFonts bug the other way around
                  kokochka Level 1
                  I have noticed that, in the 1st exemple with the textField creation in a duplicate movieClip, when i set embedFonts = false, the textField is like not created.

                  That is :
                  ////////////////////
                  var thisPays = a_list.th_list.button.duplicateMovieClip("pays"+i,i,{_x:xR,_y:yR});
                  thisPays.id=country.attributes.id;
                  thisPays.rub = "country";
                  thisPays.pays=country.attributes.name;
                  thisPays.createTextField("pysTxt",1,0,0,140,20);

                  thisPays.pysTxt.embedFonts=false;
                  thisPays.pysTxt.background = true; //// I added this to visualize the text area
                  thisPays.pysTxt.backgroundColor = 0x990000; //// I added this to visualize the text area
                  thisPays.pysTxt.text = " -- "+country.attributes.name;
                  thisPays.pysTxt.setTextFormat(myFt);
                  //////////////

                  When embedFonts = true, the country names are shown with red background.
                  When embedFonts = false, the textField is not even colored with #990000. It basically act as if there is no textField available.

                  Please explain this!!!
                  • 6. Re: embedFonts bug the other way around
                    2m Level 2
                    With those fragments only I'm not 100% sure if this is the reason, but generaly when duplicating a movieclip it's visual contents and rotations, scaling etc is copied to a new clip that does NOT have its timeline's variables (properties) on it.

                    So that is most likely the reason for that.

                    Remark:
                    In my expirience duplicate MovieClip is "very Flash5" and produces (because of said behavior) sometimed unexpected results, i try to use attach movie instaed if possible,
                    • 7. Re: embedFonts bug the other way around
                      kokochka Level 1
                      I have tested with attach movie too. But the problem is the same.

                      After several tests, i can assure that problem comes sure and certain from the text Field availability. Everything (other non-visible variables and functions) is there except for textField created on the fly if i set embedFonts = false.

                      The textField is there if i set embedFonts = true, so the name is visible (with the background i set to double test).
                      • 8. Re: embedFonts bug the other way around
                        2m Level 2
                        Sorry if I seem stubborn, but I still think it has to do with duplicateMovieClip, as a text-field with an embeded font might be treated as a visual thing, while one without is treated differently - in a lot of other cases it is at least.

                        Still if you really want us to help, a look (download link) on your fla is probably the quickest way to find a solution.
                        • 9. Re: embedFonts bug the other way around
                          kglad Adobe Community Professional & MVP
                          kokochka, if you DON'T think you're masking, rotating, changing the alpha etc of your textfield, post a link and specify the location of the problem textfield.
                          • 10. Re: embedFonts bug the other way around
                            kokochka Level 1
                            I have solved the problem. In fact, i had a MASK in the clip. That's why the device font text didn't show up, while embedded text show.

                            So i change the physical mask to the action script mask.
                            movieClip.setMask(maskClip);

                            Now it's working.
                            Thank you, everybody!