567 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Ireland
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
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

3747 posts
  • Won a Competition
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Exclusive Author
  • Spain
  • Referred between 200 and 499 users
+5 more
pezflash says

Nice tip. Thanks for the link! Bookmarked.

767 posts
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Sold between 1 000 and 5 000 dollars
outandouter says

Useful tip. Thanks!

557 posts Fuel Your Web
  • Elite Author
  • Won a Competition
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Has been a member for 7-8 years
  • Bought between 50 and 99 items
  • Referred between 200 and 499 users
  • Europe
Pirenko says

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

8192 posts Community Moderator
  • Attended a Community Meetup
  • Community Moderator
  • Has been a member for 6-7 years
  • United Kingdom
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Contributed a Blog Post
  • Beta Tester
  • Bought between 50 and 99 items
+4 more
MSFX Volunteer moderator says

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

1612 posts
  • Author had a Free File of the Month
  • Envato Studio (Microlancer) Beta Tester
  • Beta Tester
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 1 and 9 users
+5 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