I have my game, with a preloader in the first frame, that when reaches 100% go to 2nd frame. That works great.
Now i made a container/parent swf, that loads that swf, with fullscreen options, and when the child swf loads, it loses its preloading action and goes directly to frame 2. I know i call my child swf by the instance name of its the movieclip container/loader but i dont know where to put the prealoder.
In my parent/loader swf, i have the loader movieclip, instance name "mainholder" and inside of it i have the "subholder" movieclip, which is the responsible of loading my child swf. In the main timeline, on the first frame i have this:
OK, i learned the MovieClipLoader(), the loadClip, the onLoadInit, the onLoadProgress and all that. I managed to apply it to my parent swf. Now the problem is the worst...all my child's swf variables and functions doesn't work. What's going here? Don't tell me I have to change all the script to use things like "global" or my parent swf loader/container movieclip's instance name????? O_o thanks
are you trying to access the SWF's variable OUTSIDE onLoadInit? If so, then that might be the problem, because its variables won't be accessible until after it's been loaded into your main SWF, so, try accessing them inside onLoadInit
17 Years old boy, who loves the Computer Technology
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
Ok ok ok, i kinda "think" i understand what i have to do.
If on my child swf, my game, i have these variables
Actionscript Code:
pressed=false; rooms=4; item1PICKED=false;
Then in my PARENT swf, the loader, in the onLoadInit i refer ALL MY CHILD SWF VARIABLES to it:
onLoadInit=function(){
thispressed=ContainerMovieClip.pressed;
thisrooms=ContainerMovieClip.rooms;
Yeah, that should work, if you've remembered to add that listener to the MovieClipLoader instance :P
Also, event handlers, such as onLoadInit, they come with additional parameters you can use, for instance, for onLoadInit, you can get the target movieclip like this:
Actionscript Code:
someListener.onLoadInit = function(target){ trace(target.pressed); // same as ContainerMovieClip.pressed }
You can name it whatever you want, you could instead of naming it 'target', just name it 'someVar', and then change in the code from target.pressed to someVar.pressed and the result would've been the same
17 Years old boy, who loves the Computer Technology
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
Never mind Nig! Anyway, thanks for that, now I know how to call variables into a loaded movieclip.
But my issue was solved , removing all the "_root" from my variables, functions and objects!!!! Now when I load my child swf (my game) into the parent swf (the container, loader, with the fullscreen functions) IT'S ALL WORKING!!!!!!
Now...i still want to know something. In my child swf, if i have a movieclip, and inside that movieclip i have some script that i want to call someting in the main timeline, insted of "root" should I use "_global" or the container movieclip instance name?
I created a .swf only with all the game's sounds imported into the library with an identifier name. Then, i loaded that movieclip into my game swf, and i want to call the sounds. I tried
Hello again! I understand now the movieclipLoader and all its functions, but my game is not loading 100%. I managed to hide the swf until its 100% loaded, then it shows up, but some sounds and elements (objects, text) are not being loaded.
Actionscript Code:
function callLoadClip(clip:String):Void {
var mcLoader:MovieClipLoader = newMovieClipLoader();
It still doesn't load some sounds and graphics. It's weird, the preloading reaches 100% and everything seems to be loaded, but not. The starting music doesn't load, the sounds of the 3rd level, neither.
Not too knowledgable about runtime sharing stuff, i have looked at that before but never really needed to use it.
hundreds of explanations about it on the web though.
Loooooooooolllllllllllllllllllllllll you make me really laugh a lot! Thank you very much, i will read about this.
Hey about your site, maybe you can add an option to change toolbars color, that would be really nice love the fullscreen button, the buttons TOP or BOTTOM position changer, and the preloader