dinamically created textbox problem

  • devi0us
  • Born
  • Born
  • devi0us
  • Posts: 2

Post 3+ Months Ago

First of all hello to everyone, i am new to this forum.

I have a problem and i hope you will know how to help me. I think it should be quite simple.

I have dynamically created some textboxes with ActionScript and it works fine, until i add mask. I cannot see those textboxes under the mask. I know with the static text when i convert it to bitmap i can see it under mask. But the problem is i don't know how to do this with actionscript.

Can you help me with this problem?

Thank you very much.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

Dynamic text boxes don't play very nice with masks. To make life better make sure you embed the font in the text box.

this might help point you in the right direction
http://www.trainingfromthesource.com/books/flash/bonus/embeddingfontoutlines.php
  • devi0us
  • Born
  • Born
  • devi0us
  • Posts: 2

Post 3+ Months Ago

graphixboy wrote:
Dynamic text boxes don't play very nice with masks. To make life better make sure you embed the font in the text box.

this might help point you in the right direction
http://www.trainingfromthesource.com/books/flash/bonus/embeddingfontoutlines.php



thank you for your answer, but i am still not able to make the textbox appear under mask.
Are there any functions for converting textboxes to bitmaps or something like that?

Thank you
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

does the text box work without the mask? Just to make sure it isn't a pathing issue or something.

There are bitmap image functions in flash but you shouldn't need to do that.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

In my library I used the top-right option "New Font".
I choose a font & used the same value for "name" as was shown in "font" to avoid confusion.
When the new symbol showed up in my library, I right-clicked it & choose "linkage".
Then I selected "Export for actionscript" & used the same value as for font & name for Identifier.

I then went into my actions panel & used this.

Code: [ Select ]
function getTextFormat(fontSize:Number, fontName:String):TextFormat {
  var tf:TextFormat = new TextFormat();
  tf.align = "center";
  tf.size = fontSize;
  tf.font = fontName;
  return tf;
}


this.createEmptyMovieClip('container', this.getNextHighestDepth());
container.createTextField("txt", this.getNextHighestDepth(), 10, 10, 300, 40);
container.txt.font = "Tahoma";
container.txt.text = "Container Text";
container.txt.setTextFormat(getTextFormat(10, "Tahoma"));
container.txt.embedFonts = true;

this.createEmptyMovieClip("masker", this.getNextHighestDepth());
masker.beginFill(0x0000ff);
masker.lineTo(150, 0);
masker.lineTo(150, 40);
masker.lineTo(0, 40);
masker.lineTo(0, 0);
masker.endFill();
masker._x = masker._y = 10;

container.setMask(masker);
  1. function getTextFormat(fontSize:Number, fontName:String):TextFormat {
  2.   var tf:TextFormat = new TextFormat();
  3.   tf.align = "center";
  4.   tf.size = fontSize;
  5.   tf.font = fontName;
  6.   return tf;
  7. }
  8. this.createEmptyMovieClip('container', this.getNextHighestDepth());
  9. container.createTextField("txt", this.getNextHighestDepth(), 10, 10, 300, 40);
  10. container.txt.font = "Tahoma";
  11. container.txt.text = "Container Text";
  12. container.txt.setTextFormat(getTextFormat(10, "Tahoma"));
  13. container.txt.embedFonts = true;
  14. this.createEmptyMovieClip("masker", this.getNextHighestDepth());
  15. masker.beginFill(0x0000ff);
  16. masker.lineTo(150, 0);
  17. masker.lineTo(150, 40);
  18. masker.lineTo(0, 40);
  19. masker.lineTo(0, 0);
  20. masker.endFill();
  21. masker._x = masker._y = 10;
  22. container.setMask(masker);


This displayed the word "contain" in the flash player.
I commented out the last line.
Code: [ Select ]
//container.setMask(masker);

A blue box covered the word "contain" & the phrase "er Text" was visible directly to the right of the blue box.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 18 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.