1 Reply Latest reply on Jan 13, 2010 8:09 AM by Yozef0

    Pass an Array from AS3 Flex app into an embedded AS2 swf file

    Yozef0 Level 1

      So I have an application in AS3, and I would like to load an AS2 compiled swf file into the AS3 project.

       

      The Scenario goes something like this: When a user clicks a button in the AS3 app, it would fetch an Array from the Server (AMF) and would like to pass the Array into the embedded AS2 swf file.

        • 1. Pass an Array from AS3 application into a SWFLoaded AS2 file
          Yozef0 Level 1

          Ok... this should not be difficult:

           

          I have a SWFLoader in AS3 (the main app) that loads a compiled AS2 swf (component). In the .swf file (component), I am trying to create a public function that can be called from the Main AS3 Application, and pass in an Array into that function which is in AS2.

           

          So the Code goes something like this:

           

           

          // Main App in AS3
          private var component:SWFLoader = new SWFLoader();
                      component.source = "com/yozef/components/Component.swf";
                      component.publicFunction(passArray);
          
          //Component Compiled SWF (in AS2)
          var region:Array = new Array();
          
          
          function populate(array:Array) {
               region = array;          // would like to pass the Array from the Main App (AS3) into this loaded Swf
          }
          
          
          

           


          Got any ideas?