Thanks to the-Successor and what-the, I managed to have both the Flash Player and the Experimental Viewer work on another website. I uploaded them at
http://www.sitibs.com/sfp/scratchFP.html
and
http://www.sitibs.com/sfp/scratchEV.html
The code is the following:
Flash Player Only
<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=CubeScroller.sb?version=1"></object>
If you don't want to load a local project (that is a project uploaded to your website) but just want to show on your website a project from the scratch website, use the following instead (http://www.sitibs.com/sfp/scratchFP2.html)
<object width="483" height="387" type="application/x-shockwave-flash" data="http://scratch.mit.edu/static/misc/PlayerOnly.swf"><param name="allowScriptAccess" value="always"><param name="allowFullScreen" value="true"><param name="flashvars" value="project=http://scratch.mit.edu/static/projects/Mr-Negitive/1772157.sb?version=1"></object>
Experimental Viewer
<div class="frame" id="div"> <EMBED src="http://scratch.mit.edu/static/experimental/Scratch.swf?project=Mr-Negitive&projectname=1772157&userid=62626" bgcolor="#FFFFFF" WIDTH="100%" HEIGHT="100%" allowScriptAccess="always" wmode="opaque" TYPE="application/x-shockwave-flash"> </EMBED> </div>
To enlarge to fullscreen you have to SHIFT+click the fullscreen button at the top left corner. To exit fullscreen just press ESC (Thanks bobbybee for discovering this!)
Whereas the Flash Player can be run from your website, apparently the Experimental Viewer cannot be run from your website nor it can run projects uploaded to your website, as the available parameters refer to IDs from the scratch website. I tried to replace them with a project param but... didn't work .
Moreover, I didn't succeed in running the Flash Player from your own PC.
If you do not specify parameters for the Experimental Viewer (that is you just set src="http://scratch.mit.edu/static/experimental/Scratch.swf in the EMBED tag) you get an empty project with the default Scratch cat sprite.
NOTE: In IE, have a look at BoltBait's code.
Last edited by s_federici (2012-10-30 17:15:17)
Offline
YAY!! It finally works!! BTW, is there a way to make the full screen button work in the flash player?
Offline
pinogroove wrote:
YAY!! It finally works!! BTW, is there a way to make the full screen button work in the flash player?
Not yet, as far as I know...
Offline
Cool! I'm going to test a few things in PHP with this...
Offline
Lol it works pretty well actually... I put it on scratchtests.co.cc.
I'm going to try something with PHP...
Last edited by Mcsugarface (2011-07-17 16:44:38)
Offline
It seems it run well with Firefox, Chrome but not in IE8. Can any1 verify this?
Offline
solution2u wrote:
It seems it run well with Firefox, Chrome but not in IE8. Can any1 verify this?
I'm sorry, I already upgraded to IE9. It works for me in IE 9. Can anyone test it on IE8?
Offline
Cool. I actually programmed a simple thing in the EV!
@s_federici: There is no such thing as upgrading to IE.
Last edited by scimonster (2011-07-22 03:34:37)
Offline
I have used codes below and it works fine now
<head>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var flashapp;
function installPlayer(swfName, swfID) {
var flashvars = {
project: 'xxxxxx.sb?version=6'};
//var params = {
// allowScriptAccess: 'sameDomain',
// allowFullScreen: true,
//};
var params = {};
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 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>
</head>
Call this to display it
<div id="PlayerOnly"> <p>No Flash Player</p>
</div>
<script type="text/javascript">
<!--
installPlayer('PlayerOnly.swf', 'PlayerOnly');
//-->
</script>
Offline
Alot of complex stuff here. Try my simple method:
<a href="http://scratch.mit.edu/experimental/viewproject/Rick3137/1903259 ">Scratchascope </a>
Offline
Rick3137 wrote:
Alot of complex stuff here. Try my simple method:
<a href="http://scratch.mit.edu/experimental/viewproject/Rick3137/1903259 ">Scratchascope </a>
Nice. This is certainly simpler if you don't need to embed the experimental viewer in another webpage, but it is fine for you just opening it in a "viewer only" webpage.
Offline
solution2u wrote:
I have used codes below and it works fine now
How did you define the "project" param? Does you code work locally or on a real website? Or in both places?
Offline
s_federici wrote:
solution2u wrote:
I have used codes below and it works fine now
How did you define the "project" param? Does you code work locally or on a real website? Or in both places?
var flashvars = {
project: 'xxxxxx.sb?version=6'};
When you download the project file, you will get the file name xxxxxx.sb
Here is live example:
http://nyan-cat.com/games/scratch-nyan-cat-the-game.html
It works on real website. I hosted the .sb file
I manage to host Applet version as well but I prefer Flash version since I can play the game smoothly.
Offline
Rick3137 wrote:
Alot of complex stuff here. Try my simple method:
<a href="http://scratch.mit.edu/experimental/viewproject/Rick3137/1903259 ">Scratchascope </a>
The url seems not exist.. hmm
Offline
solution2u wrote:
Rick3137 wrote:
Alot of complex stuff here. Try my simple method:
<a href="http://scratch.mit.edu/experimental/viewproject/Rick3137/1903259 ">Scratchascope </a>The url seems not exist.. hmm
Perhaps you haven't opted in for the Experimnetal Viewer?
Offline
scimonster wrote:
solution2u wrote:
Rick3137 wrote:
Alot of complex stuff here. Try my simple method:
<a href="http://scratch.mit.edu/experimental/viewproject/Rick3137/1903259 ">Scratchascope </a>The url seems not exist.. hmm
Perhaps you haven't opted in for the Experimnetal Viewer?
Yes, you re right. Sorry, I am new here
Offline
I'll need this someday! I just know it! Please don't delete this topic! (Not that there is any reason to!)
Offline
solution2u wrote:
scimonster wrote:
solution2u wrote:
The url seems not exist.. hmmPerhaps you haven't opted in for the Experimnetal Viewer?
Yes, you re right. Sorry, I am new here
I'm always happy to help
Offline
scimonster wrote:
Cool. I actually programmed a simple thing in the EV!
@s_federici: There is no such thing as upgrading to IE.
he upgraded from IE 8 to IE 9
Offline
IMBEEGUY wrote:
scimonster wrote:
Cool. I actually programmed a simple thing in the EV!
@s_federici: There is no such thing as upgrading to IE.he upgraded from IE 8 to IE 9
IE is terrible though, so you can only downgrade if you're using it.
Offline
Okay, how do you use the code to make your scratch game run in flash? Please make it very clear where I put what, because this is really confusing me.
Offline