www.webdeveloper.com
Results 1 to 3 of 3

Thread: Sending an exact variable command between two flash swfs

  1. #1
    Join Date
    Jan 2010
    Posts
    10

    Sending an exact variable command between two flash swfs

    Hi,
    I have two flash clips in an html file and I need them to communicate.

    One is a player window and the other is a menu.

    Now, I managed to find a code on the net that works for sending a text variable over a local connection. It looks like this:

    Code:
    on(rollOver)
    {
            my_lc= new LocalConnection();
            my_lc.send("_myLocalConnection","recievedValue","Home")
    }
    And the receiver is like:

    Code:
    myReceiving_lc = new LocalConnection() 
    myReceiving_lc.connect("_myLocalConnection") 
    myReceiving_lc.recievedValue = function(menuName) 
    {
            myText=menuName
            trace(menuName)
    }
    How do I have to modify this AS so it would be able to receive an exact command? For example, a button in the menu would send a GotoFrame(3) so the player would jump onto it's corresponding frame. Another button would send a GotoFrame(4), etc.

    I've been thinking that I'd use the code like this:
    Code:
    on(release)
    {
            my_lc= new LocalConnection();
            my_lc.send("_myLocalConnection","recievedValue","GotoFrame(3)")
    }
    But then how do I receive and excute that command in the player?
    I've started with

    Code:
    myReceiving_lc = new LocalConnection() 
    myReceiving_lc.connect("_myLocalConnection") 
    myReceiving_lc.recievedValue = function(-received comand-) 
    {
    - function execution -
    }
    I'm not exactly sure how to finish this receiving code or if I should re-state it. Any ideas?
    Thanks in advance

  2. #2
    Join Date
    Feb 2008
    Location
    NW Washington State
    Posts
    1,856
    I don't have an answer for that problem.
    But why not put the menu and the player in the same .swf file and skip the hassel?
    Best wishes,
    Eye for Video
    www.cidigitalmedia.com

  3. #3
    Join Date
    Jan 2009
    Posts
    3,346
    I agree that at least importing both swfs to a single container swf would eliminate the hassle.

    As for the coding portion of how to handle the commands I would use a switch statement.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles