>> SPEAKER 1: Let's take a look at another program I've been working on.
This one involving two Muppet's playing Marco Polo.
A game in which one person says Marco, to which the other
person responds Polo.
>> This program is going to allow us to introduce a new programming construct
known as events.
Whereby one of these Muppet's is going to be able to broadcast an event so to
speak, signifying that he has said Marco.
The other Muppet meanwhile is going to be listening for that event, thereby
responding to the other saying Marco.
So let's take a look.
>> Here we have the orange Muppet's scripts.
And what he's doing is, when the green flag is clicked he's
forever doing the following.
If the space bar is pressed, than he is going to say Marco for two seconds
on the screen.
But he's also going to broadcast something we'll arbitrarily call an
event in this case.
And that's it.
>> And any time I hit the space bar, he's not only going to say Marco on the
screen, he's going to broadcast that event.
Now, for simplicity I've called that event EVENT, but I could have called
it most anything.
Because Meanwhile the blue Muppet is going to be listening for that event
with the following very simple code.
>> All this Muppet is doing is upon receiving that event he's going to say
Polo for two seconds.
Indeed, any time he receives that event he's going to
say Polo on the screen.
So there you have it, with just a couple of pieces here, and a few more
puzzle pieces there, we have two Muppet's playing Marco Polo.
>> Let's see what happens when we click the green flag.
I'm going to have to now hit the space bar, so that the orange Muppet says--
and so that the blue Muppet then says--