Posts Tagged ‘Flash’

Click on one of the items below to go to the post

Daily Delicious – Flash Performance and Memory Usage Tips

If you have not been to the Big Spaceship Blog yet, you should. They have all sorts of great tips and thoughts ripe for the taking. Their most recent article is the second post in a series of Flash performance tips. I was aware of a few, but others were completely new to me. Performance optimization may seem like a nerdy thing to some, but the process allow things to be done in Flash that otherwise would be too costly to the average processor or be a memory hog.

One of the pieces I especially enjoyed were links to resources on advanced collision detection. There has been some really good work in this area and I found is really helpful as my experience in that subject is extremely low. Really though, all the tips are very helpful and any Actionscripter should take a few minutes out of the day to read this article.

del.icio.us link

Flash Faux Font Weights

I am a bit of a stickler about keeping my swf files as small as possible. One of the biggest hurdles I run into for keeping swf file sizes low is the embedding of fonts. There are best practices you can follow, such as using system fonts for large amounts of copy and not embedding characters that will not be used. Still, a couple fonts and/or a couple different weights and your file size is considerably higher. It was during a project where I was having this very problem when I came up with a little trick to help lower the embed size of fonts – and it is extremely easy to do.

One of the new features that fell under the radar for me was the custom anti-aliasing of fonts. The custom anti-alias feature allow you to control the thickness and sharpness of text within a text field. This feature can really be helpful for when type rendered by Flash appears blurry – something I run into quite often. During my playing around with this feature, I noticed that the thickness setting has a dramatic impact on the rendering of the type. I then came up with the idea that I could simulate the weights of a font family by changing the thickness of a textfield appropriately. For instance, if your Flash project uses three different weights (light, medium & bold), you can use one weight to simulate all three and cut your font embed size by two-thirds. This trick is very basic – just select the textfield you want to alter and, in the properties window, select the character you wish to embed then click the anti-alias dropdown and select ‘Custom Anti-Alias’.

From there, you alter the thickness to match the weight you want to achieve. The maximum range for thickness is -200 to 200. In my usage, I have noticed that the normal weight values (i.e. Medium, Heavy, Bold, etc.) equal about 75 to 100 thickness points. For example, if original font weight was Medium, a thickness value of 100 would resemble Heavy and a thickness value of 200 would resemble Bold. I experienced a much better result with increasing the thickness than decreasing it. In most instances, I will only drop the thickness to -75 as any lower begins to distort the typeface. Ultimately, this technique is all about feel and will vary from font to font. As you can expect, there is an Actionscript equivalent to the custom anti alias feature. This can be nice because you can simulate weights dynamically.

With a range of font weights this high, I had to use two fonts to cover the full range. As I mentioned before, my experience is that you can only take a font two weight up, but only one weight down. Still, one font can cover four different weights. Therefore, I used the Thin and the Bold as my base weights to generate the all other faux weights. As can be expected, the results improve the smaller the font’s point size. Helvetica is a perfect candidate for this method as it is a very uniformed typeface and has many weights. As can be assumed, other large families such as DIN, Interstate, Univers, Frutiger and Futura and perfect for this as well. I have not spent much time using this method of serifed fonts, but from the little experience I have, the results are quite similar, even with greater contrast between thicks and thins.

This easy little trick can shave quite a bit off of a swf’s file size. If you are ever in need of using many different weights from a font, I highly suggest giving this method a try, it may just make your swf lighter and its users happier.

Anti-Flash Standardistas – You’re Cutting Off Your Nose to Spite Your Face

The more I read attacks on Flash, the more I end up shaking my head in confusion. Honestly, I am a little surprised this is still being debated. People, we need to get over this. Before I elaborate further, I want to make clear my support for web standards, usability and accessibility. Additionally, I understand the concern with Flash – it is not as easy to make accessible compared to HTML/CSS, it has, and continues, to be used for some really stupid things, etc., etc., etc. We have all been down that road, we have heard the arguments. That being said, standardistas: you are fighting a losing battle, and on top of it, a battle not worth fighting. Flash is about as standards-friendly as any media plug-in there is. For each bad use of Flash, there are hundreds being used well. Lastly, and more importantly, it is changing what we can do on a browser and how our generation accesses media. Please, for everyone’s sake, stop griping about Flash and start educating people on how it can be used more effectively with standards and accessibility in mind.
Read On…

Flash in HTTPS

This is probably a rare issue for most people, but one of my co-workers ran into a security warning when using embedded Flash in secure pages.

After a little Googling, I found out why the problem occurs and how to fix it. In case you’re too lazy, here’s the solution below:


<object classid="clsid:A67CDB6E-AE7D-11cf-96B8-344554540010" codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab #version=6,0,29,0"
width="700" height="300">
      <param name="movie" value="FOO/FOO.swf">
      <param name="quality" value="high">

      <PARAM NAME=wmode VALUE=opaque>
      <embed src="FOO/FOO.swf"
quality="high" wmode=opaque pluginspage="
http://www.macromedia.com/go/getflashplayer "
type="application/x-shockwave-flash" width="700"
height="300"></embed>
</object>

Thanks Mind-Probe

Flash XML Caching Solution

I have found quite a few people run into this problem from time to time and there’s actually quite an easy solution to take care of such an issue:


xml.load("xmlFile.xml?"+Math.random());

Essentially, Flash will think that the file is a different URL each time it loads the file and the psuedo parameter (‘?+Math.random()’) will be ignored for the file request. Clever and effective.