At the moment I'm using a whole bunch of freeware and GPL programs etc, just trying to make it a more streamlined to be easier for other's to use, I've also not incorporated it into the megazine.mz3 xml file - it would be good to simply have an <iphone> or <mobile> tag within pages so it can be part of the same structure.
Create JPG filesIf you're not using jpg files for pages already, you can create jpg files from your source swf or pdf.
PDF2JPG:
PDF-XChange viewer -
http://www.docu-track.com/home/prod_user/PDF-XChange_Tools/pdfx_viewerThis is a great PDF tool that lets you set links and export to jpg. Pro version isn't required for basic features.
SWF2JPG:
SWF to JPG PHP class -
http://www.phpclasses.org/browse/package/4312.htmlFreeware Cyber-D swf2jpg -
http://cyber-d.blogspot.com/2008/10/cyber-ds-swf2jpg.htmlE.M. Magic Swf2Avi v6.6.9.803 -
http://www.effectmatrix.com/swf2avi/index.htm (trial)
Note: You want to make sure the files output to the iPhone screen size (ie 480x320 @ 163 ppi) so the width should be at least
460px wide.
This allows you to switch between landscape and portrait view on the iPhone/iPod touch without needing to scroll AND allow for navigation for next/previous buttons next to the page if you want. The iPhone automatically anti-aliases the image for you so it won't look too crunchy like it does in browsers.
JavaScriptObviously iPhone doesn't support flash so we need to use JavaScript. There are some great modules available with jQuery such as jparse (to parse the xml from the megazine.mz3 xml file) and some jquery page curl effects.
There's also a great free iPhone website template (iSite) released by Joe Hewitt (
http://joehewitt.com/), the source can be found here:
http://www.modmyi.com/files/isite.zipThis has some nice clean iPhone app-style design and sliding etc. I've used this as the basis for my iPhone magazine site.
There's also a good jquery loading script that can be implemented to load only a few pages into the cache instead of hundreds of pages etc.
Automatically detecting iPhoneBecause iPhone doesn't view flash, you may as well automatically redirect them to your iPhone site straight away by adding this code (change the address to your iPhone version):
<script type="text/javascript">if(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)){ location.href='http://iphone.example.com/';}</script>On the iPhone index page you can redirect regular browsers to the MegaZine flash version by adding this code (changing example.com with your site):
<script type="application/x-javascript">if(!(navigator.userAgent.match(/iPhone/i)) || !(navigator.userAgent.match(/iPod/i))){location.href='http://www.example.com/';}</script>Future updatesIf I get the time I hope to incorporate all of this much better into the MegaZine core structure with less steps and messing around but this is what I've done for a rough and ready magazine for iPhone. With additional information in the megazine xml file, eventually we can parse the xml objects to have layers, links, texts, search, zoom etc but for now this will have to suffice. Because it's not part of the main MegaZine engine or flash core, it's almost a fork but in my opinion keeping up with technology still an important feature to include.
My main focus will be dynamically generating content server-side through an administration panel used to build regular MegaZines so this whole process is invisible to the user.
Let me know if you've developed around this concept before or have work arounds of your own you can contribute.
SourceI work best with a demonstration, so here it is - nothing fancy but at least a start:
http://pacraig.com/megazine/iphone