# onClipEvent Handler

**URL:** <https://forum.kirupa.com/t/onclipevent-handler/117853>\
**Category:** Uncategorized\
**Created:** [July 30, 2004, 9:48pm UTC](https://forum.kirupa.com/t/onclipevent-handler/117853 "2004-07-30T21:48:13Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![jiggavo](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@jiggavo](https://forum.kirupa.com/u/jiggavo)\
**Post date:** [July 31, 2004, 1:50am UTC](https://forum.kirupa.com/t/onclipevent-handler/117853/9 "2004-07-31T01:50:14Z")

</div>

okay… it’s still not working… my code is as follow

```auto

// stop the play head
stop();

//create the movie clip to hold the preloader
this.createEmptyMovieClip("preLoader_mc",1);
//put the preloader in the right spot
preLoader_mc._x = 242;
preLoader_mc._y = 212;
//create some variables for the preloader
preLoader_mc.tBytes = this.getBytesTotal();
preLoader_mc.startX = 0;
preLoader_mc.startY = 0;

//create the text field to display the information
preLoader_mc.createTextField("loader_txt", 10,176,-14,50,20);
//create a text format and set some properties
var loadFormat:TextFormat = new TextFormat();
loadFormat.font="verdana";
loadFormat.bold=true;
loadFormat.size=8;
loadFormat.color=0xffffff;
preLoader_mc.loader_txt.setNewTextFormat(loadFormat);

// load external movies
preLoader_mc.loadMovieNum("movie_clips/clip.swf", 50);

preLoader_mc.onEnterFrame = function(){
	this.clear();
	//create the lineStyle
	preLoader_mc.lineStyle(0,0xFFFFFF,100);
	//get the amount of loaded bytes
	lBytes = _root.getBytesLoaded();
	//create the percentage variable
	var percentLoaded = Math.floor((lBytes/this.tBytes)*100);
	if(lBytes != this.tBytes){
		//insert the text into the text field
		this.loader_txt.text=percentLoaded+"%";
		//start the fill
		this.beginFill(0x925080,100);
		//draw the loader
		this.moveTo(this.startX,this.startY);
		this.lineTo(this.startX,this.startY+8);
		this.lineTo(this.startX+(percentLoaded*2),this.startY+8);
		this.lineTo(this.startX+(percentLoaded*2),this.startY);
		this.lineTo(this.startX,this.startY);
		this.endFill();
	}else{
		//go to the second frame
		_root.play();
		//remove this preloader
		this.removeMovieClip();
		this.removeTextField();
	}
}

```

the entire script iteslf works… but it’s not loading the external movie.

---

_[View the full topic](https://forum.kirupa.com/t/onclipevent-handler/117853)._
