Flash/Javascript in IE
- Started
- Last post
- 4 Responses
- brandonbleed
Hey, sorry to nerd out here
I have several buttons within my swf that change the background image of the HTML page it is embedded in.
on (release) {
getURL("javascript:document.body...
}This works great in Safari, but completely fails and even crashes in IE. I have no JavaScript tag within the of the HTML page, but as I mentioned, it works in Safari. Does any one know either a better JavaScript to run, or a better way of doing this on click?
Thanks a lot.
- heavyt0
have you tried putting it into a js function, and then just calling that function?
also, i dont know of that beign in the DOM spec. try document.body.style.background = "url('i/1.jpg')";TR1
- Visia0
yeah, I think you should certainly put it into a javascript function instead of calling it directly. Plus, you might try adding .src= to the end. Not sure because I'm no DOM/javascript wizard but I think IE requires that you declare a src for any images.
- shaft0
As someone said, create a JS function and call it by getURL. If it works, you're lucky, IE tends to react badly to getURL.
If it doesn't work, you'll have to:1. define FSCommand in JS or VBS (VBS is safari safer because it's ignored better)
2. detect browser and pass the info to flash while embedding the swf (IE/other)
3. Depending on the browser, use getURL or FSCommand to call your function
- jevad0
I shit on IE