views:

11

answers:

1

I have a rectange that I've created and set its individual properties like so

var aRect:Rect = new Rect(); 
aRect.width = "15%";
aRect.height = "15%";

Problem is the compiler chokes on 15% and "15%", with or without the quotes, neither works.

+1  A: 

Your first problem is the 15% thing, try this:

aRect.percentWidth = 15;
aRect.percentHeight = 15;

See what happens and we can go from there. Are you sure that adding the rect as a child is 'not working'? Is it just not visible? Where is this code exactly? If it doesn't compile with the 15% thing then how are you even testing the addChild code?

thenduks
Thanks. I will choose this answer, and open another question to be fair.
touB