I recently developed a site where there is a flash banner in the home page when I was doing the testing I found in Iphone it is blank it event don’t bother the alternative content of flash. I am using swfobject to embed the code in my web-page.
The alt content is shown by the JS though, right? (Doesn’t JS determine if someone has Flash or not and shows alt content if the user/device doesn’t have Flash?)
Post your <object> html code.
Yes, as far as I’m aware.
<script type="text/javascript">
params = {};
params.wmode = 'transparent';
params.scale = 'noscale';
swfobject.embedSWF("banner.swf", "myContent", "100%", "386", "9.0.0", "expressInstall.swf", '', params );
</script>
<div id="myContent"><img src="banner.jpg[U][/U]" alt="" width="920" height="386" /> </div>
I am using swfobject for this
Um… when I used swfObject I did still have actual <object>s in my HMTL. I’m assuming your version is adding those tags dynamically then?
If you’re running Firefox (cause I dunno how to do this in any other browser), if you have the web developer toolbar, you can right-click on the page and View Generated Source, and post that (so we can see the HTML the browsers are getting after the script runs).
You are certain Javascript is enabled in your iWhatevers? Are there any problems on Desktop Safari browser?
<script type="text/javascript">
params = {};
params.wmode = 'transparent';
params.scale = 'noscale';
swfobject.embedSWF("banner.swf", "myContent", "100%", "386", "9.0.0", "expressInstall.swf", '', params );
</script>
<object width="100%" height="386" type="application/x-shockwave-flash" data="banner.swf" id="myContent" style="visibility: visible;"><param name="wmode" value="transparent"><param name="scale" value="noscale"></object>
this is just swfobject generated content.
So, if there is no Javascript enabled in the browser, it should get the div with the image.
If Javascript is enabled AND the user has Flash, they get the Flash.
If the user has Javascript and no Flash, I don’t see a child in that <object> tag.
<object width="100%" height="386"
type="application/x-shockwave-flash"
data="banner.swf"
id="myContent" >
<param name="wmode" value="transparent">
<param name="scale" value="noscale">
[b]<img src="banner.jpg" alt="" width="920" height="386" />[/b]
</object>
?
The limited code you’ve posted seems to replace the default div with an <object>. Objects themselves can (do) have alternate children who show if the object cannot call the file it’s calling.
swfobject replace the content in <div id=“myContent”><img src=“banner.jpg” alt=“” width=“920” height=“386” /> </div> if it detect the flash player with <object> But I i dont know what is wrong in the case for Iphone.
Is there any proper simulator for iphone or ipad?
There is one for the iPhone… I’ll have to look for it, Paul O’B has mentioned it in the mobile sticky thread.
*edit these are the links Paul gives…
You said iPad and iPhone (neither of which ever run Flash) but in case Android also becomes an issue: http://developer.android.com/guide/developing/tools/emulator.html
This link: http://articles.sitepoint.com/article/iphone-development-12-tips mentions the iPhone simulator, but apparently you have to sign up for it: http://developer.apple.com/iphone/index.action <–here
And a list of various phone emulators here: http://www.klauskomenda.com/archives/2008/03/17/testing-on-mobile-devices-using-emulators/
Frankly, since neither Apple product has Flash and will never actually run Flash, I wonder what your sswfObject thinks it’s detecting as Flash??
You may need to make a dummy page with the problem that you can post a link to here (since it’s understandable that you wouldn’t want to post your project here).
I’ve used swfobject in this context and it works ok, the div content gets displayed as per normal on an iphone. Are you using the latest version of swfobject?
I am using SWFObject v2.2