A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: A button in one SWF gotoandplay in another SWF on the same HTML page

  1. #1

    A button in one SWF gotoandplay in another SWF on the same HTML page

    Ooooohkay, i've been digging through the internet to try and find a solution to this... Basically i have two SWFs on my page, one of them has a button which i want to affect the SWF to the right of the page. So when you click the button, it simply goes to and plays from a frame in the second swf! Seems like it should be quite simple but none of the Local Connection tuts i've found make it very simple for my uneducated useless brain

    If anyone can help we need to get this thing up asap would be much appreciated.

    Sooo... This is the code we have in the sending SWF:

    stop();
    var sending_lc:LocalConnection;
    sending_lc = new LocalConnection();

    function send_it(evt:MouseEvent):void {
    sending_lc.send("_myConnection", "buttonClick");
    }

    _DomsTitty.addEventListener(MouseEvent.CLICK, send_it);
    and this is what is in the receiving file


    var receiverLC:LocalConnection;
    receiverLC = new LocalConnection();
    receiverLC.client=this;
    receiverLC.connect("_myConnection");
    function buttonClick(event:MouseEvent):void {
    gotoAndPlay(63)
    }
    Basically, you click on the button on the left and it starts the movie at frame 63 on the right!

    See EG here: http://eviltwin.tv/test/test.html

    You're supposed to click the little girl on the left which will drop the anvil on the little girl to the right - you can see that animation in action here: http://eviltwin.tv/wp/

    THANKS SO MUCH! Really need to get this up asap!

    Let me know if anyone needs the FLAs!

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    You never connected the first one.
    See the livedocs:
    http://help.adobe.com/en_US/FlashPla...onnection.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center