This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.
  • Index
  •  » Advanced Topics
  •  » How to embed Flash Player and Experimental Viewer in another website

#1 2011-05-12 12:25:24

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

How to embed Flash Player and Experimental Viewer in another website

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

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=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)

Code:

<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

Code:

<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  smile .

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

 

#2 2011-07-14 17:16:54

pinogroove
Scratcher
Registered: 2010-09-24
Posts: 16

Re: How to embed Flash Player and Experimental Viewer in another website

YAY!! It finally works!! BTW, is there a way to make the full screen button work in the flash player?

Offline

 

#3 2011-07-17 09:14:12

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: How to embed Flash Player and Experimental Viewer in another website

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

 

#4 2011-07-17 10:03:56

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: How to embed Flash Player and Experimental Viewer in another website

Nice job!  big_smile


Hai.

Offline

 

#5 2011-07-17 16:34:05

Mcsugarface
Scratcher
Registered: 2009-11-16
Posts: 100+

Re: How to embed Flash Player and Experimental Viewer in another website

Cool!  tongue  I'm going to test a few things in PHP with this...


Hi! I'm http://blocks.scratchr.org/API.php?user=USERNAMEHERE&amp;action=onlineStatus&amp;type=text!
http://internetometer.com/imagesmall/11070.png

Offline

 

#6 2011-07-17 16:44:02

Mcsugarface
Scratcher
Registered: 2009-11-16
Posts: 100+

Re: How to embed Flash Player and Experimental Viewer in another website

Lol it works pretty well actually... I put it on scratchtests.co.cctongue

I'm going to try something with PHP...

Last edited by Mcsugarface (2011-07-17 16:44:38)


Hi! I'm http://blocks.scratchr.org/API.php?user=USERNAMEHERE&amp;action=onlineStatus&amp;type=text!
http://internetometer.com/imagesmall/11070.png

Offline

 

#7 2011-07-21 10:00:10

solution2u
New Scratcher
Registered: 2011-07-17
Posts: 9

Re: How to embed Flash Player and Experimental Viewer in another website

It seems it run well with Firefox, Chrome but not in IE8. Can any1 verify this?

Offline

 

#8 2011-07-22 02:58:38

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: How to embed Flash Player and Experimental Viewer in another website

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

 

#9 2011-07-22 03:33:55

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: How to embed Flash Player and Experimental Viewer in another website

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

 

#10 2011-07-22 03:59:06

solution2u
New Scratcher
Registered: 2011-07-17
Posts: 9

Re: How to embed Flash Player and Experimental Viewer in another website

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

 

#11 2011-07-22 20:26:43

canopy
Scratcher
Registered: 2011-03-21
Posts: 21

Re: How to embed Flash Player and Experimental Viewer in another website

Cool! It's almost as if scratch online came early...


http://29.media.tumblr.com/tumblr_ls2vjiQWk91qe2e32o2_500.gif

Offline

 

#12 2011-07-23 11:09:27

Rick3137
Scratcher
Registered: 2010-01-22
Posts: 57

Re: How to embed Flash Player and Experimental Viewer in another website

Alot of complex stuff here. Try my simple method:
  <a href="http://scratch.mit.edu/experimental/viewproject/Rick3137/1903259 ">Scratchascope </a>

Offline

 

#13 2011-07-24 10:48:30

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: How to embed Flash Player and Experimental Viewer in another website

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

 

#14 2011-07-24 10:54:15

s_federici
Scratcher
Registered: 2007-12-18
Posts: 500+

Re: How to embed Flash Player and Experimental Viewer in another website

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

 

#15 2011-07-25 01:13:17

solution2u
New Scratcher
Registered: 2011-07-17
Posts: 9

Re: How to embed Flash Player and Experimental Viewer in another website

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

 

#16 2011-07-25 01:16:59

solution2u
New Scratcher
Registered: 2011-07-17
Posts: 9

Re: How to embed Flash Player and Experimental Viewer in another website

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

 

#17 2011-07-25 01:21:35

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: How to embed Flash Player and Experimental Viewer in another website

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

 

#18 2011-07-25 02:18:48

solution2u
New Scratcher
Registered: 2011-07-17
Posts: 9

Re: How to embed Flash Player and Experimental Viewer in another website

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  smile

Offline

 

#19 2011-07-25 03:03:42

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: How to embed Flash Player and Experimental Viewer in another website

I'll need this someday! I just know it! Please don't delete this topic! (Not that there is any reason to!)


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#20 2011-07-25 03:51:34

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: How to embed Flash Player and Experimental Viewer in another website

Cross Browser! Compitlbe!


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#21 2011-07-25 03:54:30

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: How to embed Flash Player and Experimental Viewer in another website

solution2u wrote:

scimonster wrote:

solution2u wrote:


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  smile

I'm always happy to help  wink


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#22 2011-08-15 14:58:42

IMBEEGUY
Scratcher
Registered: 2008-11-22
Posts: 7

Re: How to embed Flash Player and Experimental Viewer in another website

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

 

#23 2011-08-15 15:07:39

flurr
Scratcher
Registered: 2010-12-26
Posts: 21

Re: How to embed Flash Player and Experimental Viewer in another website

awesome


flurr rockz :p
http://2.bp.blogspot.com/-4skvYONnbxI/TlZnrENJ7II/AAAAAAAA238/9jTbJJN4OmM/s1600/Cool-Abstract-Background.jpg

Offline

 

#24 2011-08-17 03:56:05

sci_test
Scratcher
Registered: 2011-06-22
Posts: 100+

Re: How to embed Flash Player and Experimental Viewer in another website

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.  wink


[signature removed - please be respectful]
Last edited by scimonster (1970-01-01 00:00:00)

Offline

 

#25 2011-10-24 21:01:03

SheppardProductions
Scratcher
Registered: 2011-08-14
Posts: 100+

Re: How to embed Flash Player and Experimental Viewer in another website

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

 
  • Index
  •  » Advanced Topics
  •  » How to embed Flash Player and Experimental Viewer in another website

Board footer