JavaScript & Flash

Home Food Mates • Members Tutorials Forum Buy Templates Contact Us 

 


Flash Tutorials

   

Tutorial - Communication between Flash Movies: Part 2

 

Free Flash / JavaScript Tutorial


Step 1    <<   Previous      Intro   1   2   3   4   5   6     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
    The size of my Movie is: 250 x 80 pixels
  2. Place on the Main Stage: Three buttons
    Either make your own buttons, or drag them out of the Library: Window > Other Panels > Common Libraries > Buttons
  3. Add the following code to your first button :

    on (press) {
        _root.sender.send("myConnection", "doAction", 2);
    } on (release) {
        getURL("javascript:NewWindow=window.open ('pop1.html', 'myWindow', 'width=468, height=60, left=400, top=200, toolbar=No, location=No, scrollbars=No, status=No, resizable=No, fullscreen=No'); NewWindow.focus(); void(0);");//Note from getURL to here is all one line
    }

    Note: pop1.html is the name of the web page that will be opened. The size of the page will be 468 x 60 pixels. The left=400, top=200 is the position on screen of the Pop Up Window.

  4. Add the following code to the second button:
  5. on (press) {
        _root.sender.send("myConnection", "doAction", 2);
    }
    on (release) {
        getURL("javascript:NewWindow=window.open('pop2.html', 'myWindow', 'width=70, height=70, left=400, top=200, toolbar=No, location=No, scrollbars=No, status=No, resizable=No, fullscreen=No'); NewWindow.focus(); void(0);");//Note from getURL to here is all one line
    }

    Note: pop2.html is the name of the web page that will be opened. The size of the page will be 70 x 70 pixels.

  6. Add the following code to the third Button:

    on (release) {
    _root.sender.send("myConnection", "doAction", 2);
    }

    Note: This closes any of the Pop Up Windows that the other buttons may have opened.

  7. Add the following code to Frame 1 in the Timeline:
  8. sender = new LocalConnection();

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

         

Step 1    <<   Previous      Intro   1   2   3   4   5   6     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.