0 Replies Latest reply on Apr 19, 2010 11:05 AM by norrisoft

    swf reference Parent Flex application

    norrisoft

      Hi All,

       

      I am using Flex Builder 3 and Adobe Flash CS4/AS 3.0. I have a swf created using AS 3.0 that is the source for an Image in flex:

       

      import mx.core.Application;
        [Bindable]
        [Embed(source="common/swf/myCool.swf") ]
        public var isSource:Class;

       

      <mx:Image id="ico_mag_sm" source="{isSource}" />

       

      I want the swf to be able to access variables of the Flex applcation that loaded it. I am able top do so by doing the following in the AS of the swf:

       

          while (myObject.parent){
              myObject = myObject.parent;
              var topParent = myObject;
          }
          var myApplicationVar:String =  topParent.getChildAt(0).application["commonPath"];

       

      I no not want to use a swfLoader in place of the Image tag.

       

      So, the question is, in AS 3.0, in this situation, where I do not use a swfLoader, is there an easier way to reference the parent application?

       

      OR, if the SWF is the source of an image, is there a way for the Flex Application to pass a String to the swf?  I don't want to use a local connection.

       

      Thanks!

       

      Steve