PDA

View Full Version : Canvas width equal to 0 always ?


firdosh
10-16-2006, 02:58 AM
I am adding a canvas to the application adn setting its width and height to 100% but when I trace out the width it traces 0 ??

thanks
cheers :)
firdosh

Tink
10-16-2006, 11:36 AM
Maybe your application has a width and height of 0?

firdosh
10-16-2006, 06:34 PM
the application width and height is set to 800x600 so if i do a trace from inside the canvas like

this.parent.width

traces out 800

Tink
10-16-2006, 06:37 PM
Maybe your checking the dimensions to early? i.e. no waiting until its been fully initialized and layed out?

firdosh
10-16-2006, 06:48 PM
tried that too ...traced it out on the initialize event function handler same thing :(

Tink
10-16-2006, 09:12 PM
too early bud.

initialize

After the initialization phase, properties are processed, the component is measured, laid out, and drawn, after which the creationComplete event is dispatched.

you want to do it after its been laid out and drawn etc using creationComplete

creationComplete
Dispatched when the component has finished its construction, property processing, measuring, layout, and drawing.