Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8964111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:30:44+00:00 2026-06-15T16:30:44+00:00

As you well know in as3 we have a getBounds() method which returns the

  • 0

As you well know in as3 we have a getBounds() method which returns the exact dimension and coordinates of the movieclip in the DisplayObject container we want.
Fact is that these data are calculated based on the graphics in their state in the MC at the frame it is while getBounds() is called.

What I want is the REAL bounds rectangle, that is the larger rectangle that the WHOLE animated movieclip will take in its container.
I thought of two ways:
1 – a flash built-in method that I don’t know
2 – going through every frame always getting the bounds and finally returning the biggest (but what if it’s a long animation? should I wait for it to play completely before I can get what I want?)

I hope I’ve been clear. If you need examples, let me know!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:30:46+00:00Added an answer on June 15, 2026 at 4:30 pm

    You can iterate through each frame without having to wait for the animation to play:

    Let’s say your clip is called bob:

    var lifetimeBounds:Rectangle = new Rectangle();
    bob.gotoAndStop(1);
    for(var i:int=1;i<=bob.totalFrames;i++){
        lifetimeBounds.width = Math.max(lifetimeBounds.width, bob.width);
        lifetimeBounds.height = Math.max(lifetimeBounds.height, bob.height);
        lifetimeBounds.x = Math.min(lifetimeBounds.x, bob.x);
        lifetimeBounds.y = Math.min(lifetimeBounds.y, bob.y);
        bob.nextFrame();
    }
    
    bob.gotoAndStop(1); //reset bob back to the beginning
    

    It’s more CPU taxing (so I’d recommend not using it if the above works for your situation), but you could also use getBounds() in the example above and compare the returned rectangle against the lifetimeBounds rectangle:

    var tempRect:Rectangle;
    var lifetimeBounds:Rectangle = new Rectangle();
    bob.gotoAndStop(1);
    for(var i:int=1;i<=bob.totalFrames;i++){
        tmpRect = bob.getBounds(this);
        lifetimeBounds.width = Math.max(lifetimeBounds.width, tempRect.width);
        lifetimeBounds.height = Math.max(lifetimeBounds.height, tempRect.height);
        lifetimeBounds.x = Math.min(lifetimeBounds.x, tempRect.x);
        lifetimeBounds.y = Math.min(lifetimeBounds.y, tempRect.y);
        bob.nextFrame();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a serious issue with Liferay 6.1 themes , I know well about
I know java well, and have some experience in EclipseLink, Hibernate, JSF, Grails and
I'm using Java 6. I want to parse XHTML that I know is well-formed.
well i do not know how to use sql union properly . i have
I know it's not possible to overload operators in as3, and have been using
I have to add something to an existing as2 project. I know as3 pretty
I'm trying to consume a DLL-located method in C#, which returns a dynamic array
It's well know that ATL hooks a window to it's wndproc by thunking, which
I have log file of multi threaded application. Each line has a well know
Does anyone know a good helper class for stageVideo with as3 that works well

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.