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

#1 2011-03-08 17:50:46

kluspossible
Scratcher
Registered: 2009-04-15
Posts: 34

Changing Costumes when mouse is over?

I need a scripting for the following:

When sprite shown go to cotume 1
when mouse is touching sprite switch to costume 2
when not touching sprite go to costume 1
when sprite clicked go to costume 3

any help would be great thanks!

Last edited by kluspossible (2011-03-08 17:56:03)

Offline

 

#2 2011-03-08 18:28:16

Ratty1967UK
Scratcher
Registered: 2007-05-16
Posts: 88

Re: Changing Costumes when mouse is over?

Offline

 

#3 2011-03-08 18:44:42

Miss_Webgal
Scratcher
Registered: 2011-02-23
Posts: 500+

Re: Changing Costumes when mouse is over?

[blocks]
<when green flag clicked>
<show>
<switch to costume[ costume1
<if> <touching[ mouse-pointer?
<switch to costume[ costume2
<else>
<switch to costume[ costume1

<when[ sprite ]clicked>
<switch to costume[ costume3
[/blocks]

That should help.  smile


https://encrypted-tbn3.google.com/images?q=tbn:ANd9GcRWYoq0FKwiXwk187zDNnI34NF0Bu12bt-zUDATzda50bhMNfsKxw

Offline

 

#4 2011-03-08 19:24:25

Reverberated3
Scratcher
Registered: 2011-02-24
Posts: 100+

Re: Changing Costumes when mouse is over?

Another way to do this would be to first label the costumes 'true' and 'false'.  Then all you need is a script that makes it forever: switch to costume (mouse down?)


http://i53.tinypic.com/2zs0bah.jpghttp://i51.tinypic.com/30jtrbl.jpg

Offline

 

#5 2011-03-09 18:00:01

Ratty1967UK
Scratcher
Registered: 2007-05-16
Posts: 88

Re: Changing Costumes when mouse is over?

Reverberated3 wrote:

Another way to do this would be to first label the costumes 'true' and 'false'.  Then all you need is a script that makes it forever: switch to costume (mouse down?)

neat little trick  smile  might use that one myself... but as any C programmer will tell you, you need to be careful of using too many of them for fear of obfuscating your code!

Offline

 

#6 2011-03-09 18:00:47

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Changing Costumes when mouse is over?

Ratty1967UK wrote:

Reverberated3 wrote:

Another way to do this would be to first label the costumes 'true' and 'false'.  Then all you need is a script that makes it forever: switch to costume (mouse down?)

neat little trick  smile  might use that one myself... but as any C programmer will tell you, you need to be careful of using too many of them for fear of obfuscating your code!

That, and I don't think it works online.  hmm


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer