Select Page

Here’s a very handy javascript function to grab FlashVars from the URL. ‘GUP’ Get URL Parameters can sit in your html or in an external js file.

function gup(name){
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    var regexS = "[\\?&]"+name+"=([^&#]*)";
    var regex = new RegExp( regexS );
    var results = regex.exec( window.location.href );
    if( results == null ) return "";
    else return results[1];

And then when you create your SWF object, pass in the value name you are looking for (in this case ‘page’)

var so = new SWFObject("loader.swf?page="+gup('page'), ...