-
Senior Member
window Focus new issue?
Hi,
I've noticed recently how theres a weird frame around my Flash movie, which goes away when I click on the window. I think Flash has always needed the user to click on the window to give it focus (or am I remembering wrong?), but is there anyway around this? can the window be giving focus with actionscript somehow?
thanks for any help
boombanguk
-
FK'n_dog
the browser takes precedence until the movie is clicked,
unless you add a function in your html :
PHP Code:
<script>
function focusIt(){
if(document.layers){
document.bob.focus()
}
else if(document.getElementById){
document.getElementById("bob").focus()
}
else if(document.all){
document.all["bob"].focus()
}
}
</script>
</head>
<body onload="focusIt()">
<object classid ... ID="bob" >
<param name=movie value="bob.swf">
<embed name="bob" ... src="bob.swf"
-
Senior Member
im not sure what I should set "bob" too? in my html for object id theres just a long number, not a name??
-
FK'n_dog
post the html source code that contains the <OBJECT> and <EMBED> tags for your movie and I might be able to answer
-
Senior Member
this from the source,thanks:
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="800" height="600">
<param name="movie" value="index.swf">
<param name="quality" value="high"><param name="BGCOLOR" value="#003366">
<embed src="index.swf"
-
FK'n_dog
PHP Code:
<HTML>
<HEAD>
<TITLE>focus movie</TITLE>
<script Language="Javascript">
<!--
function focusTheMovie(){
if(document.layers){
document.bob.focus()
}
else if(document.getElementById){
document.getElementById("bob").focus()
}
else if(document.all){
document.all["bob"].focus()
}
}
//-->
</script>
</HEAD>
<body onload="focusTheMovie();" bgcolor="#003366">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.ca
b#version=6,0,29,0" width="800" height="600" id="bob">
<param name="movie" value="index.swf">
<param name="quality" value="high">
<param name=bgcolor value=#003366>
<embed name="bob"
src="index.swf"
quality="high"
bgcolor=#003366
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="800" height="600"
></embed></object>
</BODY>
</HTML>
-
FK'n_dog
-
Amiga freak
Didn't work for me, just tried it.
-
FK'n_dog
microsoft has changed the way IE handles plugins -
http://blog.deconcept.com/2005/12/15...-flash-plugin/
have a look at FlashObject: Javascript Flash detection and embed script -
http://blog.deconcept.com/flashobject/
-
Senior Member
hi, thanks, I just posted your reply to the issue on the other thread thats running about it. Iron claw said that, that your solution didnt work?? anyone know why it didn't work? it looks pretty close to the solution here..
http://www.thinkydinky.com/click_to_...s_control.html
-
FK'n_dog
In IE 6.0.29, the code below works, it focuses the swf without user interaction.
Focus is given to an input textfield with - Selection.setFocus("myText");
and you can type without clicking into the movie.
It fails in FireFox, but I'm sure someone can post the workaround
focus.html -
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE>focus the movie</TITLE>
<script src=focus.js></script>
</HEAD>
<BODY onload="focusBob()" bgcolor="#7DC6BD" scroll="auto" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<TABLE HEIGHT='100%' WIDTH='100%'><CENTRE>
<TR><TD>
<script>loadBob();</script></CENTER></TD></TR></TABLE>
</BODY>
</HTML>
focus.js -
PHP Code:
function loadBob()
{
output = "<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=\"100%\" HEIGHT=\"100%\" id=\"bob\" ALIGN=\"\">";
output += "<param NAME=movie VALUE=\"focus.swf\">";
output += "<param NAME=loop VALUE=false>";
output += "<param NAME=menu VALUE=false>";
output += "<param NAME=quality VALUE=high>";
output += "<param NAME=bgcolor VALUE=#7DC6BD><EMBED src=\"focus.swf\" loop=false menu=false quality=high bgcolor=#7DC6BD WIDTH=\"100%\" HEIGHT=\"100%\" NAME=\"bob\" ALIGN=\"\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED></object>";
document.write(output);
}
function focusBob(){
if(document.layers){
document.bob.focus()
}
else if(document.getElementById){
document.getElementById("bob").focus()
}
else if(document.all){
document.all["bob"].focus()
}
}
tested online with -
http://www.jackleaman.co.uk/test/focus/focus.html
-
Thank you Thank You
for this post... why did thisd seem to happen all of the sudden. did i just miss it and it was always there
Thanks... worked for me
TM
Peace be the journey and Beyond
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
|