[RESOLVED] format text using function doesn't work
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] format text using function doesn't work

  1. #1
    Member
    Join Date
    Jun 2003
    Location
    sunny SoCal
    Posts
    76

    resolved [RESOLVED] format text using function doesn't work

    I am trying to populate a text box with different text on each frame. I am using Enter Frame to control loading the new text, but I lose the formatting when I do that.

    Code:
    this.addEventListener (Event.ENTER_FRAME, popUpText);
    function popUpText (event:Event):void{
    	Object(this).PopUp_mc.pop_txt.htmlText=textArray[(currentFrame-1)];
    }
    and here is the code to apply the style to the text box:
    Code:
    Object(this).PopUp_mc.pop_txt.setTextFormat(myTF);
    Why am I losing my formatting the moment I put it in a funtion? It works fine by itself, but then I it won't update on each frame.

    Thanks!

  2. #2
    Member
    Join Date
    Jun 2003
    Location
    sunny SoCal
    Posts
    76
    I added the text format code into the popUpText function, and it works! Guess it just had to be part of the function and not added separately.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com