goaganesha
Programmer
Hi
I know oldnewbie has explained this allready several times to different people in this forum but I still can't get it to work. So maybe you give it another go oldnewbie? ;-)
Here's the problem.
I have a button in a mc which is in another mc, which also is in yet another mc. This is the code for the button.
but this doesn't work either. I can get it to work if i put a testbutton on the mainstage so it must have something to do with the level the movie has to be attached on.
If you want to see the full code, this is the example I'm using to make it work:
regards, goaganesha
I know oldnewbie has explained this allready several times to different people in this forum but I still can't get it to work. So maybe you give it another go oldnewbie? ;-)
Here's the problem.
I have a button in a mc which is in another mc, which also is in yet another mc. This is the code for the button.
Code:
on (press) {
// create a new window object
newWindow = new windowObj(mainTitle);
}
In a frame on the mainstage I've put this code:
zOrderList = new Array("0");
defaultX = 100;
defaultY = 100;
increment = 7;
id = 0
mainTitle = "Sample Title";
mainContent = "Here is some sample content...";
// create a new windowObj...
function windowObj (title) {
// get the current depth based on the array
id++
var depth = id;
trace("id: "+id);
// create
_root.attachMovie("window", "window"+id, id);
this.window = _root["window"+id];
// position
this.window._x = defaultX+((id-1)*increment);
this.window._y = defaultY+((id-1)*increment);
// set data
this.window.title = title;
this.window.content = content;
this.window.myID = id;
this.window.myDepth = zOrderList.length;
zOrderList.push(id);
}
I've also tried
_level0.attachMovie("window", "window"+id, id);
If you want to see the full code, this is the example I'm using to make it work:
regards, goaganesha