567 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+5 more
iamdok
says

These days it’s good practice to create a html version of the Flash website that you develop for a client. At the very least this page should include the main menu links, the about text and some contact information. Doing so will imporve the SEO of the Flash site, while also providing some main content for those visitors who happed to be using an iPhone, iPad, or who’s Flash player version is too low for your content.

Anyway, when creating these pages and presenting them to the client it can be awkward to view the alternative content as the site will automatically lauch into the Flash content. The traditional way to get around this are to disable javascript or present the html page seperately, or just visit with your iDevice :D , but this is still awkward!

Perhaps you all know this already, but if not, I found this nice trick involving SWFObject where you set the SWFObject to check for a certain query string and embed the swf file only if said query string is not found in the page url. Then when you want to see the alternative content you just add this small query string on to the url and wham, you see the page from the iDevice point of view! Therefore you can quickly test the alternative content is working and you can easily send the site link including the query string to your client, so they can also see the page.

Anyway here is the code, which goes in the index.html file:


//import swfobject as normal

<script src="js/swfobject.js" type="text/javascript"></script>
<script type="text/javascript">

var vars = { "site flashvars here" };
var params = { "swfobject parameters here" };
var attributes = { "swfobject attributes here" }; 

//if else statement to check for query string

if (swfobject.getQueryParamValue("viewAlt") == "true") 
{ 
    //paste "?viewAlt=true" to the end of the browser url
    //and this will evaluate to true and skip embedding the swf
}
else
{
    //normal swfobject embed script here
    swfobject.embedSWF(....);
}

</script>

//end swf object code

So as you can read above, simply adding ?viewAlt=true to your Flash site url, will show you the alternative content. Nice one :)

See the original blog post by Partick McDonald.

Donagh

3757 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Located in Spain
  • Has sold $125,000+ on Envato Market
  • Made it to the Authors' Hall of Fame
+11 more
pezflash
says

Nice tip. Thanks for the link! Bookmarked.

767 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+4 more
outandouter
says

Useful tip. Thanks!

693 posts Fuel Your Web
  • Had an item that became a weekly top seller
  • Elite Author: Sold more than $75,000 on Envato Market
  • Won a competition
  • Had an item featured on Envato Market
+5 more
Pirenko
says

Great stuff. I’ve searched for this some time ago. Thanks! :nerdy:

8576 posts Community Moderator
  • Located in United Kingdom
  • Has been part of the Envato Community for over 7 years
  • Helps us moderate the forums
  • Won a competition
+10 more
MSFX
Moderator
says

nice one, i’ve always edited the flash player version to be 100 lol :P

1612 posts
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Achieved the monthly Community Superstar Award
+10 more
DaniMun
says
nice one, i’ve always edited the flash player version to be 100 lol :P

lol, same here :D

Thanks for the tip Donagh! :bigwink:

by
by
by
by
by
by