5 Replies Latest reply on Jul 24, 2010 6:52 PM by kglad

    Pass url from fla AS3 to class

    wunderful61 Level 1

      I have a class that works with an external swf with play, pause and slider. Now that I have all that working, I'd like to be able to pass the URL of the external SWF to the class from the main fla AS. I managed to use a 'set' inside the class to retrieve the name, but it apparently doesn't trigger until after the external SWF gets loaded. Code snippets follow:




              public var loader:Loader;
              private var _urlName:String;
              public function CntlClass()
                  loader = new Loader();
                  loader.contentLoaderInfo.addEventListener(Event.COMPLETE, movieLoaded);
                  loader.load(new URLRequest(_urlName));




             public function set urlName(value:String):void
                  _urlName = value;


      Main FLA file - other than a controller (cntl_mc) containing a play button, a pause button, and a slider, the only thing in the FLA file is this code in the first frame:


           cntl_mc.urlName = "extswf.swf";