-
Senior Member
[RESOLVED] [F8] a setMask that does not work.
I am trying to mask elements so that you can not see them when they go out of the scene (sounds silly like that, but no when the swf is to be loaded into another one), but somehow I can not set the mask.
Could someone take a look at this code?
Code:
attachMovie("thing","masker",690);
masker._x = 370;
masker._y = 0;
masker._width = 64;
masker._height = ht;
//
for (i=0; i<nPics; i++) {
var a:MovieClip = attachMovie("thing", "mini"+i, 200+i);
a._x = masker._x;
a._y = 20+80*i;
a.loadMovie("img/pictures/"+i+"s.jpg");
//////////
a.setMask(masker);
}
I also tried setting the mask directly to one movie clip, mini2.setMask(masker); but it was as useless as a Britney Spears CD for someone lost in the Pacific Ocean.
-
Senior Member
Originally Posted by Ovaire d'Oz
I am trying to mask elements so that you can not see them when they go out of the scene (sounds silly like that, but no when the swf is to be loaded into another one), but somehow I can not set the mask.
Could someone take a look at this code?
Code:
attachMovie("thing","masker",690);
masker._x = 370;
masker._y = 0;
masker._width = 64;
masker._height = ht;
//
for (i=0; i<nPics; i++) {
var a:MovieClip = attachMovie("thing", "mini"+i, 200+i);
a._x = masker._x;
a._y = 20+80*i;
a.loadMovie("img/pictures/"+i+"s.jpg");
//////////
a.setMask(masker);
}
I also tried setting the mask directly to one movie clip, mini2.setMask(masker); but it was as useless as a Britney Spears CD for someone lost in the Pacific Ocean.
You can't mask multiple clips with the same mask. You will either need to create separate masks for each clip, or create a "master" container and mask that. For example:
PHP Code:
createEmptyMovieClip("holder", 680);
attachMovie("thing","masker",690);
holder.x = 370;
holder.y = 0;
masker._x = 370;
masker._y = 0;
masker._width = 64;
masker._height = ht;
holder.setMask(masker);
//
for (i=0; i<nPics; i++) {
var a:MovieClip = holder.attachMovie("thing", "mini"+i, 200+i);
a._x = masker._x; //keep in mind that a._x and a._y are now relative to holder, not the main clip;
a._y = 20+80*i;
a.loadMovie("img/pictures/"+i+"s.jpg");
//////////
//a.setMask(masker); //you don't need this now;
}
Hope this helps.
d.
-
Senior Member
[ok]
It works fine! I had to modify a couple of things in the rest of the code because this modification had incidence, but it looks perfect now. Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|