/    Sign up×
Community /Pin to ProfileBookmark

simulate key press

hi,
i’m new to javascript and was wondering if there is a way to simulate a keypress once the page has loaded.

what im trying to do is see if i can simulate a spacebar without it actually being clicked so i can cancel the double click thing with flash.

is this possible?

i have tried the usual scripts found on the net but none of them are working for me thats why i thought of this.

thanks in advance

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@KravvitzSep 13.2007 — There is an alternative:

[url=http://www.sitepoint.com/article/activex-activation-issue-ie/]ObjectSwap: Bypassing the ActiveX Activation Issue in IE[/url]

[url=http://blog.deconcept.com/swfobject/]SWFObject: Javascript Flash Player detection and embed script[/url]
Copy linkTweet thisAlerts:
@avanceauthorSep 13.2007 — thanks a lot. i gave it a try but still no joy. i'm not sure if it's because i'm using document.write to write the flash in why i'm having so much problems.

im gonna put the code below. please have a look and tell me if you think my theory is correct. what the page does is detects flash and if you have the required version it loads an xslt template containing the flash.

<script type="text/javascript">

var requiredVersion = 6;

var flashVersion = getFlashVersion();

if (flashVersion >= requiredVersion) {
<xsl:call-template name="FlashVersion" />
} else if (flashVersion > 0) {
<xsl:call-template name="FlashVersion" />
} else if (flashVersion == 0) {
<xsl:call-template name="HTMLVersion" />
} else if (flashVersion == flashVersion_DONTKNOW || flashVersion == null) {
<xsl:call-template name="HTMLVersion" />
}

</script>


------ calls the below template ----------------------------------------

<xsl:template name="FlashVersion">

<!--ajaxinclude(includefiles5, "random")-->


document.write('<div id='flashRegion'>');
document.write('<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='551' height='320' id='control' align='middle'>');
document.write('<param name='allowScriptAccess' value='sameDomain'></param>');
document.write('<param name='movie' value='control.swf?t_language='></param>');
document.write('<param name='quality' value='high'></param>');
document.write('<param name='bgcolor' value='#245CB7'></param>');
document.write('<param name="flashVersion" value="6" />');
document.write('<embed src='control.swf?t_language=' quality='high' bgcolor='#ffffff' width='551' height='320' name='control' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'></embed>');
document.write('</object>');
document.write('</div>');


</xsl:template>

thanks in advance for any help given
Copy linkTweet thisAlerts:
@KravvitzSep 14.2007 — Why would you want to use XSL for that? I don't think you can mix JavaScript with XSL like that, even in IE's strange implementation of XSL.
Copy linkTweet thisAlerts:
@avanceauthorSep 14.2007 — thats how all the pages on the site are constructed. its all asp.net with xsl and a whole load of stuff i don't understand. looking at how it is constructed is there a way i can call the function to disable the double click?

i know its kinda weird but as much as i would like to, i cant change the layout of the site just because i cant handle it.

can anybody help please?

thanks
×

Success!

Help @avance spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...