This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-03-05 09:53:18

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

Embedding Flash Player in website

Does someone know if it is possible to embed the flash player in a web page?

The full answer (including the Experimental Viewer) is here.

Last edited by s_federici (2011-05-20 14:26:37)

Offline

 

#2 2011-03-05 09:56:08

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Embedding Flash Player in website

s_federici wrote:

Does someone know if it is possible to embed the flash player in a web page?

Think so... you just need to know what the url is. Maybe check the page source?


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#3 2011-03-05 17:25:18

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

Re: Embedding Flash Player in website

markyparky56 wrote:

Maybe check the page source?

I did, but I came out with some HTML+Javascript that only starts the player, but doesn't load the project  sad

Offline

 

#4 2011-03-06 04:21:33

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Embedding Flash Player in website

s_federici wrote:

markyparky56 wrote:

Maybe check the page source?

I did, but I came out with some HTML+Javascript that only starts the player, but doesn't load the project  sad

The same thing is happening to me. Maybe there's a variable somewhere at the top of the page which we forgot to add in? That's my closest guess  hmm

Offline

 

#5 2011-03-06 08:22:30

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: Embedding Flash Player in website

It's possible to embed the Experimental Viewer.

See;

http://techintelligence.blogspot.com/20 … er-on.html On my site.


Now working on Flash player beta.

Edit: Use this for now.

<iframe src ="http://scratch.mit.edu/projects/" width="600" height="500" scrolling=no> </iframe>

Last edited by what-the (2011-03-06 08:41:20)


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#6 2011-03-06 14:02:31

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

Re: Embedding Flash Player in website

what-the wrote:

It's possible to embed the Experimental Viewer.

Nice! Now I would like to know how to embed the player too  smile

Offline

 

#7 2011-03-07 11:02:23

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Embedding Flash Player in website

what-the wrote:

It's possible to embed the Experimental Viewer.

See;

http://techintelligence.blogspot.com/20 … er-on.html On my site.


Now working on Flash player beta.

Edit: Use this for now.

<iframe src ="http://scratch.mit.edu/projects/" width="600" height="500" scrolling=no> </iframe>

I'd already thought of an iFrame, but it's very unprofessional  big_smile

Offline

 

#8 2011-03-07 12:32:12

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Embedding Flash Player in website

<object width="483" height="387" type="application/x-shockwave-flash" data="http://scratch.mit.edu/static/misc/PlayerOnly.swf"><param name="allowScriptAccess" value="sameDomain"><param name="allowFullScreen" value="true"><param name="flashvars" value="project=http://scratch.mit.edu/static/projects/LS97/1317101.sb?version=1"></object>

I don't know whether it works though. Change "LS97/1317101" to the project you want.


/* No comment */

Offline

 

#9 2011-03-07 13:16:24

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: Embedding Flash Player in website

TheSuccessor wrote:

<object width="483" height="387" type="application/x-shockwave-flash" data="http://scratch.mit.edu/static/misc/PlayerOnly.swf"><param name="allowScriptAccess" value="sameDomain"><param name="allowFullScreen" value="true"><param name="flashvars" value="project=http://scratch.mit.edu/static/projects/LS97/1317101.sb?version=1"></object>

I don't know whether it works though. Change "LS97/1317101" to the project you want.

I think the 'project' flashparam has to be URL-encoded like so:

Code:

http%3A%2F%2Fscratch.mit.edu%2Fstatic%2Fprojects%2FLS97%2F1317101.sb%3Fversion%3D1

But I tested that and it didn't work either...  hmm


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#10 2011-03-07 14:17:59

TheSuccessor
Scratcher
Registered: 2010-04-23
Posts: 1000+

Re: Embedding Flash Player in website

fullmoon wrote:

I think the 'project' flashparam has to be URL-encoded like so:

Code:

http%3A%2F%2Fscratch.mit.edu%2Fstatic%2Fprojects%2FLS97%2F1317101.sb%3Fversion%3D1

But I tested that and it didn't work either...  hmm

It isn't URL encoded on the Scratch site...

Anyway:

The player is here: http://scratch.mit.edu/static/misc/PlayerOnly.swf
Projects are at: http://scratch.mit.edu/static/projects/Jens/75626.sb
(replace Jens/75626 with what you see in the address bar when viewing the project)
To embed the player, use my code. It won't, however, load the project. It seems to send a request to scratch.mit.edu, but it won't finish loading. It's either a hotlinking protection thing the Scratch Team built in, a security thing with Flash Player, a glitch with the new player, or a problem connecting to the server.


