3 Replies Latest reply on Nov 7, 2008 1:21 PM by kglad

    Loading Variables

      I load MC's from the library.
      In the MC i set variables - example var sName = "My name is mike"
      than I load a .swf ( Lesson1.swf) created in captivate
      in the Loaded swf ( lesson1.swf) I have want to put a MC.. that grabs the Variables set.

      I can do this, if the variables that are set at the root or anywhere else... but I can't grab them when the variable is set from a library item that is loaded in.

      I there a another way to grab vars set in the library from a another SWF that is loaded?
      Maybe using "Post" or get?

        • 1. Re: Loading Variables
          kglad Adobe Community Professional & MVP
          you're using attachMovie() to "load" a mc from the library? if so, that mc must have an instance name (the 2nd parameter in attachMovie() and path (the mc to which you apply the attachMovie() method. you can use the path and instance name to reference sName: path.name.sName
          • 2. Re: Loading Variables
            myckelh Level 1
            I realized a flaw in my design even if I can get the loaded .swf to read the _root .swf.
            This would mean that I would have to read the specific MC at the root level every time. ( and I have 100’ds).

            Is the a way to send out the variables and catch them from the loaded swf without having to drill down to the specific _root MC.

            For example, I currently post vars to a .asp and place them in Database. Using the Post method.
            Is there something similar I can do with sending the vars out and catching them from another swf ( the loaded one in this case)?
            • 3. Re: Loading Variables
              kglad Adobe Community Professional & MVP
              you can use the watch function to dispatch some variable changes but you probably don't need that. what are you trying to do and why?