567 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+4 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

3752 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Located in Spain
  • Has sold $125,000+ on Envato Market
  • Helped several times protecting Envato Market against copyright violations
+9 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 50+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
outandouter says

Useful tip. Thanks!

659 posts Fuel Your Web
  • Elite Author: Sold more than $75,000 on Envato Market
  • Won a competition
  • Had an item featured on Envato Market
  • Has been part of the Envato Community for over 7 years
+5 more
Pirenko says

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

8378 posts Community Moderator
  • Has referred 10+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Attended one of our Meetups around the world
+9 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
  • Contributed a free file of the month
+9 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:

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by