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

#1 2008-06-08 23:13:31

dbal
Scratcher
Registered: 2007-07-19
Posts: 100+

Preventing Scratch applet from running on load?

Does anyone know how to include two or more links to online projects in an html page and prevent them from running until the user clicks the green flag?

I know how to create the links.  What I don't know how to do is to keep the applets from starting as soon as the page is loaded instead of waiting until the user clicks the green flag.

Last edited by dbal (2008-06-08 23:14:44)


Dick Baldwin - Don't get stuck scratching. When you master Scratch, move on up to more serious programming languages. Free online programming tutorials:
Scratch - Alice - Java - C# - C++ - JavaScript - XML - Python - DSP

Offline

 

#2 2008-06-09 04:14:14

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Preventing Scratch applet from running on load?

dbal wrote:

Does anyone know how to include two or more links to online projects in an html page and prevent them from running until the user clicks the green flag?

I know how to create the links.  What I don't know how to do is to keep the applets from starting as soon as the page is loaded instead of waiting until the user clicks the green flag.

I have heard of people implementing a work-around for this problem where they code the project so that it doesn't actually do anything until the user initiates an action, such as pressing the Space bar key.  So the Green Flag scripts fire but the projects wait for user input before proceeding.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#3 2008-06-09 09:13:59

dbal
Scratcher
Registered: 2007-07-19
Posts: 100+

Re: Preventing Scratch applet from running on load?

Paddle2See wrote:

dbal wrote:

Does anyone know how to include two or more links to online projects in an html page and prevent them from running until the user clicks the green flag?

I know how to create the links.  What I don't know how to do is to keep the applets from starting as soon as the page is loaded instead of waiting until the user clicks the green flag.

I have heard of people implementing a work-around for this problem where they code the project so that it doesn't actually do anything until the user initiates an action, such as pressing the Space bar key.  So the Green Flag scripts fire but the projects wait for user input before proceeding.

That's an interesting approach and I will certainly keep it in mind for the future.  Unfortunately, it doesn't help me much in this case.  I am writing an article for online publication that links to five existing projects written and shared by others on the Scratch website.  I ended up creating a separate HTML page for each project and creating links to the individual HTML pages in the main page of the article.  Then when the user clicks on a link, the separate HTML page opens in a new window with the applet running.  It's not a great solution but it is better than having five applets all running at the same time when the user loads the main HTML page.

Thanks for the information.


Dick Baldwin - Don't get stuck scratching. When you master Scratch, move on up to more serious programming languages. Free online programming tutorials:
Scratch - Alice - Java - C# - C++ - JavaScript - XML - Python - DSP

Offline

 

#4 2008-06-09 13:18:46

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Preventing Scratch applet from running on load?

However, i don't think you can have multiple java appletts running on the same time...


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#5 2008-06-09 14:54:01

dbal
Scratcher
Registered: 2007-07-19
Posts: 100+

Re: Preventing Scratch applet from running on load?

JSO wrote:

However, i don't think you can have multiple java appletts running on the same time...

You can, but it will really slow things down, particularly if you have a cheap HP laptop like mine.


Dick Baldwin - Don't get stuck scratching. When you master Scratch, move on up to more serious programming languages. Free online programming tutorials:
Scratch - Alice - Java - C# - C++ - JavaScript - XML - Python - DSP

Offline

 

Board footer