• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

pass data to child swf after swf loading completed

Guest
Jan 20, 2018 Jan 20, 2018

Copy link to clipboard

Copied

I am loading one swf file inside a main swf by using swfloader and i want to pass the parameters to the loaded swf. How can i get the loaded child reference to pass data. My sample code is as follows

TestFile1.mxml

public var loader:Loader = new Loader();
loader
.contentLoaderInfo.addEventListener(Event.COMPLETE, myFun);
loader
.load(new URLRequest("/view/flex/TestFile2.swf"), new LoaderContext(false, ApplicationDomain.currentDomain));
viewId
.addChild(loader);  

public function myFun(event:Event😞void{
  
Alert.show("loader.content-"+loader.content); // here alert coming like this [object_TestFile2_mx_managers_SystemManager]
  
var testfile2:TestFile2 = loader.content as TestFile2; // here testfile2 is null
  testfile2
.param1 = "val1";
}

Views

220

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jan 24, 2018 Jan 24, 2018

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines