Feeds:
Posts
Comments

Archive for August, 2007

Why isn’t stageWidth == stageWidth?

So you might be embedding you SWF into an HTML page and then you discover that stageWidth/stageHeight are almost but not entirely unrelated to the actual dimensions of the embedded component. Or, rather, it’s more complex than that: they equate exactly to the dimensions you provide, but drawing a box from (0,0)->(stageWidth,stageHeight) doesn’t actually [...]

Read Full Post »

stageWidth vs width (aka, “why is width zero?”)

So one of the first things you might wonder is “what’s my width?” Probably the first thing you’ll do is just test this.width (ie, the width of the current sprite). However, it’s zero. Then you might think to try stage.width, but it’s also zero. The correct answer is stage.stageWidth.
As for the [...]

Read Full Post »

My First Animation

Ready for some animation? It’s quite easy: just listen for the ENTER_FRAME event sent by the “stage” (the object representing the canvas on which all graphics are drawn) as follows:

package {
import flash.display.Sprite;
import flash.events.Event;
import flash.display.Stage;
public class HelloWorld extends Sprite [...]

Read Full Post »

No way to pass primitive types by reference?

Wow, that’s very strange.

Read Full Post »

HelloWorld.html

Generally you don’t want your component to take up the entire page. Rather, you want to embed it somewhere in another page. No trouble, just put this in a HelloWorld.html file and you’re good to go:
<html>
<body>
<object classid=”clsid:D27CDB6E-AE6D-11cf-96B8-444553540000″
[...]

Read Full Post »

HelloWorld.swf

One thing I was surprised to learn is how easy it is to program in ActionScript. It’s pretty much just like a compiled version of JavaScript, with a few slight improvements. One thing to keep in mind, however, is the output is a SWF file rather than an EXE, and the “application” is [...]

Read Full Post »