colfaxrev
11-06-2008, 09:34 AM
i posted about this before, and i have some new info. maybe someone will have another pointer for me with my new discovered tactics.
i am trying to load youtube videos into my AS3.0 main.swf
i found out that only one youtube video works at a time, and after a long time studying up on why, found out that youtube swfs use vars in _global space for the player to work with.
if you look at this page: http://livedocs.adobe.com/flex/3/langref/migration.html
it says:
_global
Removed
Use a static member of a class instead.
but i guess if you load in a AS2.0 swf, it's still using the virtual machine for 2.0 on those ones. so all their vars go into _global somewhere.
if two swfs are loaded in with colliding _global vars, there are going to be problems.
i recently discovered using the LoaderContext object which has solved a number of my other problems with security and applicationDomain stuff.
but it seems that even if i put the loaded swf into its own new applicationdomain it still puts all the vars into the same _global space.
am i missing something here?
var lc:LoaderContext = new LoaderContext();
lc.applicationDomain = new ApplicationDomain(null);
var myLoader:Loader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE, _onLoad);
myLoader.load(new URLRequest('http://www.youtube.com/v/M6K5nONQAcI&hl=en&fs=1'), lc);
addChild(myLoader);
i am trying to load youtube videos into my AS3.0 main.swf
i found out that only one youtube video works at a time, and after a long time studying up on why, found out that youtube swfs use vars in _global space for the player to work with.
if you look at this page: http://livedocs.adobe.com/flex/3/langref/migration.html
it says:
_global
Removed
Use a static member of a class instead.
but i guess if you load in a AS2.0 swf, it's still using the virtual machine for 2.0 on those ones. so all their vars go into _global somewhere.
if two swfs are loaded in with colliding _global vars, there are going to be problems.
i recently discovered using the LoaderContext object which has solved a number of my other problems with security and applicationDomain stuff.
but it seems that even if i put the loaded swf into its own new applicationdomain it still puts all the vars into the same _global space.
am i missing something here?
var lc:LoaderContext = new LoaderContext();
lc.applicationDomain = new ApplicationDomain(null);
var myLoader:Loader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE, _onLoad);
myLoader.load(new URLRequest('http://www.youtube.com/v/M6K5nONQAcI&hl=en&fs=1'), lc);
addChild(myLoader);