I'm sure most of you know that the Flash player loads the latest version of the project. And some people (such as myself) have surely tried to get it to load a different version of the player. Well, i finally got it to work!
Step 1:
View the source of the current page.
Step 2:
Copy the following:
function installPlayer(swfName, swfID) { var flashvars = { project: '/static/projects/[username]/[id].sb?version=[latest version]'}; var params = { allowScriptAccess: 'sameDomain', allowFullScreen: true }; var attributes = {}; swfobject.embedSWF(swfName, swfID, 482, 401, '10.0', false, flashvars, params, attributes); flashapp = document.getElementById(swfID); flashapp.style.position = 'relative'; flashapp.style.marginLeft = '19px'; flashapp.parentNode.parentNode.style.overflow = 'visible'; // override CSS flashapp.style.zIndex = 1000; // put in front setPlayerSize(482, 401); }
Step 3:
Paste into a text editor of some sort, such as boring Notepad, or maybe something good like Notepad++ (or gedit).
Step 4:
Change ?version=[latest] to ?version=[other].
Step 5:
Add to the bottom of this:
initProjectbox();installPlayer('/static/misc/Scratch.swf', 'PlayerOnly');
Step 6:
Copy all this code, and enter it into your JavaScript console. (Firefox: ctrl+shift+k, Chrome: inspect an element>console)
Step 7:
Watch the other version load!
Offline
Safari: cmd-alt-c for console.
Offline
And chrome, ctrl shift J
Awesome!
Offline
dvd4 wrote:
Hardmath123 wrote:
Safari: cmd-alt-c for console.
Or cmd-option-c.
Lol alt and option are the same thing.
Offline
But the key is the same.
P.S. Sci, you should use prompts to make it a more convenient bookmarklet.
Offline
Hardmath123 wrote:
But the key is the same.
P.S. Sci, you should use prompts to make it a more convenient bookmarklet.
Sure thing. Just give me a few minutes...
Offline
Gah, it won't load from a bookmarklet! Well, here's something with no editing, just a single prompt asking for the version.
function installPlayer(swfName, swfID) { var temps = {u: '', i: '', v: ''}; temps.u = window.location.pathname.substring(10); temps.i = temps.u.substring(temps.u.indexOf('/')+1); temps.u = temps.u.substring(0,temps.u.indexOf('/')); temps.v = document.body.innerHTML.match(/.sb\?version=\d+/).toString().match(/\d+/); temps.v = prompt('What version? Current is '+temps.v,temps.v-1); var flashvars = { project: '/static/projects/'+temps.u+'/'+temps.i+'.sb?version='+temps.v}; var params = { allowScriptAccess: 'sameDomain', allowFullScreen: true }; var attributes = {}; swfobject.embedSWF(swfName, swfID, 482, 401, '10.0', false, flashvars, params, attributes); flashapp = document.getElementById(swfID); flashapp.style.position = 'relative'; flashapp.style.marginLeft = '19px'; flashapp.parentNode.parentNode.style.overflow = 'visible'; // override CSS flashapp.style.zIndex = 1000; // put in front setPlayerSize(482, 401); } initProjectbox();installPlayer('/static/misc/Scratch.swf', 'PlayerOnly');
Offline
I remember I tried to do this one time--but I failed miserably! Thanks for getting it to work!
Offline
nXIII wrote:
scimonster wrote:
temps.v = document.body.innerHTML.match(/.sb\?version=\d+/).toString().match(/\d+/);
Escape your "."
I don't think it mattered too much, since it would only match a literal period.
function installPlayer(swfName, swfID) { var temps = {u: '', i: '', v: ''}; temps.u = window.location.pathname.substring(10); temps.i = temps.u.substring(temps.u.indexOf('/')+1); temps.u = temps.u.substring(0,temps.u.indexOf('/')); temps.v = document.body.innerHTML.match(/\.sb\?version=\d+/).toString().match(/\d+/); temps.v = prompt('What version? Current is '+temps.v,temps.v-1); var flashvars = { project: '/static/projects/'+temps.u+'/'+temps.i+'.sb?version='+temps.v}; var params = { allowScriptAccess: 'sameDomain', allowFullScreen: true }; var attributes = {}; swfobject.embedSWF(swfName, swfID, 482, 401, '10.0', false, flashvars, params, attributes); flashapp = document.getElementById(swfID); flashapp.style.position = 'relative'; flashapp.style.marginLeft = '19px'; flashapp.parentNode.parentNode.style.overflow = 'visible'; // override CSS flashapp.style.zIndex = 1000; // put in front setPlayerSize(482, 401); } initProjectbox();installPlayer('/static/misc/Scratch.swf', 'PlayerOnly');
It still doesn't work as a bookmarklet though. D:
Offline
scimonster wrote:
I don't think it mattered too much, since it would only match a literal period.
…No, it would match any character; that's what a dot does. For example, if I called my project ssb?version=0, it would match that instead.
Last edited by nXIII (2012-10-30 11:10:02)
Offline
nXIII wrote:
scimonster wrote:
I don't think it mattered too much, since it would only match a literal period.
…No, it would match any character; that's what a dot does. For example, if I called my project ssb?version=0, it would match that instead.
Oh, i know that. I meant in my case, it would match the literal dot because that's what's there.
Offline