/* No comment */

Offline

 

#11 2011-03-07 14:33:55

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: Embedding Flash Player in website

TheSuccessor wrote:

It isn't URL encoded on the Scratch site...

I'm pretty sure SWFObject handles that for you. Here's the function that the site uses to embed the player:

Code:

function installPlayer(swfName, swfID) {
                       var flashvars = {
                           project: '../../static/projects/halfbaked_fullmoon/1641596.sb?version=1'};
                       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);
                   }

If you have the ability to embed scripts, just add SWFObject to your header and use the code here, making sure to plug in the values for project/player absolute URL's that TheSuccessor gave. If you can only embed HTML...let me see what I can find.


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#12 2011-05-02 12:06:37

comp500
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: Embedding Flash Player in website

s_federici wrote:

Does someone know if it is possible to embed the flash player in a web page?

http://scratch.mit.edu/forums/viewtopic.php?pid=577912


800 posts! W00T! Oh sorry im not on a lot but at least i have 1000+ posts

Offline

 

#13 2011-05-02 12:09:59

comp500
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: Embedding Flash Player in website

comp500 wrote:

s_federici wrote:

Does someone know if it is possible to embed the flash player in a web page?

http://scratch.mit.edu/forums/viewtopic.php?pid=577912

I've put it here:
Flash project embed
For example, lets embed this: http://scratch.mit.edu/projects/comp500/1662410
Get the last two bits, comp500/1662410 and put them where (id here) is in this code:

Code:

<object type="application/x-shockwave-flash" data="http://scratch.mit.edu/static/misc/PlayerOnly.swf" width="482" height="387" id="PlayerOnly" style="visibility: visible; position: relative; z-index: 1000; "><param name="allowFullScreen" value="true"><param name="flashvars" value="project=http://scratch.mit.edu/static/projects/(id here).sb?version=1"></object>

so it becomes:

Code:

<object type="application/x-shockwave-flash" data="http://scratch.mit.edu/static/misc/PlayerOnly.swf" width="482" height="387" id="PlayerOnly" style="visibility: visible; position: relative; z-index: 1000; "><param name="allowFullScreen" value="true"><param name="flashvars" value="project=http://scratch.mit.edu/static/projects/comp500/1662410.sb?version=1"></object>

Now put it on ur website!!!!

That should work!

Last edited by comp500 (2011-05-02 12:10:59)


800 posts! W00T! Oh sorry im not on a lot but at least i have 1000+ posts

Offline

 

#14 2011-05-02 12:34:22

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Embedding Flash Player in website

I tested TheSuccessor's code way up on this thread on Mod Share V2 site and it works like a beauty.

I would love to release it to you so you can see it, but I'm not finished with the site and I don't want anyone uploading until I'm done. However, I can guarantee that his code works, but has to be
a) A relative path (no starting / for some reason)
b) On your site, both the player and the project (since the parameter 'scriptAccess' is set to 'sameDomain')

Good luck!

Last edited by LS97 (2011-05-02 12:41:45)

Offline

 

#15 2011-05-03 02:56:48

comp500
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: Embedding Flash Player in website

LS97 wrote:

what-the wrote:

It's possible to embed the Experimental Viewer.

See;

http://techintelligence.blogspot.com/20 … er-on.html On my site.


Now working on Flash player beta.

Edit: Use this for now.

<iframe src ="http://scratch.mit.edu/projects/" width="600" height="500" scrolling=no> </iframe>

I'd already thought of an iFrame, but it's very unprofessional  big_smile

What about an embed tag?


800 posts! W00T! Oh sorry im not on a lot but at least i have 1000+ posts

Offline

 

#16 2011-05-03 03:25:40

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Embedding Flash Player in website

comp500 wrote:

LS97 wrote:

what-the wrote:

It's possible to embed the Experimental Viewer.

See;

http://techintelligence.blogspot.com/20 … er-on.html On my site.


Now working on Flash player beta.

Edit: Use this for now.

<iframe src ="http://scratch.mit.edu/projects/" width="600" height="500" scrolling=no> </iframe>

I'd already thought of an iFrame, but it's very unprofessional  big_smile

What about an embed tag?

Since the flash object itself works well enough, I think we should stick to that.
The problem now is how to allow fullscreen...

Offline

 

#17 2011-05-04 16:26:04

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: Embedding Flash Player in website

fullmoon wrote:

TheSuccessor wrote:

