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

#1 2013-03-04 15:16:16

chafe
New Scratcher
Registered: 2013-02-24
Posts: 3

Flash

Can I upload projects to our website as Flash files?

Offline

 

#2 2013-03-04 15:54:57

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Flash

Just to make sure, when you say "our websites", are you talking about the Scratch website or one that you have?

With regards,

ErnieParke


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2013-03-05 10:09:13

chafe
New Scratcher
Registered: 2013-02-24
Posts: 3

Re: Flash

Hi Ernie,
I'm a teacher, and I would like to upload to the school's website.

Offline

 

#4 2013-03-05 10:36:33

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Flash

There is no way to make them a SWF file, but it is possible to embed the Flash player in HTML:

Code:

<object type="application/x-shockwave-flash" data="http://scratch.mit.edu/static/misc/Scratch.swf" width="482" height="401" id="flashplayer" style="visibility: visible; position: relative; margin-left: 4px; z-index: 1000; ">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="allowFullScreen" value="true" />
        <param name="flashvars" value="project=http://scratch.mit.edu/static/projects/[project creator username]/[project id].sb" />
      </object>
<script type="text/javascript">
//<![CDATA[
var flashapp = document.getElementById('flashplayer');

function JSsetPresentationMode(fillScreen) {
    if (fillScreen) {
        var r = flashapp.getBoundingClientRect();
        flashapp.style.left = -r.left + 'px';
        flashapp.style.top = -r.top + 'px';
        flashapp.style.position = 'relative';
        var h = window.innerHeight;
        if (typeof(w) != 'number') { // If IE:
            w = document.documentElement.clientWidth;
            h = document.documentElement.clientHeight;
        }
        setPlayerSize(w, h - 10);
    } else {
        flashapp.style.position = "inherit";
        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;
    }
}

For the part where it says

Code:

value="project=http://scratch.mit.edu/static/projects/[project creator username]/[project id].sb

, if the URL is "http://scratch.mit.edu/projects/jvvg/3028968", then you would use

Code:

value="project=http://scratch.mit.edu/static/projects/jvvg/3028968.sb

http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#5 2013-03-06 03:20:12

chafe
New Scratcher
Registered: 2013-02-24
Posts: 3

Re: Flash

Fantastic! Thanks for the help jvvg!

Offline

 

Board footer