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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

code problems and button

Status
Not open for further replies.

MJB3K

Programmer
Jul 16, 2004
524
GB
Hi, i am having some problems with some coding and buttons. the buttons aren't passing on the variables to the coding...

Code:
/*********************************************/
in a movieclip called loadContent on 1st frame
/*********************************************/
_root.container.loadMovie(url2load);
trace("url2load var = "+url2load);
this.onEnterFrame = function() {
	trace("begging this.onEnterFrame sequence");
	//trace the percentage of the movie that has loaded
	percent = (_root.container.getBytesLoaded()/_root.container.getBytesTotal())*100;
	if (!isNan(percent)) {
		trace(percent+"% loaded");
		if (percent == 0) {
			percent_display = "";
		} else {
			_root.grFlash.grFlashLoad.text = Math.ceil(_root.container.getBytesLoaded()/1024)+"/"+Math.ceil(_root.container.getBytesTotal()/1024)+"kb";
		}
		if (percent>1) {
			this.reelmc._visible = true;
		}
		container.stop();
	} else {
		//      trace("0% loaded");
	}
	if (percent == 100) {
		delete this.onEnterFrame;
		_root.grFlash._visible = 0;
		_root.grFlash.enabled = false;
		loadMovie(url2load, 0);
	}
};
stop();

/*********************************************/
on a button
/*********************************************/
on (press) {
	_root.loadContent.url2load = "fred.swf";
}

for some reason it isn't passing the variable to the movieclip.

any ideas??

sorry if i haven't explained properly!!


Regards,

Martin

Gaming Help And Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top