Adam
Adam

Reputation: 731

Is there a way to break text through actionscript (convert text to a shape)

Is there a way to break text through actionscript so that it becomes a shape?

I know that I can hit CTRL+B two times to break apart text and convert it to a shape, but I need to do it through actionscript, so that a user can enter some text, and then I have some effects applied to it.

Thanks.

Upvotes: 2

Views: 734

Answers (1)

annonymously
annonymously

Reputation: 4708

Short answer: Not really.

Long answer: You can kind of achieve this effect using Bitmaps and BitmapData.

you could add effects to it by just using the filters as though it were a MovieClip.

If you were desperate to break the text up you could create a new text box in as many MovieClip objects as needed and set the text of the text boxes to 1 letter of the whole string. something like this (untested):

var letter_mcs:Array = new Array();

for (var i = 0; i < input_txt.text.length; i++) {
    letter_mcs[i] = new MovieClip();
    var currentLetter:string = input_txt.text.charAt(i);// the next letter
    var currentTextBox:TextField = new TextField();// the text box
    currentTextBox.text = currentLetter;

    // Set up currentTextBox however you want here

    letter_mcs[i].addChild(currentTextBox);
    stage.addChild(letter_mcs[i]);
}

Upvotes: 1

Related Questions