Skip to main content
Srihari_Ch
Known Participant
April 1, 2009
Question

I need to access/pass variables'(s) of a .swf file into another .swf file.

  • April 1, 2009
  • 2 replies
  • 1054 views
Hi all,
I have basic knowledge of Flash and AS3.0.
Suppose i have a flash swf file(main.swf). In this main.swf file, i loaded another swf file(sub.swf) by writing the following code snippet in main.swf file as shown in Attach Code:


Now, how to acess the data present in main.swf into sub.swf.
Note: Here data represents values/data stored in variables/objects of main.swf file.
This topic has been closed for replies.

2 replies

xchanin
Participating Frequently
April 1, 2009
So in the parent movie if you have a function:

function calledFromChild():void
{
trace("function called from child movie");
}

Then in the child movie:

MovieClip(this.parent.parent).calledFromChild();

xchanin
Participating Frequently
April 1, 2009
var textLdr:Loader = new Loader();
var noteUrl:String = "AddNote.swf";
var noteUrlReq:URLRequest = new URLRequest(noteUrl);
textLdr.load(noteUrlReq);

addChild(textLdr);
//target the property or variable in the loaded .swf
textLdr.x = 50;
textLdr.someVariable;
Srihari_Ch
Known Participant
April 1, 2009

Thanks for your reply.
What we need is:
How to acess the data present in main.swf into sub.swf..
But,The code you posted is for accessing data present in sub.swf into main.swf.

Please check it once and reply me..
It's very urgent...

Thanks.
Srihari.Ch