|
-
Mar 22nd, 2010, 11:45 AM
#1
Thread Starter
Frenzied Member
How send keep alive signle to applet using ajax?
Hi all . There is an applet based applicatiobn, which has session time out period of 12 min.I want to override this behaviora and want write a keep a live html,which automatically submit a time based request, so the session will be always alive. Could you guys show me how i can use ajax to send a keepalive signal to this applet.(note i don't have the source code for the applet)Is there a way to make a dummy reqeust to this variable of applet without need to refresh the whole html page that holds the applet ?
<param name='FlashVars' value='http://www.somesite.com/id=1234567894&theme=1' />
Looking forward for some replies.Thanks
applet html:
HTML Code:
<object classid='clsid:D27ABC-AE6D-11cf-97B8-412345540000' id='cameo' width='300' height='250' codebase='http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab' wmode="transparent">
<param name='movie' value='http://www.somesite.com/meaw.swf' />
<param name='quality' value='high' />
<param name="wmode" value="transparent" />
<param name='bgcolor' value='#000000' />
<param name='FlashVars' value='id=1234567894&theme=1' />
<param name='allowScriptAccess' value='always'/>
<param name='allowNetworking' value='all'/>
<embed name='cameo' width='300' height='250' type='application/x-shockwave-flash' pluginspage='http://www.adobe.com/go/getflashplayer' src='http://www.somesite.com/meaw.swf' quality='high' bgcolor='#000000' FlashVars='id=1234567894&theme=1' allowScriptAccess='always' allowNetworking='all' align='middle' play='true' loop='false' quality='high' wmode="transparent">
</embed>
</object>
-
Mar 23rd, 2010, 11:45 AM
#2
Re: How send keep alive signle to applet using ajax?
For an applet, this looks an awful lot like a Flash SWF to me...
That being the case, you don't need AJAX. Just create a Javascript function that sends the variable, and set a timeout so that function will execute repeatedly. Here's Adobe's page detailing how to send vars to Flash. And here's a page about timeouts in Javascript.
-
Mar 23rd, 2010, 05:28 PM
#3
Thread Starter
Frenzied Member
Re: How send keep alive signle to applet using ajax?
Samback Many Many thanks for explaining the issue for me. could you show me how using java script i can send the variable to swf without having to refresh the page ? I want a way to send varible to swf file so the application thinks as the application is reloaded so that way the application be alive at all time.
Should i call this line within java script every few mins:
<param name='FlashVars' value='id=1234567894&theme=1' />
If the answer is yes how without refreshing the whole page. I was thinking a solution like ajax post method but dont know how do it!!
so i be happy if help here.Thanks
-
Mar 24th, 2010, 11:26 AM
#4
Re: How send keep alive signle to applet using ajax?
I use Flash sparingly these days, so I'm not always up-to-date on its most recent aspects. But if you read over the pages I linked, it should be of some help.
I'll repeat, you do not need AJAX for this. The process you need goes like this:
1. create a Javascript function that will send the desired variable to the Flash object
2. create a Javascript timeout that will set the function to execute repeatedly at a set interval
For step 1, here is Adobe's sample code:
Code:
<script language = "JavaScript">
<!--
function PassFlash(){
window.document.movie.SetVariable("text", "hello");
}
//-->
</script>
The function uses a DOM path to access the Flash object's SetVariable() method. The difference between this example and your code is that your <embed> tag has a name of "cameo" rather than "movie", and that your variable is named "id" and you want to set it to "1234567894". Adobe's page also mentions that you'll need the attribute "swLiveConnect" on your <embed> tag, and that it should be set to "true".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|