hey all!
I have a sliding menu and what i want is when i click a button the slider has to reach a certain point and then a preloader starts… i used a preloader from senocular. Below is the complete code my problem is in the first few lines. Maybe somebody can help me??
onEnterFrame = function() {
trace(pijl._y)
if (pijl._y != 233.55) {
startPreload("about/about.swf");
}
// this function begins preloading a swf url
function startPreload(url){
// use loadMovie to load the swf url into container_mc
container_mc.loadMovie(url);
// attach the preloader animation
// this will be removed when preloading is complete
attachMovie("preloader_external", "preloader_mc", 100, {_x:124, _y:214});
// set the onEnterFrame event to call preloadContainer
onEnterFrame = preloadContainer;
}
// this function runs the preloader
// it is to be used with the onEnterFrame
// of the preloader animation
function preloadContainer(){
// get bytes loaded and total from container_mc
var bytes_loaded = container_mc.getBytesLoaded();
var bytes_total = container_mc.getBytesTotal();
// stop and hide the movie so it wont play or
// be seen while progressively downloading
// (keep trying if it exists or not just to be sure)
container_mc.stop();
container_mc._visible = false;
// if bytes_total is a valid number and greater than 0
if (bytes_total > 0){
// get percent loaded
var percent_loaded = bytes_loaded/bytes_total;
// update the value in the preloader
preloader_mc.value = percent_loaded;
// check if preloading is complete
if (percent_loaded == 1){
// play and show the container clip
container_mc.play();
container_mc._visible = true;
// remove the preloader movie clip
preloader_mc.removeMovieClip();
// delete the onEnterFrame event handler running this function
delete onEnterFrame;
}
}
}
}