PDA

View Full Version : jscript problems in IE


kinase
06-24-2009, 04:20 PM
Hi
apologies if this is a really stupid question but I'm very much a beginner at this flash business and I'm completely stumped.

I making an interactive tutorial using flash 8. At a number of points I need a user to be able to click a button to expand an image (ie, load a large version of a thumbnail into a new browser window). I can use getUrl to load the images but I ideally need to resize the windows to fit each of the images.

So far I've tried these 3 methods

on (release) {
getURL ("javascript:openNewWindow('test.gif','win','height= 800,width=300,toolbar=no,scrollbars=yes');");
}


on (release) {
if (flash.external.ExternalInterface.available) { flash.external.ExternalInterface.call("window.open", "test.gif","win","height=800,width=300,toolbar=no,scrollbars=yes"); }
}


and

on (release) {
fscommand("openWindow", "test.gif|win|height=800,width=300,toolbar=no,scrol lbars=yes");
}

and whilst all these methods work absolutely fine in firefox, I cant get any of them to function in IE. It simply sits there and does nothing. Is there something desperately simple that I'm missing, have I made a total schoolboy error? Any help with getting this to work would be greatly appreciated.

Thanks in advance

kinase

tadster
06-24-2009, 05:08 PM
number two is the way to go however, you'll need to make a function in the wrapper that you will pass args to, not just calling window.open with args straight from the flash, instaed create a function in the html (linked .js or whatehaveyou) that then takes the args and opens a new window.

Better yet you can put your javascript inside of an XML string and just call the xml like so:

var myxml:XML=
<script>
<![CDATA[
function (args..)
{

function forargs(takeargs..)
{
window.open(takeargs..)
};

forargs(args..);

}
]]>
</script>;

...
ExternalInterface.call(myxml, "args");
...


hope this helps

kinase
06-29-2009, 03:25 PM
Thanks! I'll give that a bash.