<object width="483" height="387" type="application/x-shockwave-flash" data="http://scratch.mit.edu/static/misc/PlayerOnly.swf"><param name="allowScriptAccess" value="sameDomain"><param name="allowFullScreen" value="true"><param name="flashvars" value="project=http://scratch.mit.edu/static/projects/LS97/1317101.sb?version=1"></object>

I don't know whether it works though. Change "LS97/1317101" to the project you want.

I think the 'project' flashparam has to be URL-encoded like so:

Code:

http%3A%2F%2Fscratch.mit.edu%2Fstatic%2Fprojects%2FLS97%2F1317101.sb%3Fversion%3D1

But I tested that and it didn't work either...  hmm

Nope, HTML5 does not have the OBJECT attribute.

Offline

 

#18 2011-05-05 11:36:20

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Embedding Flash Player in website

rdococ wrote:

fullmoon wrote:

TheSuccessor wrote:

<object width="483" height="387" type="application/x-shockwave-flash" data="http://scratch.mit.edu/static/misc/PlayerOnly.swf"><param name="allowScriptAccess" value="sameDomain"><param name="allowFullScreen" value="true"><param name="flashvars" value="project=http://scratch.mit.edu/static/projects/LS97/1317101.sb?version=1"></object>

I don't know whether it works though. Change "LS97/1317101" to the project you want.

I think the 'project' flashparam has to be URL-encoded like so:

Code:

http%3A%2F%2Fscratch.mit.edu%2Fstatic%2Fprojects%2FLS97%2F1317101.sb%3Fversion%3D1

But I tested that and it didn't work either...  hmm

Nope, HTML5 does not have the OBJECT attribute.

If html5 doesn't have the applet or object tag, then how exactly are we supposed to show java and flash programs?

Offline

 

#19 2011-05-07 16:21:03

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: Embedding Flash Player in website

LS97 wrote:

rdococ wrote:

fullmoon wrote:


I think the 'project' flashparam has to be URL-encoded like so:

Code:

http%3A%2F%2Fscratch.mit.edu%2Fstatic%2Fprojects%2FLS97%2F1317101.sb%3Fversion%3D1

But I tested that and it didn't work either...  hmm

Nope, HTML5 does not have the OBJECT attribute.

If html5 doesn't have the applet or object tag, then how exactly are we supposed to show java and flash programs?

Oops, it does have the object tag, but not the applet tag.

Offline

 

#20 2011-05-09 09:41:35

WIzzarde
Scratcher
Registered: 2009-12-11
Posts: 7

Re: Embedding Flash Player in website

rdococ wrote:

LS97 wrote:

rdococ wrote:

Nope, HTML5 does not have the OBJECT attribute.

If html5 doesn't have the applet or object tag, then how exactly are we supposed to show java and flash programs?

Oops, it does have the object tag, but not the applet tag.

Won't the webbrowser still run on the old codes to? I mean why delete something good?

Last edited by WIzzarde (2011-05-09 09:42:06)

Offline

 

#21 2011-05-09 11:12:28

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Embedding Flash Player in website

WIzzarde wrote:

rdococ wrote:

LS97 wrote:


If html5 doesn't have the applet or object tag, then how exactly are we supposed to show java and flash programs?

Oops, it does have the object tag, but not the applet tag.

Won't the webbrowser still run on the old codes to? I mean why delete something good?

Currently, the applet tag is only fully supported by Safari, IE and Firefox (yes, i know they're the major browsers). Other browsers only partially support it, and some stopped supporting it completely already.

Offline

 

#22 2011-05-09 11:28:51

scratcher7_13
Scratcher
Registered: 2011-02-09
Posts: 1000+

Re: Embedding Flash Player in website

I request that this be made an itopic.


♫ 90% of teens can't do math. If you are one of the 40% of teens who can, copy and paste this into your signature. ♫♪
http://dl.dropbox.com/u/6273449/BlockLibraryTitle.pnghttp://i.imgur.com/mr9Hf.gif

Offline

 

#23 2011-05-12 11:49:14

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

Re: Embedding Flash Player in 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>

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.

Last edited by s_federici (2011-05-14 14:37:12)

Offline

 

#24 2011-05-12 12:12:13

cskidmsonic
Scratcher
Registered: 2011-01-22
Posts: 100+

Re: Embedding Flash Player in website

This should be an itopic.


This signature is TDD's fault... yes, I had to.

Offline

 

#25 2011-05-14 09:35:19

nickliboo
Scratcher
Registered: 2011-01-22
Posts: 20

Re: Embedding Flash Player in website

i like experimental viewer but quite slow

Offline

 

Board footer