trouble adding a rectange in actionscript
Posted
by touB
on Stack Overflow
See other posts from Stack Overflow
or by touB
Published on 2010-03-19T16:16:55Z
Indexed on
2010/03/19
16:21 UTC
Read the original article
Hit count: 151
I have a rectange that I've created and set its individual properties like so
var aRect:Rect = new Rect();
aRect.x = 10;
aRect.y = 10;
aRect.width = "15%";
aRect.height = "15%";
addChild(aRect);
I have 2 problems that the compiler seems to be choking on. The first is that the compiler chokes on 15%
and "15%"
, with or without the quotes, neither works.
The second is that adding the rectangle doesn't work. I tried all the following, but nothing works.
addChild(aRect);
Application.addChild(aRect);
Application.application.addChild(aRect);
stage.addChild(aRect);
What's the deal, I thought actionscript would be nicer than mxml.
© Stack Overflow or respective owner