Ajax and Flash refresh problem

mattura

Member
Messages
570
Reaction score
2
Points
18
I have a site with a flash presentation on it, and added a comment board for users to write reviews etc underneath.
The comment board uses ajax to view/post, so that the page does not refresh.

However, whilst the page does not refresh, the flash presentation DOES restart when the ajax response is received.

Example here (sql is being slow at the moment, you can probably get to level 2 before the comments appear!), 'pages' do not work:
http://www.matt.elementfx.com/test/game.php?id=5#comboard

Any ideas on how I can stop this happening?

YouTube have it working, but I couldn't find any obvious solution in their source.

Edit:

If the above link doesn't work, try this one:
http://www.pepperandsalt.co.uk/matt/elementfx/test/game.php?id=5#comboard
I don't think it likes Internet Explorer...
Edit:
yeah use firefox...
Edit:
_
So nobody knows? I was hoping somebody would have an idea...
I do have an 'exit();' after the php that the ajax calls, so it doesn't refresh after the first time. ie, the page loads, the swf loads and can be started; then the ajax call returns with the comment board and refreshes the swf. Then if you send another ajax request, the swf does not refresh.
Strange huh?
 
Last edited:

mattura

Member
Messages
570
Reaction score
2
Points
18
No, the whole idea is to avoid frames. It is possible, as youtube have done it.

It seems to be something to do with javascript, this is what I have:

HTML:
<span id="res"></span>
<a onclick="javascript:foo();">click me</a>
javascript:
Code:
function foo() {
 document.getElementById('res').innerHTML='<div>changed!</div>'
}

That code causes a flash on the page to restart!
If the <div> and </div> are removed, the problem does not occur!!!!
Edit:
Ok it seems to be a firefox bug.

I found a workaround:
enclose the content that you want to replace with div tags, hence:

HTML:
<swf embed code>

<div>
<span id="bar">this will be dynamically replaced</span>
</div>
 
Last edited:
Top