|
Socket Communication |
|
Step 2
Create a new file and create a new button or select a pre-made one from the Button Library. Place this button anywhere on your movie and copy the following syntax onto the button:
on (release) {
sMessage = "Hello World";
mdm.Network.UDP.Socket.send("127.0.0.1", 4000, "cMessage@eq@"+sMessage);
}
If we break this command down, we are instructing the Projector to send a message to IP 127.0.0.1 on Port 4000. We are then setting the variable cMessage in the client Projector to the value of sMessage (Which has been set to "Hello World").
Export this movie to a SWF called "server.swf" and then compile both SWF files to Projectors using Zinc™ v2.5.