1 (edited by sranki 2009-11-09 16:42:02)

Topic: onAudioEnd function not working in ie

Hi there,

Im having trouble getting an onAudioEnd function to work.

Looks really simple but is not working in ie

   

ss_listen = new Object();
 
ss_listen.onAudioEnd = function(){
getURL("main.html");
trace ("end");
}

Works locally and in other browsers. Any help would be greatly appreciated.

Cheers!

2

Re: onAudioEnd function not working in ie

That code looks right.

Any chance you can post the URL?  If it is working everywhere EXCEPT online in IE, then it might be related to the embed code. 

Double-check that you've got:

<param name="allowScriptAccess" value="always" />

... in your embed code.

Also, what version of IE are you using?

-joe

3

Re: onAudioEnd function not working in ie

As a quick test, can you try this?

getURL("main.html", "_self");

I'm not sure if that will make a difference, but I've always added the optional window parameter for getURL.

I'll test you're URL here now.

joe

4

Re: onAudioEnd function not working in ie

I have tried that.

I've also tried getting it to jump to different frames as well as other functions.

I just won't execute the onAudioEnd.

5

Re: onAudioEnd function not working in ie

Actually, it doesn't look like the trace is being called on IE, so this isn't an embed issue at all.

It looks like Flash Player in IE isn't reading the audio end state. I've got an idea for a simple workaround.  I'll be right back ...

-joe

6

Re: onAudioEnd function not working in ie

Try this instead:

ss_listen = new Object();

ss_listen.onTimer = function(info){
    if ( info.elapsed_percent > 99 ) {
        getURL("main.html");
        trace("end");
    }
}

It should do the exact same thing as onAudioEnd (but hopefully correctly).  I'm not sure why IE isn't reporting correctly, but it's probably quicker to workaround it than try to figure it out.

-joe

7

Re: onAudioEnd function not working in ie

hi Joe - I might be having caching issues but it doesn't seem to be working at this stage.

8

Re: onAudioEnd function not working in ie

Looks like that worked here, though it is calling the getURL repeatedly.  I can fix that ... be back in a second.

joe

9

Re: onAudioEnd function not working in ie

Here we go, this should be it:

ss_listen = new Object();

end = false;
ss_listen.onTimer = function(info){
    if ( info.elapsed_percent > 99 && !end ) {
        end = true;
        getURL("main.html");
        trace("end");
    }
}

10

Re: onAudioEnd function not working in ie

I have implemented the code but am having caching problems. Are you able to see the corrections?

11

Re: onAudioEnd function not working in ie

I'm seeing the correction, which does work on IE, but you should use the last code I posted.  It's better than that first workaround.

This is the right one:

ss_listen = new Object();

end = false;
ss_listen.onTimer = function(info){
    if ( info.elapsed_percent > 99 && !end ) {
        end = true;
        getURL("main.html");
        trace("end");
    }
}

-joe

12

Re: onAudioEnd function not working in ie

Joe - Thank you very much for helping me with this. I really appreciate it.

13

Re: onAudioEnd function not working in ie

No problem.  I'm glad that helped ... just so you know (and it may be a caching issue) but I'm still seeing the first workaround code.  Just to re-iterate, the last workaround code I posted is much better; it prevents the getURL from being called repeatedly.

It's late here (GMT -5) ... be back online tomorrow morning.

-joe