Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Size of sprite different in AS3 and Flash

New Here ,
Jul 28, 2008 Jul 28, 2008
When i do a Select All of my symbol in Flash I get a height (lets say 300x300). Even if there are multiple items, it groups them together to give me the total size.

In AS3 I never get the same size. I have tried calling getRect(), width/height, etc... I get a different size, it's close but still invalid, sometimes smaller, sometimes larger.

To replicate this:
1. Create a new sprite with some text, add some paint brushes, etc..
2. Add the sprite to the stage and notice its width and height
3. Give the sprite an instance name (in this case I called it "block")
4. Add a document main source file and add the following code to the constructor (from the bottom of the script)

You will see that the size the code tells you and the size the flash editor gives are different. Is this a bug?
TOPICS
ActionScript
764
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 28, 2008 Jul 28, 2008
Is the sprite on the stage? If it is, is it on a whole pixel?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 28, 2008 Jul 28, 2008
1) yes the sprite is on the stage. It is accessible by AS3 just the size is wrong.

2) no, the sprite is not always a whole pixel, sometimes the size in Flash may be 300.50 x 210.90 etc..
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 28, 2008 Jul 28, 2008
1. you're using code to create your sprite and child objects, correct?
2. how are you "noticing" the sprite's properties in the flash ide?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 28, 2008 Jul 28, 2008
LATEST
I'm not adding the sprites dynamically. I am doing it through the Flash editor.

I am noticing the size of the sprite by just what Flash says when I have it selected on the stage.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines