By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,340 Members | 1,625 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,340 IT Pros & Developers. It's quick & easy.

AJAX & Flash

P: 3

I have embedded a Flash Movie in an AJAX HTML page which is created by JSF and ICEfaces.
When the page loads for the first time everything works fine. The gallery shows up and displayes all the pictures.

Now we use ICEfaces AJAX components to change some text on the page.
And when this happens the Flash Movie disapears (unloads(?)) from the page.
The space where the Flash Movie should be is just blank and Flash is not present there as the context menu is the one of the HTML page underneath.

The same components are used to render the page for the first time.
I am not quite sure wether this is a problem of Flash or AJAX in general.
Is there some magic we can apply to "reload" the Flash Movie?

Has anybody here ever tried something similar and did succeed?

Any hint is greatly appreciated,

Jun 26 '07 #1
Share this Question
Share on Google+
3 Replies

Expert 5K+
P: 5,821
Heya, Juergen. Welcome to TSDN!

My guess is that the Flash object is in the element that's getting overwritten when you change the text. If you're using Firefox or the new Safari beta, inspect your Flash object and look at its parent element.
Jun 26 '07 #2

P: 3
Thank you!

This is a great leap forward. In fact the element gets overwritten, but the new element contains the nearly the same Javascript code. The difference lies in a path where the flash should retrieve some pictures from. But this is correct.

Now the question is "Why is the Javascript code executed when rendering the page for the first time and not when rendering incremental changes?"

I will have to check on the rendering mechanisms of the browsers to find the key.

If I find out something useful I'll report it here.

Jun 27 '07 #3

P: 3
I found the (presumed) reason for the problem on this page:

"Even many DOM capable browsers will not run the contents of a script element that is is created using DOM methods after the page has loaded. The only way that JavaScript will reliably run a script is if the script is embedded in the page directly or via an external script file, while the page is loading."

If this is true, and all my tests seem to confirm this, then I have ot find a totally different way to solve this problem.

I will try to put the Flash Component outside the DataTable, so that it is loaded only once. And then I'll use the ExternalInterface Methods of Flash to change the contents of the Flash Component.

Jun 27 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.