I wrote my solution to this a couple weeks ago (never got any answers if it worked for the person who asked though).
take a look here: http://chattyfig.figleaf.com/pipermail/flashcoders/2006-August/170985.html It seems that the first use of a text height in actionscript can be unreliable but from the second time you reference it it looks fine. So if my theory holds its ground, your first use (the trace()) would print out the wrong value, but your assignment afterwards will be ok. Remove the trace and it shouldn't work. I'd love to have some feedback on this, its an intriguing one. hope this helps, - Francis On 9/28/06, vic <[EMAIL PROTECTED]> wrote:
Haha, I would seriously take that bet. You have to listen to what he is saying, xray will trip you out; not only can you control anything in your swf at runtime but you can also view all of its properties. I am new to it so i don't know all it can do but I KNOW it can help you with _height. V ----- Original Message ----- From: "John Grden" <[EMAIL PROTECTED]> To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com> Sent: Thursday, September 28, 2006 9:17 AM Subject: Re: [Flashcoders] movieclip._y = textField._height > sure it does (xray) - it has a logger too and it includes a timestamp (which > trace does not) - so, I would say it's actually a bit stronger of a tool for > timing issues ;) > > I got $20 that says he figures out the problem in under 10 minutes with > xray. > > :) > > On 9/28/06, Brian Williams <[EMAIL PROTECTED]> wrote: >> >> A trap I often fall into when debugging flash is missing the >> obvious. Take >> for example, >> >> > If I put movieclip._y = 60 , it works fine >> > If I put movieclip._y = textField._height , it doesn't work fine.... >> >> and then >> >> > trace(textField._height) prints 60, yes. >> >> then my question would be - did you trace at the same point in time that >> set >> _y? i.e. does your code look like >> >> trace(textField._height); >> movieclip._y = textField._height; >> >> if that prints 60, and the movieclip ends up at 0, then what that means, >> most likely, is that you set it 60, but then set it to 0 somewhere else. >> I've often lost an hour trying to debug similar issues. "It traces out to >> something and I set it to that, but it doesn't work". Well, maybe it did, >> and then some other point of the code changes the _y value. Or you had a >> typo, etc. >> >> Maybe the textField's height is 60 once it has text in it, but you're >> setting the y position before you put in the text. And so on. >> >> Xray is a great tool for inspecting the program's run-time state, but it >> doesn't help as much with debugging timing dependencies. >> >> --Brian >> _______________________________________________ >> Flashcoders@chattyfig.figleaf.com >> To change your subscription options or search the archive: >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders >> >> Brought to you by Fig Leaf Software >> Premier Authorized Adobe Consulting and Training >> http://www.figleaf.com >> http://training.figleaf.com >> > > > > -- > [ JPG ] > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com > _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
-- Francis Turmel Personal: [EMAIL PROTECTED] Business: [EMAIL PROTECTED] _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com