Week 7 of the ActionScript intro yet again carries on with the theme of coding rather than just talking about coding and yet again comes as a document instead of slides. All the text output we’ve been using so far has been to the debug console, which a.) is only useful for debugging, b.) is only visible in a web browser to people using the debug version of the flash plugin and c.) looks rubbish. So to remedy this, we’ll be looking at TextFields and TextFormats, and how we can use them to display text of any size, colour, font, orientation etc, and even generate random text formats.
In this bundle I’ve combined both Week 7 Lessons 1 and 2 into a single document and provided the full source code to the exercises, but it’s recommended that you work through it yourself instead of just copying and pasting the code, ya dig?
By the end of this tutorial, you’ll be able to build a font clock like this, not that you’d particularly want to (because this melon is for display purposes only =P) – but you get the gist:
That’s got to just about cover most of the things you might want to do with text (i.e. choose a font, a colour, a size, a location, and an orientation).
Download link: An Introduction to ActionScript 3.0 – Week 7 (both lessons combined)
Audience: Beginners who know a little about variables, functions, objects and how to perform some basic programming math.
Content License: The document, its contents and the provided source code is released under a creative commons non-commercial attribution share-alike 3.0 license by me (r3dux) and comes with no guarantee of correctness, fitness for purpose or anything of the sort. The Adobe Quickstart PDF was printed from content created and owned by the Adobe Corporation and the subway font used in the font-embedding example was created by Johan Waldenstrom (great font, Johan!).
Comments & feedback always welcome.