Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

understanding paths to MCs

Status
Not open for further replies.

webscripter

Programmer
Jul 29, 2002
266
US
Hi everybody,

This seems like a simple thing to me but no matter what I try it comes back as undefined.

//arbitrary level
//script is in frame 1 on main timeline
myMovie= createEmptyMovieClip("pagebody", level10);
bla bla bla more code here in frame 1

//in frame 2
//I'm loading a movie adminpage which has some user fields
//and a pushbutton component.
trace("entering page body fm2");
trace("adminpage = "+_root.adminpage);
trace("reloadmv = "+_root.reloadmv);
if(_root.reloadmv == 1){
trace("loadingMovie");
myMovie.loadMovie(adminpage);
_root.reloadmv = 0;
}

myvars = new LoadVars();
myvars.load("doors.txt");

myvars.onLoad = function (success) {
if (success) {
//the instance of the FPushButton is called pushbtn
//it's in the adminpage movie which has the instance name
//pagebody loaded in level10 assigned to it.
//if I can simply change the label of the pushbutton
//I won't have to create 3 movies that have the same
//items in them.
// trouble area
myMovie.pushbtn.setLabel(resetbtn);//doesn't work
trace(_level10.pagebody.pushbtn.getLabel););//nope
trace(_level10.pushbtn.getLabel););//notit
trace(_root.main[pabebody].pushbtn.getLabel;//same
trace(myMovie.pushbtn.getLabel););//doesn't work


//Can someone tell me the right path to pushbtn

trace("myvars.doornames = "+myvars.doornames);
if(myvars.doornames == undefined){
loadstat = "No doors added or unable to load doors.txt."
_root.loadsts.text = loadstat;
trace(ldstatus);//var name for textfield
}else{
doornm = myvars.doornames.split("|");
doords = myvars.doordescs.split("|");
trace(doornm.length);
door_list.removeAll();
for(i=0;i<doornm.length;i++){
door_list.addItem(doornm,doornm);
}
var i = 0;
}
}
};

stop();

Thanks
Tricia
yorkeylady@earthlink.net
 
I'm not too familiar with createEmptyMovieClip, but my understanding is that the second parameter is a depth and not another level on which this movie is created. And it should be an integer. You have created a movieclip on the root level with a depth of 10. Proof is, if I load another movie on level 10 (loadMovieNum(&quot;my_other.swf&quot;);), it overlaps your pagebody mc, rather than replacing it, if it was really on level 10.

Thus, as in my testing trying to recreate your situation, using:
trace (pagebody.pushbtn.getLabel());

... Works fine, but as long as the trace action is not on the same frame as the loadMovie action. Movie has to be loaded before you can trace anything in it. Regards,

oldman3.gif
 
thankyou so much, I will try that Thanks
Tricia
yorkeylady@earthlink.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top