You’re using Flash 10’s native 3-D API and notice the projection goes a little skewiff when resizing the window.
You need to reset the stage’s projection centre on stage resize, like so…
var centre:Point = new Point(stage.stageWidth/2, stage.stageHeight/2);
root.transform.perspectiveProjection.projectionCenter = centre;
In moving to compiling projects with the new Flex SDK 4, I noticed a couple of gotchas to do with the EMBED metatag that I thought I’d share:
Runtime Shared Libraries
If you wish to embed assets in your SWF with the EMBED metatag, so you can manage and update things easily, there’s an extra compiler parameter you must add, in order for your project to compile properly:
This is already added as a new default parameter in FlashDevelop projects. But if you’re planning to build projects from outside a similar IDE, you must add this to your compiler string. Otherwise, the compiler will think you have uninitialised constants and warn you so.
Using the EMBED metatag, or even better runtime loading, for fonts is the sensible way forward. The amount of projects I’ve seen where you need to build from an FLA file full of fonts, which you need to hunt down and install is crazy. With Flex SDK 4, you’ll need to add an extra attribute to your embed tag for fonts, called ’embedAsCFF’:
[Embed(source=’myfont.ttf’, fontName=’MY_FONT’, fontWeight=’regular’, unicodeRange=’U+0020-U+0040,U+0041-U+005A’, mimeType=’application/x-font’, embedAsCFF=’false’)]
public static const MY_FONT :Class;
Explore 2 million years of human history in a completely new way.
I just finished a new project, called A History of the World in 100 Objects. It’s a joint venture between BBC Radio 4 and the British Museum, to chart human history in a new way. Continue reading A History of the World
I cobbled this Webcam effect together for no other reason than creative curiosity – a digital hall of mirrors thing, I suppose. Best viewed on your laptop, since it requires Flash and a Webcam…
And for the techies, here’s the source code (zipped FLA).
I quickly cobbled together this little demo using the new native 3D transforms in Flash 10. Alongside the regular transform.matrix property, DisplayObjects now have a transform.matrix3D property, which controls its appearance in 3-D space. It’s pretty easy to play with in Flash CS4, without any coding knowledge – I can’t wait to see a version of GTA built using this 🙂