Tuesday, June 1, 2010

Problems with embed Flash in GWT

Hello!
Since yesterday I have tried to add a flash file into my GWT app. The flash file should display an image and has zooming functions. The image is created by a servlet from a base 64 coding.
The code works perfectly in Firefox, the image is displayed, but it does not work in IE, Chorme or Safari. This is my Java Code:

String imageUrl = "dmisv2/Display?action=getImagingFinding&befundeID="+befundeId+"&width=1280";
System.out.println("Image Url: "+imageUrl);
System.out.println("Path: "+Window.Location.getPath());
String webpage =
"<div id=\"flashwrapper\"><script type=\"text/javascript\">\n"+
"var url = escape(\"components/FlexiZoomer/sample.jpg\");\n"+
"var flashvars = {};\n"+
"flashvars.imgSrc = url;\n"+
"var params = {};\n"+
"params.scale = \"noScale\";\n"+
"params.salign = \"lt\";\n"+
"swfobject.embedSWF(\"components/FlexiZoomer/flexiZoomer.swf\", \"flashContent\", \"1004\", \"740\", \"9.0.0\",\"components/FlexiZoomer/expressInstall.swf\", flashvars, params);\n"+
"</script>\n"+
"<div id=\"flashContent\">Detecting Flash</div></div>";

HTMLPane content = new HTMLPane();
content.setWidth(1004);
content.setHeight(740);
content.setContents(webpage);

SmartGwtWindow enlargement = new SmartGwtWindow();
enlargement.createSmartGwtWindow(1024, 768, title, content , false);

As you can see I use SmartGwt and I know that I do not use JSNI fort he Javascript, but however it is working in Firefox. I already enabled the test mode, therefor I do not load the image from the servlet.
In IE, Chrome and Safari I only get my messages which is written in the <div id=content"> no flash is loaded. If I try this code in a simple html file meaning not in java it is also working in IE, Chrome and Safari.

What can be the reason for hat, how can I solve it? I am not an expert in flash.

Thanks,
Florian

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment