Simplyprofound.com
Flash, Flex, AIR, ASP.NET, PHP, AJAX, whatever it takes...

Superscript Registered Trademark in Flash

May 2, 2008 03:06 by dave

Some of the most elementary things can be so completely frustrating in Flash. In a recent project I needed to superscript a registered trademark® in both static and dynamic textboxes.

It is well know that Flash only recognizes a limited list of markup for html, and <sup></sup> is not among them. Various CSS solutions also do not work because the necessary CSS is also not recognized.

The solution? A custom embedded font.

I tried a free font, CG Superscript, which worked find for regular text, but not ®. 

The one that worked for me was Superscript, which rt now goes for $9.90. Originally, I dismissed this solution thinkin it was the same thing as CG Superscript. It didn't list ® on the site.

The instructions are simple and right on the homepage. They also offer a subscript font, same cost.

Much thanks to the illustrious Mike Creighton for getting me to take a second look at that font. 


Tags: ,
Categories: Flash
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

AIR: Changing Filename

April 4, 2008 10:41 by dave

I spelled something wrong. Oops. It's a pharmaceutical brand name, so get off my back. I fixed it in my filename, and code, and Flash library, and linkage, and....everywhere. The AIR program compiled and ran, done. Right? Wrong.

It was running and displaying an old version. I kept getting this error on my URLLoader when testing offline:

Error #2044: Unhandled ioError:. text=Error #2032: Stream Error 

Duh, I know. I'm offline and trapping for that error so I can move on. I knew I shouldn't be getting that error. But what was strange is that the filepath and code lines in the error DIDN'T EXIST ANYMORE.

So, I checked my Flash properties for the FLA to make sure the SWF filename had updated properly. Yup, it had.

Then I checked my AIR Application & Installer Settings. I had to do all this by hand, and this is where my problem was. The "Included Files" portion at the bottom of the form includes a reference to the SWF and the filename was pointing to the previous file. As a result, debugging showed the old file and code.

Can I wrap myself in a try{}catch{}? 


Firefox Search Plugins for Adobe LiveDocs

April 3, 2008 15:29 by dave

I stumbled upon some very useful Firefox plugins tonight. While I have LiveDocs in my linkbar anyway, I love being able to search Actionscript 3 and Flex documentation directly from the search engine field in Firefox. Check it out: 

http://en.flash-ripper.com/firefox-search-plugins-flash-flex-air-actionscript-adobe-labs/
 


How to attachMovie in Actionscript 3

April 1, 2008 06:33 by dave

I'm converting an older Flash (AS2) kiosk application to an AIR (AS3) desktop application. The challenges are many, but it's a great learning experience. I'm reminded that it's the simple stuff that seems to matter most - those little tricks you use daily to make your projects go.

One AS2 feature that I used extensively in AS2 (as did the developer that originally wrote this particular project), was the attachMovie.

myTarget_mc.attachMovie("myLibraryMovieClip","newClip_mc",_root.getNextHighestDepth()); 

In AS3, this is dead and gone, and has been replaced with:

var newClip:MovieClip = new MyLibraryMovieClip();
myTarget_mc.addChild(newClip);

I have old habits, but I'm growing to like this.

BUT I still need to accomplish what was done in the original where I didn't KNOW the name of the object in the library. I knew if was a MovieClip, but the name was being passed into the function as a variable. How in the world do I create a new MovieClip based on a string variable?! 

Here is what I have discovered. You can retrieve the class that is created with linkage in the Flash library by name using getDefinitionByName(). Once you have that, you can create a new instance of that and add it to the stage or parent object. It looks like this:

import flash.utils.getDefinitionByName; 

var myLibraryMovieClip:Object = getDefinitionByName(variableString);
var newClip:MovieClip = new myLibraryMovieClip();
myTarget_mc.addChild(newClip);

LiveDocs for getDefinitionByName(): http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/utils/package.html#getDefinitionByName()

And to give credit, I was turned on to this solution by a forum post over at Kirupa.


Tags: ,
Categories: Flash
Actions: E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed