... ...
Home
Download
Docs
Examples
Login
Support
Contact Us
... ...

Workaround for Delay when using LiveConnect

This page suggests a workaround for a problem described here. This technique should work with any Java Applet, including ListenUp.

To Do

  1. Bookmark this page so you can come back.
  2. Exit the browser. Bye! (If you don't do this then you are not really testing the fix.)
  3. Relaunch the Browser and return to this page.. Hello again!
  4. Click here -> Call Java Applet
  5. Look for a printed message in the Java Applet below.
  6. Note that the elapsed time is very short. Yay!

ERROR: you do not have Java installed for your browser. Please install the Sun Java plugin.

How to Use this Workaround in Your Code

Step 1: Define this JavaScript function in your page <head> tag.

IMPORTANT: Change "document.NameOfYourApplet" to use the actual name of your Applet. This is set using the name parameter in in the <applet> tag.

// Keep checking to see if Applet is loaded.
// This call to isActive() will be the first
// LiveConnect call and will hide the delay from the user.
function touchLoadLiveConnect()
{
	if( !document.NameOfYourApplet.isActive() )
	{
		// Wait 100 milliseconds and try again.
		setTimeout('touchLoadLiveConnect()', 100 );
	}
}
                            

Step 2: Call this function after the Applet <tag>

// Force LiveConnect to load in background so we do not notice delay.
setTimeout( 'touchLoadLiveConnect()', 10 );
                            

       © 2001-2011 Mobileer, Inc.       JavaSonics ListenUp is no longer for sale. (EC2)