actionscript 3 - load symbol of flash in flex at runtime -


Hey guys, this is a big problem to me that I am loading an application from a SVF file in the script to runtime. I want to load it and want to give it as the argument of another class where it can be used more and more. The name of the symbol has been passed from the array collection from the "O" object.
  Public override function:   

Show (O: ObjectProxy): Zero {var _this: Weather; Var _super: ContentItem; Var Item: Weatheritem; Var items: Arrayquation; Var widget count: number; Var Headline Fonts: Int. Var ConditionsIncludeThemeloader: Loader; This.m_weatherWidgetContainer = New HBox (); Super. Show (o); _this = this; _ Super = super; (Undefined == o ["HeadlineFontSize"])? HeadlineFontSize = 20: headlineFontSize = o ["HeadlineFontSize"]; If (undefined! = O ["direction"]) it M_text Direction = o ["Direction"]; If (o.large url.urrestation) item = ArrayElelection (o.l.l.l.l.l.Urcast); And item = new array selection ([o.LargeUrl.Forecast]); WidgetCount = this.m_computeWidgetSpace (items.length); TermsChoathThemeLoader = New Loader (); conditionsIconThemeLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, function (e: Event): void {(var i: uint = 0; i & LT; widgetCount; i ++) {var symbolClass: Class = e.currentTarget.loader .contentLoaderInfo.applicationDomain .currentDomain.getDefinition (integer (item [i] .condition)) as a class, bridesmaid symbolInstance: Sprite = new symbolClass (); item = new WeatherItem (); item.Show (item [i], HeadlineFontSize, symbolInstance, widgetCount); _this.m_weatherWidgetContainer.addChild (item);}}); conditionsIconThemeLoader.contentLoaderInfo.addEventListener (IOErrorEvent.IO_ERROR, function (e: IOErrorEvent): void {Alert.show ( "PH" + WidgetStylesheet.instance.Weather_Widget_Theme + ".swf");}); // theme weather icon file conditionsIconThemeLoader.load (try to load new URLRequest ( "assets / animation /" + WidgetStylesheet.instance.Weather_Widget_Theme + ".swf")); Super.media.addChild (this.m_weatherWidgetContainer); }

The answer here

  public override function Show (O: ObjectProxy): Zero {var _this: Weather; Var _super: ContentItem; Var ConditionsIncludeThemeloader: Loader; Var Loader Contex: Loader Contains; This.m_weatherWidgetContainer = New HBox (); This.m_weatherWidgetContainer.percentHeight = 100; This.m_weatherWidgetContainer.percentWidth = 100; Super. Show (o); _this = this; (Undefined == o ["HeadlineFontSize"])? This.m_headlineFontSize = 20: this.m_headlineFontSize = o ["HeadlineFontSize"]; If (undefined! = O ["direction"]) it M_text Direction = o ["Direction"]; If (o.large url.urresta is a collection) this M_tym = o Allergen url Else this.m_items = New ArrayCollection ([o.LargeUrl.Forecast]); TermsChoathThemeLoader = New Loader (); LoaderContext = New LoadContent (Incorrect, ApplicationDomain.currentDomain); Terms IconThemeLoader Contributor InfestedEdvant Lostner (EventCompletion, This.M_LoadersSuccess); Terms IconThemeLoader Contributor Infoed Document Listener (IOErrorEvent.IO_ERROR, this.m_loaderFail); // subject to try to load the state of the weather icon file IconThemeLoader.load (new URLRequest ( "assets / animation /" + Vijetstisil. Instens. Veedr_vidt_thym +. "SWFs"), Loader Kansteks); This.m_weatherWidgetContainer.addEventListener (FlexEvent.CREATION_COMPLETE, this.m_drawHorizontalLine); Super.media.addChild (this.m_weatherWidgetContainer); }    

Comments