PDA

View Full Version : createEmptyMovieClip / MovieClipLoader



crunchysocks
July 6th, 2005, 10:43 AM
Hey, i have a website i'm building, and when the user clicks a button, it goes to a certain point in the timeline, which then initiates some code to load a movie clip onto a certain part of the screen.

I made a sample swf to be loaded(home.swf), but the thing is, I dont want the user to see the things that are off the page of home.swf, that the user couldn't normally see... i was wondering the best way to solve this.

As you can see, i already tried sizing the clip, but that only made it extremely small and didn't solve the problem. :P

Here is the code on the main timeline :



this.createEmptyMovieClip("content_mc", this.getNextHighestDepth());
var mclLoader:MovieClipLoader = new MovieClipLoader();
var oListener:Object = new Object();
oListener.onLoadInit = function (mcContent:MovieClip) {
//mcContent._width = 850;
//mcContent._height = 367;
mcContent._x = 96.0;
mcContent._y = 157.0;
};
mclLoader.addListener(oListener);
mclLoader.loadClip("home.swf", content_mc);


Appreciate any help given. :D

virusescu
July 6th, 2005, 11:19 AM
I dont want the user to see the things that are off the page of home.swf,
Are you talking about masking ? If yes... put a mask over content_mc.

crunchysocks
July 6th, 2005, 09:47 PM
How did i not think of that haha :P

I tried using something like this:



root.content_mc.setMask(root.gContentHome);


And have a movieclip on the stage, alpha set to zero, with an instance name of gContentHome.

Any reason why that wouldn't be working?

crunchysocks
July 6th, 2005, 09:50 PM
Oh i just thought of something, could it be because i'm using getNextHighestDepth for the movieclip, so its always going to be overtop of the masking layer, and therefore won't work?

Are layers as simple as i think they are, meaning, instead of setting getNextHighestDepth when defining the movieclip, could i just count up how many layers, and place a value of 10 for example?

Thanks for your help so far virusescu ;)

crunchysocks
July 6th, 2005, 10:06 PM
Don't worry, think i found a solution.... although it stuffed up some parts of the movieclip... in the swf that is loaded, i put a mask, and put all the layers underneath in the mask. But if anyone has a better solution, or suggestion, please do post ;)

Thanks

virusescu
July 7th, 2005, 03:48 AM
you load the swf in a container or on a level?
Consider loading in a container... and after the load is done setMask over that container.