FMX masking question

ok so heres the problem:

i have some buttons that are suppose to attach a movie clip on stage after you press it. This works perfectly, but after i mask it, the masking box blocks it so i can’t click on anything.

i hope you understood what i’m saying, and i’ve tried using the ‘setmask’ code, but that doesn’t work either.

Any ideas anyone?

thx

You got an FLA? flashHelp@xonesix.com

ok, so basically if you open the file i attatched and click test movie, pressing the green box doesnt’ work.

But after you unmask the pink box and move it away from the green box, the green box works (it duplicates itself) as you should see.

so anyone know how i can fix this so that the masking layer doesn’t affect pressing buttons under it?

I don’t see an attached file…

whoops that was dumb of me :slight_smile:

you are masking your testbox. This means that anything in testbox will only be seen if under the mask. All duplicated clips are kept within the scope of the original. So if you duplicate your green box in testbox, the duplicate stays in testbox. This means the duplicate is being masked just the same as everything else in testbox.

Alternatives to this would be using setMask to control your masking or attaching your mox in root instead of in testbox or having the mask within testbox itself masking only the greenbox and not all of testbox

to use the setmask thing the code is jsut

testbox.setmask(mask);

right?
i just tried it but its not working for some reason, i put it in the root.

i also tried putting that in ‘testbox’ and same with using the mask in testbox instead of the main thing. but it doesn’t seem to work!!!

help me plz!!!

I think it really boils down to what you are trying to accomplish in the long run. What is it exactly that all of this is for and how should it function in the end.

its basically suppose to be something like the infinite menu except changed a bit on this site, except when you click on the buttons they duplicate themselves into like a big picture

Correct me if I’m wrong but you are trying to attach an instance of pic1 when you click the testBox button/moveclip. Like Senocular said you are attaching it inside your testBox movie in an area that can’t be seen through the mask. You can attach it the main timeline instead and avoid the masking issue.

on (release) {
	bigpic1 = _root.attachMovie("pic1", "bigpic1", 2);
	setProperty("bigpic1", _x, 250);
	setProperty("bigpic1", _y, 250);
	setProperty("bigpic1", _xscale, 250);
	setProperty("bigpic1", _yscale, 250);
}

Or you could shorten your code a bit…

on (release) {
	props = {_x:250, _y:250, _xscale:250, _yscale:250};
	bigpic1 = _root.attachMovie("pic1", "bigpic1", 2, props);
}

You may need to change the 250 now since you were positioning it relative to your testBox before.

Here’s an illustrated example tryinto show what was happening. When you mask something you can only see what is behind that shape. In this case it is the red rectangle labeled “Viewable Area.” You were attaching your pic1 movieclip outside of that area. Anything not within the viewable area, or behind your pink rectangle in this case, will not be seen.

ah cool thx for the detailed explanation i think iv’e got it working now thx :slight_smile: