Disclaimer: This is from memory, and details will be wrong :) I have documentation in the works for this, but it'll turn up in a blog post in a couple weeks when it's launched! I've also left out the sizing etc.
When you set fields of most properly written components, you're usually not setting anything that Flash uses for drawing. The component simply keeps a copy of your value, and calls invalidateProperties() which sets a flag. On the next frame, the Flex framework knows that this component needs to double check itself to see if it needs redrawing, so it calls commitProperties() on the component. The component does whatever checks it needs to internally, and if it feels the need to be redrawn will call invalidateDisplayList() which sets another flag, causing updateDisplayList() to be called on the next event cycle (usually the next frame). It's updateDisplayList() that sets the values on the components children. If the components children are UIComponents, the cycle continues in the children. If they're simply FlexSprites or MovieClips, it's now that the changes will be reflected on-screen. -Josh On Tue, Aug 5, 2008 at 6:36 PM, Paul Steven <[EMAIL PROTECTED]>wrote: > When you say delay the call to the method, do you mean set a timer to a > small time period (say 500 milliseconds) after which it will call the > "createStudentDataXMLFile" > function? > > > > I definitely must be missing something fundamental here as seems a really > long winded way to get some text to update as soon as I set its value? Would > binding the text to a variable make it update any quicker? > > > > *From:* [email protected] [mailto:[EMAIL PROTECTED] *On > Behalf Of *Ralf Bokelberg > *Sent:* 05 August 2008 09:16 > *To:* [email protected] > *Subject:* [SPAM]Re: [flexcoders] Delay before text is updated > > > > Another option is to delay the call to the method, which does the main > work. > > > Cheers > Ralf. > > On Tue, Aug 5, 2008 at 9:56 AM, Josh McDonald <[EMAIL > PROTECTED]<dznuts%40gmail.com>> > wrote: > > What does your method do? > > > > Most changes made to most components (such as changing the text property) > > won't be reflected on-screen until the next ENTER_FRAME is dispatched by > the > > player due to the way Flex works internally. If your method is simply > some > > gigantic or slow loop, you won't see anything until it's done- and you > > should probably split it apart and schedule it in pieces :) > > > > -Josh > > > > On Tue, Aug 5, 2008 at 5:43 PM, Paul Steven <[EMAIL > > PROTECTED]<paul_steven%40btinternet.com> > > > > wrote: > >> > >> Probably something really basic, but I am having trouble with delays > >> updating some text on screen. > >> > >> > >> > >> Basically I want to display a message on screen to tell the user to wait > >> whilst a save operation takes place and after the save operation change > the > >> text message back to blank. However I am not seeing this update. Here is > the > >> code > >> > >> > >> > >> savingMessage.text = "Saving. Please wait..."; > >> > >> > >> > >> _dataManager.createStudentDataXMLFile(); > >> > >> > >> > >> savingMessage.text = ""; > >> > >> > >> > >> > >> > >> Please note the createStudentDataXMLFile function takes about 10 seconds > >> to complete so in theory the "Saving. Please wait..." message should > appear > >> for this time. If I put an alert in before the calling of the > >> "createStudentDataXMLFile" function, then the text updates correctly. > >> > >> > >> > >> I have also experienced similar problems trying to get a "busy cursor to > >> appear" using the cursor manager and a call such as > >> CursorManager.setBusyCursor(); > >> > >> > >> > >> Again, the problem here is the cursor is not updating as soon as I call > >> the function. > >> > >> > >> > >> Anyone any ideas why these things are not updating on screen > immediately? > >> > >> > >> > >> Thanks > >> > >> > >> > >> Paul > >> > >> > >> > >> p.s I am using Flex Builder and packaging in Zinc 2.5 > > > > > > -- > > "Therefore, send not to know For whom the bell tolls. It tolls for thee." > > > > :: Josh 'G-Funk' McDonald > > :: 0437 221 380 :: [EMAIL PROTECTED] <josh%40gfunk007.com> > > > > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]

