0
votes

I have a flash file A which contains all layout information and loads other widgets(also flash files).

I have another flash file B which contains buttons, labels, and others.

The flash B file uses scaleform CLIK components and works great by itself.

But it fails when I try to load flash B from flash A. It says

'ReferenceError: Error #1065: Variable DefaultLabel is not defined.'

The DefaultLabel component is shown in Library from flash B file. And again, it works good when I run flash B file independently.

I think flash A can not see DefaultLabel or similar thing but I'm a newbie to flash & actionscript. So I can not figure out how to solve this problem.

Any advise would be appreciate.

Added. I used flash.display.Loader to load flash B and added it to flash A by addChild().

1

1 Answers

1
votes

It could be that the definition is in different application domain which means that it is not available to outside of containing SWF (flash B), try to load to the domain of flash A:

var ldr:Loader = new Loader();
var request:URLRequest = new URLRequest("flash_b.swf");
var context:LoaderContext = new LoaderContext();
context.applicationDomain = ApplicationDomain.currentDomain;
ldr.load(request, context);