2013-10-28 16:00:20 -04:00
< ?
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
<!DOCTYPE html>
< html >
2013-11-01 22:44:51 -04:00
< head >
< title > Scratch HTML5 vs. Flash< / title >
< meta charset = "utf-8" >
< style type = "text/css" >
body {
background: #222;
color: #fff;
margin: 0;
}
< / style >
< link href = "player.css" type = "text/css" rel = "stylesheet" / >
< script src = "//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" > < / script >
< script src = "//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" > < / script >
< script src = "js/util/Timer.js" > < / script >
< script src = "js/util/OffsetBuffer.js" > < / script >
< script src = "js/util/Color.js" > < / script >
< script src = "js/util/Rectangle.js" > < / script >
< script src = "js/Sprite.js" > < / script >
< script src = "js/Reporter.js" > < / script >
< script src = "js/Stage.js" > < / script >
< script src = "js/sound/WAVFile.js" > < / script >
< script src = "js/sound/SoundDecoder.js" > < / script >
< script src = "js/sound/SoundBank.js" > < / script >
< script src = "js/sound/NotePlayer.js" > < / script >
< script src = "soundbank/Instr.js" > < / script >
< script src = "js/IO.js" > < / script >
< script src = "js/primitives/VarListPrims.js" > < / script >
< script src = "js/primitives/MotionAndPenPrims.js" > < / script >
< script src = "js/primitives/LooksPrims.js" > < / script >
< script src = "js/primitives/SensingPrims.js" > < / script >
< script src = "js/primitives/SoundPrims.js" > < / script >
< script src = "js/primitives/Primitives.js" > < / script >
< script src = "js/Interpreter.js" > < / script >
< script src = "js/Runtime.js" > < / script >
< script src = "js/Scratch.js" > < / script >
< script type = "text/javascript" >
if (window.location.hash) {
var project_id = parseInt(window.location.hash.substr(1));
} else {
var project_id = 10000160; // Default project for display
}
< / script >
< script >
$(function() {
// The flashvars tell flash about the project data (and autostart=true)
var flashvars = {
server: encodeURIComponent('scratch.mit.edu'),
project_id: project_id
};
2013-10-28 16:00:20 -04:00
2013-11-01 22:44:51 -04:00
// Pass in the cloud token for the project
if (window.getCloudToken) {
flashvars.cloud_token = encodeURIComponent(getCloudToken());
}
2013-10-28 16:00:20 -04:00
2013-11-01 22:44:51 -04:00
var params = {
allowscriptaccess: 'always',
allowfullscreen: 'false',
wmode: 'direct',
menu: 'false'
};
2013-10-28 16:00:20 -04:00
2013-11-01 22:44:51 -04:00
var flashPlayer = null;
//var swf_url = "http://cdn.scratch.mit.edu/scratchr2/static/Scratch.swf";
var swf_url = "http://jiggler.media.mit.edu/shanemc/scratchr2/static/Scratch.swf";
swfobject.embedSWF(swf_url, "flashScratch", "480", "400", "10.2.0",
"http://cdn.scratch.mit.edu/scratchr2/static/expressInstall.swf",
flashvars, params, null, function(e) {
$('#flashScratch').css('visibility', 'visible');
if (e.success) flashPlayer = e.ref;
});
2013-10-28 16:00:20 -04:00
2013-11-01 22:44:51 -04:00
$('#trigger_green_flag, #greenSlide').click(function() {
flashPlayer.ASstartRunning();
});
2013-10-28 16:00:20 -04:00
2013-11-01 22:44:51 -04:00
// Stop button behavior
$('#trigger_stop').click(function() {
flashPlayer.ASstopRunning();
});
});
< / script >
< / head >
< body >
< div style = "display: inline-block;" >
< div id = "up" > < / div >
< div id = "left" > < / div >
< div id = "overContainer" >
< div id = "greenSlide" > < div id = "greenSlideFg" > < img src = "img/greenflag.png" > < / div > < / div >
< div id = "container" > < / div >
< / div >
< div id = "right" > < / div >
< div id = "down" > < / div >
2013-10-28 16:00:20 -04:00
< / div >
2013-11-01 22:44:51 -04:00
< div style = "display: inline-block;" >
< div id = "flashScratch" style = "text-align:center;visibility:hidden;" >
< p style = "color:#aaa;font-size:22px;margin-top:14px;line-height:28px;" > Oh Noes! Scratch project cannot display.< br / > Flash player is disabled, missing, or less than version 10.2.< / p >
< a href = "http://www.adobe.com/go/getflashplayer" >
< img src = "http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt = "Get Adobe Flash player" target = "_blank" / >
< / a >
< / div >
2013-10-28 16:00:20 -04:00
< / div >
2013-11-01 22:44:51 -04:00
< div id = "info" > Loading...< / div >
2013-10-28 16:00:20 -04:00
2013-11-01 22:44:51 -04:00
< button id = "trigger_green_flag" > Green flag< / button >
< button id = "trigger_stop" > Stop< / button >
2013-10-28 16:00:20 -04:00
2013-11-01 22:44:51 -04:00
< input type = "text" name = "project_id" id = "project_id" / > < button id = 'go_project' > Go!< / button >
< / body >
2013-10-28 16:00:20 -04:00
< / html >