PDA

View Full Version : Component Access in a Loaded SWF


drnetworkx2
07-22-2008, 02:36 AM
Hey everyone,
Here's what I'm doing. I'm loading SWF file A into SWF file B. SWF file A has a List, TextInput, and Button as well as several Fonts. I also have many custom MovieClips in there as well.

When loaded into file B, file A seems to loose access to it's own library of components and fonts. The custom MovieClips show up file but the components and Fonts do not unless I add them to SWF file B's library. This is undesirable as I want SWF B to be as small as possible. If I play SWF file A by itself without loading it into B the components and Fonts show up just fine.

Any ideas?

CobaltBlueDW
07-22-2008, 03:54 AM
Things in the library don't automatically get compiled into the swf. Check all the export options for all the items you want to work in both places.

drnetworkx2
07-22-2008, 09:17 PM
Everything is set to export properly. The CellRenderer skins don't have "export in first frame" checked but "export for Actionscript" is checked. The fonts have both boxes checked and don't work as I'd like.

numediaweb
12-27-2008, 09:27 AM
you got to cast your loaded file as movieclip
in the loaded swf, i have a textfield called Fax, this is how to modify/access it:

var productSWFloader:Loader = new Loader();
var productSWFurl:URLRequest = new URLRequest("product_details.swf");
productSWFloader.contentLoaderInfo.addEventListene r(Event.COMPLETE, productSWFloaded);
function productSWFloaded(e:Event):void {
var loader:Loader = e.target.loader;
var product_details_swf:MovieClip = loader.content as MovieClip;
product_details.addChild(product_details_swf);
product_details_swf.Fax.text = "FAX 02455151225212102";
}