I have some problem with vars. The situation is the same I wrote here Re: External swf
I have public var (for example ZZZ) in code of MAIN.swf (main class is Main.as), and I want to access it from code of loaded EXTERNAL.swf.
But nothing helps, flash says:
there is no ZZZ in code of Main
there is no ZZZ on stage.root
there is no ZZZ in any parents.
But if a have ZZZ in code of EXTERNAL, and want to access it from MAIN, (the reverse situation), ZZZ is easily found.
your variable is defined on the main timeline of MAIN.swf so you just need a path to it.
that exact path depends on the scope of EXTERNAL's loader.
(and, of course, you need to make sure that variable is defined before trying to reference it.)
public var ZZZ:Number = 9;
As I read now in Adobe's help : Loader has no root until it is added as a child (and i don't do that), and External has it's own root (and i don't add him either). May be I should pass to EXTERNAL
as exact pass, and then
would be found?
I have another idea: getDefinitionByName won't help External to find ZZZ in Main?
No, getDefinitionByName is not working, more then that, not only public vars are not seen by External, but also any public functions.I used
So MAIN sees everything in EXTERNAL, and I can't make EXTERNAL see everything in MAIN so far... but library he sees.
Europe, Middle East and Africa