0

Hi, i'm having a problem with my flash file but i'm not sure what it is that i'm doing wrong.

The site starts with a preloader and loads up a simple shell, then once thats loaded i want it to dynamically load the home.swf into an empty movieclip, only it doesn't, but when i click on any of the links the .swf's will load into the blank movieclip just fine, so i know they work alright.

Here's the actionscript for the first frame:

stop();

myInterval = setInterval(preloader,10);
function preloader(){
	if(getBytesLoaded()>=getBytesTotal()){
		play();
		clearInterval(myInterval);
	}
	preloaderText.text=Math.round(getBytesLoaded()/getBytesTotal()*100)+"%"
	preLoadBar.mask._yscale=(getBytesLoaded()/getBytesTotal()*100);
}

After that's loaded it goes onto the next frame with this actionscript:

stop();

onLoad = function(){
	external_swf_mc.loadMovieNum("home.swf", 0);
}

button_home.onRelease = function(){
	external_swf_mc.loadMovie("home.swf");
}

I've tried using google to find an answer but no luck so far, i tried using onEnterFrame but that seems to break it, does anyone have any ideas?

Cheers.

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by seagreen
0

Sorry if this is a "duh" question, but why do you have an onload script AND a button doing the same thing?

0

Sorry if this is a "duh" question, but why do you have an onload script AND a button doing the same thing?

I shortened that second bit of actionscript as i didn't think the rest was important, the button is one of five that load in the other pages (external swf's) of the site into the shell, home, classes, contact, etc.

But i want the home page to load up automatically once the preloader has loaded in the shell, otherwise you have a shell with no content, which looks a little boring and causes the site to look broken.

Anyway, it doesn't matter now, someone over at actionscript.org sent me a link to a tutorial on kirupa.com that solved the problem, i needed to use MovieClipLoader instead of onLoad, which was a huge relief, i was tearing my hair out here trying to get it to work!

kirupa.com/developer/actionscript/moviecliploader2

Cheers anyway, peace :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.