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

  • Home
  • SEARCH
  • 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 8966921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:07:38+00:00 2026-06-15T17:07:38+00:00

I have an application that switched between different graphs in Flex. Each graph is

  • 0

I have an application that switched between different graphs in Flex. Each graph is it’s own state. In the MXML I have it set so that the source of the image change when the state changes:

<s:Image id="chartImage"
         source.all="{ callImages.all }"
         source.classA="{ callImages.classB }"
         source.classB="{ callImages.classA }"
         />

I have buttons that successfully change the images. However, I have a small bug which occurs because after the line

this.currentState = chartName;

My code expected the graph image source to be changed, however the actual change to the s:Image element doesn’t appear to happen until after the function ends and the screen updates, I assume. So when it grabs chartImage.height, it uses the old one from the state I just left.

Is there a way to have it get the new image (and thus it’s dimensions) so I can do calculations with those dimensions on the next line? So far, chartImage.height returns the height from before the state change, but it is different after the function executes.

I could run a timmer after a fraction of a second then execute the lines there, and it would work. However, I’d rather tell it to render the screen and then continue my code. Is this possible? It just seems more elegant.

  • 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-15T17:07:39+00:00Added an answer on June 15, 2026 at 5:07 pm

    Is there a way to have it get the new image (and thus it’s dimensions)
    so I can do calculations with those dimensions on the next line?

    Each Flex component must go through it’s own validation cycle, which is built on top of the Flash Player’s rendering mechanism. There are some great posts out on this, if you perform a Google search for the Flash/Flex Elastic Racetrack.

    However, you can force a component to run through it’s validation methods in a linear manner by calling the validateNow() method.

    It is possible–especially if you have a state transition–that the properties on your Image have not changed yet after you set the currentState variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have application that makes different queries with different results so the caching in
We have a Flex/Flash application that loads information from XML files created by a
So I have an application with 3 actionbar.Tabs that switch between 3 fragments. Within
I have an application that was working in ruby 1.8.7 When i switched to
I have an android application with a gallery that switches between textswitcher views. It
I have an application that switches between usercontrols a lot, I want them to
I have an application that runs the a command as below: <command> <switches> >&
I have a console application that uses a number of command line switches to
I have application that is connecting to the DB and if I enter incorrect
I have application that is up more than 3 days. I can see in

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.