I was just wondering about this because the flash player sometimes runs projects faster than the actual Scratch program. I would be nice to download the flash player and import projects into it and use it offline. Is there a way to do this?
Offline
The player is here, choose file then save page as to download it. I'm not sure how to play projects with it offline though.
Offline
Sure view the download it here http://get.adobe.com/flashplayer/completion/?installer=Flash_Player_10.3_for_Windows_-_Other_Browsers
Offline
JudeSecaro wrote:
Sure view the download it here http://get.adobe.com/flashplayer/completion/?installer=Flash_Player_10.3_for_Windows_-_Other_Browsers
We mean the Scratch Flash Player....
Offline
You can also see how the same is used in http://y88.in to display youtube flash content
Offline
You have to run it in a HTML file. I was looking at the source code for a project page (Thank you, Firefox!) And it uses a javascript to modify the variables for the flash player.
Here is the (important) code for one of my projects:
Scratch Team wrote:
</script> <div id="projectwrapper">
<!--Play with Flash Player -->
<script type="text/javascript" src="/js/swfobject.js"></script>
<script type="text/javascript">
var flashapp;
function installPlayer(swfName, swfID) {
var flashvars = {
project: '../../static/projects/ethanco/1846758.sb?version=7'};
var params = {
allowScriptAccess: 'sameDomain',
allowFullScreen: true,
};
var attributes = {};
swfobject.embedSWF(swfName, swfID, 482, 387, '10.0', false, flashvars, params, attributes);
flashapp = document.getElementById(swfID);
flashapp.style.position = 'relative';
flashapp.parentNode.parentNode.style.overflow = 'visible'; // override CSS
flashapp.style.zIndex = 1000; // put in front
setPlayerSize(482, 387);
}
function JSFillScreen(fillScreen) {
if (fillScreen) {
var r = flashapp.getBoundingClientRect();
flashapp.style.left = -r.left + 'px';
flashapp.style.top = -r.top + 'px';
var h = window.innerHeight;
if (typeof(w) != 'number') { // If IE:
w = document.documentElement.clientWidth;
h = document.documentElement.clientHeight;
}
setPlayerSize(w, h - 10);
} else {
setPlayerSize(482, 387);
flashapp.style.left = flashapp.style.top = '0px';
}
}
function setPlayerSize(w, h) {
var isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") > 0;
if (isFirefox) w += 1;
if (navigator.appName == 'Microsoft Internet Explorer') {
flashapp.style.width = w;
flashapp.style.height = h;
} else {
flashapp.width = w;
flashapp.height = h;
}
}
</script>
<object style="visibility: visible; position: relative; z-index: 1000;" id="PlayerOnly" data="/static/misc/PlayerOnly.swf" type="application/x-shockwave-flash" height="387" width="483"><param value="sameDomain" name="allowScriptAccess"><param value="true" name="allowFullScreen"><param value="project=../../static/projects/ethanco/1846758.sb?version=7" name="flashvars"></object>
Offline
The above solution, which as said, is the way that it is done on the official scratch website. It requires additional code to be included, which is not the most obvious thing to do for someone who is still at this level. This is a piece of code (don't remember where I got it, but it's not mine) that will do the same thing much easier and will work without additional code.
<object width="483" height="387" type="application/x-shockwave-flash" data="PlayerOnly.swf"><param name="allowScriptAccess" value="sameDomain"><param name="allowFullScreen" value="true"><param name="flashvars" value="project=RayTracer.sb?version=1"></object>
Hope that could help someone,
-bobbybee
Offline
The only problem with using the Flash viewer is that you can't save!
You can use the player to test projects offline, but in no way use the experimental viewer to edit them and then try to save (which you can't, and will end up losing an hour of work).
Offline
Uh... the above code doesn't work for me.
Last edited by mathematics (2011-06-24 06:45:51)
Offline
mathematics wrote:
Uh... the above code doesn't work for me.
Note that it has to be on a server and the flash file has to be on the same domain.
Offline
Have a look at http://scratch.mit.edu/forums/viewtopic … 37#p759937
Offline