mxyztplk333
asked on
Popup window with Flash object Text Box Focus Problem
I need to load a Flash object in a Popup Window with an Input Text Box. If I load the flash swf into a blank HTML page, I am able to type in the text box. However, if I load the same flash swf into a Popup Window, I am unable to type anything at all even though the cursor flashes in the text box as if the focus is on the text box. I can make this work if I use the WMODE to be WINDOW, but I would like to use TRANSPARENT for the WMODE parater. Is there a workaround? Any help would be appreciated. Thank you.
ASKER
The text box in Flash is just a standard text box. I am guessing that it doesn't have anything to do with the font in the textfield because I am able to type into the text box if I load it into a normal non-popup html window.
Here is how I load the flash into the Popup Window:
var obj = document.createElement("ob ject");
obj.setAttribute("id","fla sh_obj");
obj.setAttribute("classid" ,"clsid:D2 7CDB6E-AE6 D-11cf-96B 8-44455354 0000");
obj.setAttribute("codebase ","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab");
obj.setAttribute("width"," 233");
obj.setAttribute("height", "120");
var param2 = document.createElement("pa ram");
param2.setAttribute("name" ,"movie");
param2.setAttribute("value ", "http://mylocaliis/test.swf");
var param3 = document.createElement("pa ram");
param3.setAttribute("name" ,"wmode");
param3.setAttribute("value ","transpa rent");
var param5 = document.createElement("pa ram");
param5.setAttribute("name" ,"bgcolor" );
param5.setAttribute("value ","#000000 ");
var param6 = document.createElement("pa ram");
param6.setAttribute("name" ,"allowScr iptAccess" );
param6.setAttribute("value ","always" );
var param7 = document.createElement("pa ram");
param7.setAttribute("name" ,"swliveco nnect");
param7.setAttribute("value ","true");
var embed = document.createElement("em bed");
embed.setAttribute("name", "flash_obj ");
embed.setAttribute("align" ,"right");
embed.setAttribute("src", "http://mylocaliis/test.swf");
embed.setAttribute("wmode" ,"transpar ent");
embed.setAttribute("swlive connect"," true");
embed.setAttribute("bgcolo r","#00000 0");
embed.setAttribute("width" ,"233");
embed.setAttribute("height ","120");
embed.setAttribute("allowS criptAcces s","always ");
embed.setAttribute("type", "applicati on/x-shock wave-flash ");
embed.setAttribute("plugin spage","http://www.macromedia.com/go/getflashplayer") ;
obj.appendChild(param2);
obj.appendChild(param3);
obj.appendChild(param5);
obj.appendChild(param6);
obj.appendChild(param7);
obj.appendChild(embed);
T_PopupWindow.document.get ElementByI d("div1"). appendChil d(obj);
FYI, here are my environment details:
IE7
Flash Player 9.0.115
Actionscript 2.0
Thank you in advance for your expert guidance.
Here is how I load the flash into the Popup Window:
var obj = document.createElement("ob
obj.setAttribute("id","fla
obj.setAttribute("classid"
obj.setAttribute("codebase
obj.setAttribute("width","
obj.setAttribute("height",
var param2 = document.createElement("pa
param2.setAttribute("name"
param2.setAttribute("value
var param3 = document.createElement("pa
param3.setAttribute("name"
param3.setAttribute("value
var param5 = document.createElement("pa
param5.setAttribute("name"
param5.setAttribute("value
var param6 = document.createElement("pa
param6.setAttribute("name"
param6.setAttribute("value
var param7 = document.createElement("pa
param7.setAttribute("name"
param7.setAttribute("value
var embed = document.createElement("em
embed.setAttribute("name",
embed.setAttribute("align"
embed.setAttribute("src", "http://mylocaliis/test.swf");
embed.setAttribute("wmode"
embed.setAttribute("swlive
embed.setAttribute("bgcolo
embed.setAttribute("width"
embed.setAttribute("height
embed.setAttribute("allowS
embed.setAttribute("type",
embed.setAttribute("plugin
obj.appendChild(param2);
obj.appendChild(param3);
obj.appendChild(param5);
obj.appendChild(param6);
obj.appendChild(param7);
obj.appendChild(embed);
T_PopupWindow.document.get
FYI, here are my environment details:
IE7
Flash Player 9.0.115
Actionscript 2.0
Thank you in advance for your expert guidance.
ASKER
One addendum to my last post:
If it is a Popup window focus issue, perhaps there is a way in Actionscript(or javascript) to FORCE the focus on the text box when I click into the text box so that I may type in it?
Any workaround suggestions will be greatly appreciated.
Thank you.
If it is a Popup window focus issue, perhaps there is a way in Actionscript(or javascript) to FORCE the focus on the text box when I click into the text box so that I may type in it?
Any workaround suggestions will be greatly appreciated.
Thank you.
And what about the actionscript code? can send a link where I can see the problem ocrruing, or can you send the complete code for me to test locally ? From that code I can't say much. thank you.
ASKER
Hey julianopolito,
Sorry for the delayed response. I don't have a web server and am testing everything on my local IIS, so I am unable to show you the problem occurring unfortunately. But it's just when I click inside of the Text Box, the cursor blinks but I cannot type in it when the flash is loaded in a Popup window(but works fine when I load it into a blank html page). Even in the popup window, I can get it to type in the box if I set the WMODE to be WINDOW, but not when WMODE is set to TRANSPARENT. Here is the actionscript that I am using on the Submit button of the Input, if that helps:
on (release) {
_root.Submit(_global.data1 );
}
where data1 is the instance name of the input in the text box and Submit is the function that calls a javascript function that processes the data using ExternalInterface like this
function Submit( input1:Number ){
ExternalInterface.call("do Post",inpu t1);
}
I'll try to see if I can borrow my friend's webspace for some testing if necessary. Thank you.
Sorry for the delayed response. I don't have a web server and am testing everything on my local IIS, so I am unable to show you the problem occurring unfortunately. But it's just when I click inside of the Text Box, the cursor blinks but I cannot type in it when the flash is loaded in a Popup window(but works fine when I load it into a blank html page). Even in the popup window, I can get it to type in the box if I set the WMODE to be WINDOW, but not when WMODE is set to TRANSPARENT. Here is the actionscript that I am using on the Submit button of the Input, if that helps:
on (release) {
_root.Submit(_global.data1
}
where data1 is the instance name of the input in the text box and Submit is the function that calls a javascript function that processes the data using ExternalInterface like this
function Submit( input1:Number ){
ExternalInterface.call("do
}
I'll try to see if I can borrow my friend's webspace for some testing if necessary. Thank you.
I think it is a browser issue not flash issue. It seems to be related with the implementation of wmode n browsers. Can't you just put a background to mimic the main page background so you can use WMODE OPAQUE?
ASKER
Thank you for your response, julianopolito. The article, I think, is bringing up the issue in Firefox of textfields in flash being weird when wmode=transparent. In my case, I need to get this to work on IE6&7. I just tried your suggestion of setting WMODE to OPAQUE and it still does not allow me to type in the text box. The only thing that I can get to work so far is by setting the WMODE to WINDOW in the flash object that I load into the Popup Window. Please let me know if you have any other suggestions and I'll try it. Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Have embeded the font into the textfield?