Changing color of text programmatically


I have looked for answers in the forum and the net but could not find what I was looking for. I want to change the color of a text (or use strikethrough) by embedding html commands into strings generated by javascript and sent back to the player for display in a textbox. So far, I have been able to make <b> and <i> work but I have not been able to change colors or use the <strike> command to strikethrough text.

I must be missing something. Any ideas would be welcome.



6 Replies
Mark Ramsey


When you use a Javascript string to render text in a variable embedded in a Text Box, you have only a limited sub-set of HTML that you can use if you are trying to publish to Flash. If you are publishing to HTML you have a wider range of mark-up at your disposal.

Here's a link that will give you what's available when publishing to Flash:


I have a text variable defined within Storyline, called theText.

I embed theText into a slide: %theText%.

I set up a trigger that fires when the timeline starts (or anywhere along the timeline):

var filler = "<span><font color='#FF0000'>Hi</font> Mark</span>";

var player = GetPlayer();


This renders the text wrapped by the <font> markup in red. You need to use hex numbers to describe colors to make this work for both Flash and HTML5.