Communicate: Flash Movies

Home Food Mates • Members Tutorials Forum Buy Templates Contact Us 

 


Flash Tutorials

   

Flash Tutorial - Communication between Flash Movies: Part 1

 

Free Flash Tutorial


Step 1    <<   Previous      Intro   1   2   3     Next   >>       >>   Webwasp Mates

 

Step One: Creating the Controller Movie

This is the Movie that you will use to control the other Movies.

  1. Open a new: Flash Movie
  2. Make the Document Size: 120 x 80 pixels
    You can do this in: Modify > Document
  3. Place on the Main Stage: Two buttons
    Either make your own buttons or drag them out of the Library: Window > Other Panels > Common Libraries > Buttons
  4. Type under the first button the word: Stop
  5. Type under the second button the word: Play


    Your Movie should look similar to this.

  6. Add the following code to your Stop button:

    on (release) {
        _root.mySender.send("myConnections", "myAction", 2);
    }

  7. Add the following code to your Play button:
  8. on (release) {
        _root.mySender.send("myConnections", "myAction", 1);
    }

    Note: The only difference between the two bits of code is the number at the end of the second line. In one case it is a number: 1 and in the other it is a number: 2

    The code above sends the number to a function in the other Movie. The number you send, will determine what the function will do. In this case either Play or Stop. It is possible to have additional buttons with additional numbers. Each individual command or set of 'Actions' would need its own unique number.

  9. Add the following code to the frame 1 in the Timeline:

    mySender = new LocalConnection();

    Note: This sets up the variable: mySender

  10. Save your file as: movie_1.fla
  11. Now Export you Movie as a Flash Movie (swf file): File > Export > Export Movie
    This will create a file called: movie_1.sw

         

Step 1    <<   Previous      Intro   1   2   3     Next   >>       >>   Webwasp Mates


Webwasp Community: Webwasp Mates & Dates

Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates

 Top of Page Home Food Mates Members Tutorials Forum Buy Templates Contact Us 
 All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.