bmckenzie
01-04-2005, 04:25 AM
I'm trying to play a movieclip in a Flash MX2004 Window Component window.:
Could someone help me sort out how to scope this script so it works 'globally'?
_global.makeWin = function(){
trace("making window");
import mx.managers.PopUpManager;
import mx.containers.Window;
var win = PopUpManager.createPopUp(_root, Window, true, {closeButton:true});
trace(win);
}
If I run this from a button in a movieClip, I get a new window, plus the following messages:
making window
_level0.depthChild0
However, when I load the swf containing the button into another movie, clicking the button produces NO window, as evidenced by these messages:
making window
null
I can't find "depthChild" in the documentation, tho I guess it has to do with the first param in the createPopUp function. I have tried setting that param to _root, _parent, this, and _level0, all with the same result.
Baffledly,
Bruce
Could someone help me sort out how to scope this script so it works 'globally'?
_global.makeWin = function(){
trace("making window");
import mx.managers.PopUpManager;
import mx.containers.Window;
var win = PopUpManager.createPopUp(_root, Window, true, {closeButton:true});
trace(win);
}
If I run this from a button in a movieClip, I get a new window, plus the following messages:
making window
_level0.depthChild0
However, when I load the swf containing the button into another movie, clicking the button produces NO window, as evidenced by these messages:
making window
null
I can't find "depthChild" in the documentation, tho I guess it has to do with the first param in the createPopUp function. I have tried setting that param to _root, _parent, this, and _level0, all with the same result.
Baffledly,
Bruce