setMask()
- Started
- Last post
- 14 Responses
- autonoma
Why doesn't this work?
this.createEmptyMovieClip("holde...
this.attachMovie("masker", "newMask", 2);
this.newMask._x = 0;
this.newMask._y = 0;this.holder.setMask(newMask);
I'm using the "holder" clip to load a movie into, and the "newMask" clip to only display a portion of the loaded clip.
- versa0
maybe cause you aren't actually loading masker into holder yet
?
not sure exactly what isn't working for you
- autonoma0
The "newMask" shouldn't load into "holder". It's supposed to MASK "holder", but it's not.
- versa0
have you tried creating the holder and assigning the mask to other MCs and not the root
- autonoma0
The mask is not attached to the root. It's attached to "this.holder".
- versa0
well correct me if i am just tired here, but in the original code posted, aren't you just creating an MC on the root, and then just attaching an MC to the root..........holder.attachMovie...
would do it, but "this" in the original code, is just putting everything on the root
- versa0
oh wait.........i see what you mean i am tired right now
so
this may sound silly, but have your tried using a redundant path in your setMask....
like a call to the root or parent and then maskee........that has worked for me strangely in the past
- autonoma0
This is all taking place inside of a container clip.
- versa0
still....just humor me and try something like
this.holder.setMask( _parent.newMask);
- autonoma0
No go.
- versa0
sounds like attachMovie is making the setMask null........just make your attachMovie call in a separate clip outside the container, that will act as the mask, and on the original container clip, have an onClipEvent(load) event that sets the mask and maskee when it first loads
- versa0
sounds like attachMovie is making the setMask null........just make your attachMovie call in a separate clip outside the container, that will act as the mask, and on the original container clip, have an onClipEvent(load) event that sets the mask and maskee when it first loads
- autonoma0
You know what it is? I think it's that you can't mask a .swf that's been loaded into a clip. At least it seems that way.
- versa0
right..........never tried it before, but that's what i'm thinking
try the method i so drunkenly and tiredly tried to write
- unfittoprint0
It's a poorly described issue.
The setMask action will be disabled if you use loadMovie within the masked MC.
2 solutions:
#1. Create a setInterval that checks if the getBytesLoaded == getBytesTotal in your targetMC. If so, use setMask.
#2 Less complex. Create an empty Movieclip [holder]. Use the setmask on it. Then create an empty movie clip [loadedMC] inside holderMC. You can use loadMovie in LoadedMC without worrying with setMask being disabled because it's its 'parent' being masked not it.