1 person found this helpful
sym.$("text").html("2<sup>2</sup>"); // two with exponent 4
Can you give a little more detail on the usage of this?
I would like to superscript a registered trademark symbol that is at the end of a word that is part of a headline—no space between the trademarked word and the registered trademark symbol.
I tried copying and pasting your sample code ( "sym.$("text").html("2<sup>2</sup>");" ) into my text object and it just appears as code.
Just type on hte keyboard alt-0153 and you will get
Thanks for the quick reply! I have the ® symbol figured out, but the font we use for the headlines (can’t be changed) has a very large ®, so I’d like to make it superscript to knock it down a few sizes so it’s not so large.
And for Mac users who may happen upon this thread who may be confused by the “alt-0153” suggestion, it’s simply option + R on a Mac.
If it is too big still you could make the font small inside the sup like
I am not a mac user and so thanks for the tip!
It took me a few, but I figured out why your code wasn’t working. I was just putting it straight into a text block.
I eventually figured out that I needed to enter the code as an action.
My existing headline object happens to be named "description", so I left it in place without changing the existing text and added a "document.compositionReady" event to the Stage group in my Code window, then added a "Set Text" function as follows:
sym.$("description").html("Product Name<span style='font-size: 6px !important; vertical-align:super !important;'>®</span> remainder of headline text.");
The font-size value that works for others will vary depending on the font and base font-size value being used for the surrounding text.
Great and good job! Good luck on your project.
Thanks. And thanks for your help!
I was thrown off initially because, while I’ve done a great deal of Flash development over the years, most of my experience with Edge Animate so far has just been replacing text and images in pre-existing files so I haven’t had to mess with any coding yet, aside from replacing URLs for links.
Your help was enough to get me headed in the right direction though. Thanks again!
My pleasure! Now go help someone else!