PDA

View Full Version : Actionscript reports wrong width


phil7
01-25-2010, 09:31 AM
Hi, can anyone help with this, its really irritating:

My set up is simple, i have imported a vector image from an .ai file and has it converted to a movie clip. (Instance name test).

In actionscript: i use trace(test.width); and it reports the wrong width! The width is clearly displayed as 541.5 in position and size section of properties but the traced value is 793.55.

Can anyone help with why this might be?

Thanks

[Paul Ferrie ]
01-25-2010, 10:02 AM
can you post the fla?

phil7
01-25-2010, 10:22 AM
Sorry I cant do that, since its for work, but here is a screenshot.

http://imgur.com/89ENU

The one line of actionscript that runs is : trace(lounge_mc.width);

[Paul Ferrie ]
01-25-2010, 10:31 AM
ok image doesn't help much but i do know that sometimes when you import an image into flash the size is off. Not sure why it does this. Check the transform setting for the import image and make sure it set at 100% for width and height. It's the only thing i can think of without seeing the fla.
you can pm me a link to download if your not wanting it in public view.

phil7
01-25-2010, 10:43 AM
Sent you a pm

[Paul Ferrie ]
01-25-2010, 11:03 AM
ah found it!

<Clip Group 0>_1 has a masked layer in it.
The object being masked is large and it's this that is throwing off the size.
Flash will return the actual size of an object even if the masked area of the object being masked. Hope that makes sense.

phil7
01-25-2010, 11:29 AM
Thanks very much, would never have found it without your advice.

[Paul Ferrie ]
01-25-2010, 11:37 AM
Thanks very much, would never have found it without your advice.
Don't worry yourself about not never finding it. It took me a bit of time to get it. I was in the middle of replying to tell you i was stumped when i had a thought.:thumbsup: