Skip navigation
maxelcat
Currently Being Moderated

changing format of text - can't!!!

May 27, 2009 6:13 AM

I have a textField inside a mc. When you roll over an event is triggered.



In the fuction I can do this

Code:
event.currentTarget.getChildAt(0).text="fred";
and the text changes - so its being targetted



I want to change the format of the text so I thought

Code:
event.currentTarget.getChildAt(0).defaultTextFormat=mTitle_fmt;


but, its doesn't work.



it says "ReferenceError: Error #1037: Cannot assign to a method setTextFormat on flash.text.TextField.
at index001_fla::MainTimeline/overHandler()"



Any pointers please



thanks
 
Replies
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    May 27, 2009 6:23 AM   in reply to maxelcat

    click file/publish settings/flash/permit debugging and retest.  using the line number in the error message confirm that error message references the line of code you displayed here.

     
    |
    Mark as:
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    May 27, 2009 6:47 AM   in reply to maxelcat

    that makes more sense.

     

    setTextFormat() is a method, not a property.  correct your syntax and recheck.

     
    |
    Mark as:
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    May 27, 2009 7:48 AM   in reply to maxelcat

    you're welcome.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points