views:

452

answers:

2

We have a Flex application which has several 'pages' worth of content. Each time a page is opened by the user some of the information on the page needs to be refreshed (takes less than a second to do so). We currently display a 'loading' animation. The idea is to replace it with some kind of transition effect for the whole page and load the content in background while the transition is in progress.

Is it possible? Is it a good idea? Could someone share a link to a good example or article on the subject?

thank you very much

A: 

Sounds interesting, but you might have some users loading the content faster than others. For this to work you might need to synch the two ( loading and the transition ), so maybe do a speed test initially and once you know bytesTotal you can use that to estimate the duration for your transition. If the content you add in deosn't do much ( it's just an image or something static ) and there isn't anything that needs to init, that should be ok-ish.

George Profenza
+1  A: 

You can use something like this for the spinner. Not sure if that's part of your problem or not.

Otherwise, for your main pages, all you need to do is set myPage.visible=false while you're loading it. Once you get the FlexEvent.CREATION_COMPLETE event, you can set it back to visible=true. Even if visibility is false, the includeInLayout should still be true, which means the component will load correctly.

To make the spinner easier to show, you might need a canvas as the parent. Attach your spinner to that canvas, and your real page will be a child of the parent.

Glenn
not exactly what I was looking for but thank you for a good answer
Ilya Kochetov
Hmm. After re-reading your question is does seem like you're looking for something slightly more...can you explain what you mean by "transition effect for the whole page", if the page itself hasn't been rendered yet? Are you thinking of something like, for example, an animation that looks like a book's page turning? Or do you just want a fadeOut old page, fadeIn new page?
Glenn
The page is rendered but I would like to refresh a part of it every time it opens (price box)
Ilya Kochetov
This is the best answer so far and I believe the question was not that good to start with :) I will close it now and accept your answer
Ilya Kochetov