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
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?
Offline
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
Offline
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
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
Offline
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)
Offline
what-the wrote:
It's possible to embed the Experimental Viewer.
Nice! Now I would like to know how to embed the player too
Offline
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
Offline
<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.
Offline
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:
http%3A%2F%2Fscratch.mit.edu%2Fstatic%2Fprojects%2FLS97%2F1317101.sb%3Fversion%3D1
But I tested that and it didn't work either...
Offline
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%3D1But I tested that and it didn't work either...
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.
Offline
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:
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.
Offline
s_federici wrote:
Does someone know if it is possible to embed the flash player in a web page?
Offline
comp500 wrote:
s_federici wrote:
Does someone know if it is possible to embed the flash player in a web page?
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:
<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:
<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)
Offline
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
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
What about an embed tag?
Offline
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
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
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%3D1But I tested that and it didn't work either...
Nope, HTML5 does not have the OBJECT attribute.
Offline
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%3D1But I tested that and it didn't work either...
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
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%3D1But I tested that and it didn't work either...
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
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
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
I request that this be made an itopic.
Offline
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>
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.
Last edited by s_federici (2011-05-14 14:37:12)
Offline
This should be an itopic.
Offline