PDA

View Full Version : Component Height



colouredFunk
April 27th, 2009, 03:03 PM
Hi all,

I'm trying to get the height of a TextInput box (or any component for that matter) that is nested with in MC. When trace the height of the TextInput directly, it comes out at 22, great! But when I trace the height of the MC it's 100pixels!!!?? See below

import fl.controls.*
var mc = new MovieClip()
var textIn = new TextInput()
mc.addChild(textIn)
addChild(mc)
trace(mc.height) //outputs 100
trace(textIn.height)//outputs 22

Strange no?

Thanks

bzouchir
April 28th, 2009, 12:17 AM
this is because the textInput component movieClip height is 100.

Try this, drop a textInput component onto the stage and hit CTRL+E to edit that component movieClip.

then you'll see those skins on frame two (layer assets).
This why the height of the main mc is 100, because the actual height of the textInput mc is 100.

textIn.height is returned by the TextInput class and is not the actual height of the component's movieClip on stage.