1 Reply Latest reply on Apr 27, 2009 10:17 AM by Flex harUI

    LocalConnection: Receiving message from flash(.swf) file

    spugalia

      hi

       

      I have got a flash radio file (.swf) from third party which playes the songs. I need to integrate this inside my application.Application is portal and written in asp.net which launches this flash file as pop-up

      Scenario is : When user click on any song in .swf file, at the application we should be able to display its title.

       

      I have found(through reverse enginnering) that radio.flash file uses localConnection and send following parameters whenever the user click on any song.

      conn.send("basePlayerConnect,"setPlayerLabel","title","thumb","albumtitle")

      where title is string, thumb is image and albumtitle is string

       

      Now i have written a another flex application which has a textinput. i emebeded this in the portal application (as embedded .swf file). Whenever a radio popup is launch at site and user click on any song the title of the song should be displayed inside this flex application

       

      Code is:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="{createLw()}">

       

      <mx:Script>
          <![CDATA[
          import flash.net.LocalConnection;

       

         
          private var incoming_lc:LocalConnection = new LocalConnection();
         
          private function createLw()
          {
              incoming_lc.connect("basePlayerConnect");

                incoming_lc.client = this;
          }


          function setPlayerLabel(param1:String,param2:String,param3:String):void
          {
            sentMessage_txt.text = "param1";
           
          }
          ]]>
      </mx:Script>

       

          <mx:TextInput id="sentMessage_txt" x="0" y="0"/>

       

             
      </mx:Application>

       

      this is very imp for me please let me know how to ahieve this