Skip to main content
Known Participant
May 20, 2010
Question

Certificate Widget - Text formatting problem

  • May 20, 2010
  • 1 reply
  • 711 views

Hello:

(FYI: This question is also posted in the Action Script 3 forum)

I have been modifying the AS3 Certificate Widget that ships with Captivate 4 -- adding backgrounds, re-sizing, etc. However, I don't know how to modify the text format of the variable values when they display. Regardless of what I try, the displayed text seems to be 8pt. Arial. Keeping in mind that I am a complete novice with Action Script, please let me know how you think I might affect the text attributes.

Here is code around line 35:

var y_fmt:TextFormat = new TextFormat();
y_fmt.font = "Arial";
y_fmt.size = 30;
y_fmt.bold = true;
y_fmt.align = "left";

It would seem that modifying the assignment for y_fmt.size would have some effect, but it does not. It does, however, change the font size of data in the widget parameters. So, I think my problem is that I don't know how to apply my custom TextFormat class to text that appears in these variables:

v_Name1.visible = true;
v_Course.visible = true;
v_Grade.visible = true;
v_Date.visible = true;
v_Score.visible = true;

I would be happy to provide all the code if that is appropriate (and helpful.)

Any guidance would be greatly appreciated.

Thanks!

Charlie

    This topic has been closed for replies.

    1 reply

    May 20, 2010

    Hi Charlie,

    There is a little bit of junk in the current Captivate widgets. The AS3 certificate uses a label component to display the text. The TextFormat you're customizing is for the Widget Parameters in the Widget Dialog. The text is then copied over to the label and displayed on the certificate.

    What you have to do is to create a new text format say:

    var course_fmt:TextFormat = new TextFormat();
    course_fmt.font = "Arial";
    course_fmt.size = 30;
    course_fmt.align ="center";
    course_fmt.bold = true;
    course_fmt.color = 0xFF0000;

    and then assign it to the label such as

    v_Course.setStyle("textFormat", course_fmt);

    You can then apply the same recipe to the other labels: v_Name1, v_Score, v_Grade and v_Date.

    That should do the trick!

    Whyves

    ___________________________

    www.flash-factor.com

    Known Participant
    May 20, 2010

    This is very helpful. I'll give it a shot.

    Thanks!

    Charlie Mullin

    Manager | KPMG | CTEC Forensic Technology Services

    714.934.5433 | cmullin@kpmg.com

    Training & Documentation

    https://www.traininganddocumentation.ctecfts.com

    Known Participant
    May 22, 2010

    The text fomatting syntax works perfectly.

    Thanks!

    Charlie