2 Replies Latest reply on Feb 23, 2009 9:11 PM by flexstone

    Sending variables between swfs

    SiHoop Level 1
      I'm loading one swf into another and trying to send a variable to the loaded swf. I'm using the code at the bottom to load the swf and send the variable. In the loaded swf I'm using:
      [Bindable] public var myName:String
      Then in a function:
      myName = Application.application.parameters.loginID;
      trace("loginID="+myName)
      This fails to load. Can anyone tell me what I'm doing wrong? Thank you!

        • 1. Re: Sending variables between swfs
          Level 7

          "SiHoop" <webforumsuser@macromedia.com> wrote in message
          news:gnvnor$105$1@forums.macromedia.com...
          > I'm loading one swf into another and trying to send a variable to the
          > loaded
          > swf. I'm using the code at the bottom to load the swf and send the
          > variable. In
          > the loaded swf I'm using:
          > [Bindable] public var myName:String
          > Then in a function:
          > myName = Application.application.parameters.loginID;
          > trace("loginID="+myName)
          > This fails to load. Can anyone tell me what I'm doing wrong? Thank you!

          If you look at this example:
          http://flexdiary.blogspot.com/2009/01/example-of-casting-contets-of-swfloader.html

          You will see examples of loading two different types of swfs and calling a
          method on each one. Please remember that a setter is also a method, so the
          technique should work to allow you to set a variable as well.


          • 2. Sending variables between swfs
            flexstone Level 1
            BTW to read parameters you need to do a for loop

            for( var i:String in mx.core.Application.application.parameters){
            trace( i +'='+ mx.core.Application.application.parameters )
            }