Ok, so I’m somewhat of a beginner to actionscripting, so if this is an overly easy fix, sorry…
Ok, so I have a main swf file which uses a container to open another swf file into a container. I have multiple files being loaded this way and thought it was the best way for organizing and to keep file sizes down.
The .swf loads fine into the container and everything seems flawless untill i try to use the window component within the loaded swf.
The AS on the main button looks like this…
// function takes user to Scene 1 Frame 5 when children_btn instance
// is released
children_btn.onRelease = function (){
gotoAndStop("Scene 1", 5);
_root.createEmptyMovieClip("container",1);
loadMovie("children.swf","container");
container._x = 0 ;
container._y = 0 ;
};
then the actionscript with in children.swf to open the window is…
// create a new CSSStyleDeclaration named TitleStyles
// and list it with the global styles list
_global.styles.TitleStyles = new mx.styles.CSSStyleDeclaration();
// customize styles
_global.styles.TitleStyles.color = 0x000000;
_global.styles.TitleStyles.fontSize = 14;
function popup(wContent:String) {
v23.onPress = function() {
tw = mx.managers.PopUpManager.createPopUp(this, mx.containers.Window, true, {closeButton:true, titleStyleDeclaration:"TitleStyles"});
tw.title = "Audie England Photography";
tw.setSize(432, 600);
tw.contentPath = "images/children/ch023_a.jpg";
tw.move(20, 20);
var handleCloseObject:Object = new Object();
handleCloseObject.click = function(evt:Object) {
evt.target.deletePopUp();
};
tw.addEventListener("click", handleCloseObject);
};
}
popup("Testing....");
I read somewhere that it has to do with the _root. and having the links work through 2 levels. I just don’t know what to change in the AS to fix this.
Any help or better ideas would be appreciated.
Thanks