PDA

View Full Version : duplicateMovieClip and a Mask, only one problem....


Drakon
09-27-2003, 09:56 AM
Hi everyone! Been into flash like from a week now on, and still find some things strange. Besides those things, i might have some 2 concrete questions.
1. I have a movie clip that's suposed to work like a button. I mean got inside some text box and an actual button to get the hand icon when mouseover it. Above this layer containing the buton is a layer with a rectangular shape wich i set to be a mask. The buttons layer conforms and get's it's place into the rightbottom of that mask layer.Ok .Now at frame 1 this buton is set to invisible . The button then gets duplicated in a while(the original buton is named spawner)
while(nr<vect.length)
{
var dup="button" add nr;
spawner.duplicateMovieClip(dup,-nr);
setProperty(dup,_x,100);
setProperty(dup,_y,140+25*nr);
nr++;
}
No matter what deph level i set those buttons do not get affected by the mask. I see them all. I tried also: spawner.duplicateMovieClip(dup,nr);
2. The sec questions is like: if i started to draw some things in diferent layers and come up with something like a menu bar and added the actionscript to it, can I put all this in a movieclip so i can use it in more projects? If i select all the stuff, and say convert to simbol->movie clip all the stuff colapses into one layer and the action script is gone. Let's say that the actionscript would be no problem but still i don't fancy the ideea of having to copy paste those shapes and carefully rearange them in there own layers in the new clip.
3. Ok, ok so my mind poped another question, just hope to be the last one or i'll never finish this post or i'll make u guys fall asleep reading:)
Sometimes if i tell a movie clip to go to _x=0 _y=0 it gets on the stage like it puts the center of that movie at those coords. And is true, i see that circle with a cross in the middle of that movie. Now i guess i could work around it and instead of seting _x=0 i could say _x=movie._width/2(if that works) -i rather do the math myself. But i found somewhere(can't seem to remember where) i think they were using an "allign layer"? didn't pay much attention to that. So is it posible to set something in the align pannel and not have to again move all things so that the little target like simbol to be in the upright corner?

Ok, thaks for reading, guys!

bluegel
10-03-2003, 10:48 AM
woa - you are asking a lot of questions here, and I would suggest that you split them into three different threads so that all questions can be answered to the best of people's knowledge.

Oh and if you feel you are not getting the resposes required, why dont you attach sample files for each question.

Hope this helps you to get some more help

Xenozip
10-03-2003, 03:26 PM
Originally posted by Drakon
Hi everyone! Been into flash like from a week now on, and still find some things strange. Besides those things, i might have some 2 concrete questions.
1. I have a movie clip that's suposed to work like a button. I mean got inside some text box and an actual button to get the hand icon when mouseover it. Above this layer containing the buton is a layer with a rectangular shape wich i set to be a mask. The buttons layer conforms and get's it's place into the rightbottom of that mask layer.Ok .Now at frame 1 this buton is set to invisible . The button then gets duplicated in a while(the original buton is named spawner)
while(nr<vect.length)
{
var dup="button" add nr;
spawner.duplicateMovieClip(dup,-nr);
setProperty(dup,_x,100);
setProperty(dup,_y,140+25*nr);
nr++;
}
No matter what deph level i set those buttons do not get affected by the mask. I see them all. I tried also: spawner.duplicateMovieClip(dup,nr);First of all, that button inside the MC might not be necessary. If you just wanted the cursor to display when the mouse is over the MC, then use : this.useHandCursor = true;

As for the mask, you know masks work in reverse, right?
Meaning, whatever is under the mask will be shown, anything not underneith the mask will be invisible... Originally posted by Drakon
2. The sec questions is like: if i started to draw some things in diferent layers and come up with something like a menu bar and added the actionscript to it, can I put all this in a movieclip so i can use it in more projects? If i select all the stuff, and say convert to simbol->movie clip all the stuff colapses into one layer and the action script is gone. Let's say that the actionscript would be no problem but still i don't fancy the ideea of having to copy paste those shapes and carefully rearange them in there own layers in the new clip.If all you want is to use it in more projects, I would do this :
Select the frames that contain the menu. Right click and select "Copy frames".
Open a new .fla and right click the first frame, select "Paste frames".

Delete all the extra stuff you don't need, and save the .fla

Any time you want it, just copy the frames from that .fla to whatever project you're currently working on.Originally posted by Drakon
3. Ok, ok so my mind poped another question, just hope to be the last one or i'll never finish this post or i'll make u guys fall asleep reading:)
Sometimes if i tell a movie clip to go to _x=0 _y=0 it gets on the stage like it puts the center of that movie at those coords. And is true, i see that circle with a cross in the middle of that movie. Now i guess i could work around it and instead of seting _x=0 i could say _x=movie._width/2(if that works) -i rather do the math myself. But i found somewhere(can't seem to remember where) i think they were using an "allign layer"? didn't pay much attention to that. So is it posible to set something in the align pannel and not have to again move all things so that the little target like simbol to be in the upright corner?

Ok, thaks for reading, guys! Hmm.. Could this be what you're looking for?


Stage.align

Usage

Stage.align

Description

Property; indicates the current alignment of the Flash movie within the Stage.

The following table lists the values for the align property. Any value not listed here centers the movie in the Stage area.

Value Vertical Horizontal

"T" top center

"B" bottom center

"L" center left

"R" center right

"TL" top left

"TR" top right

"BL" bottom left

"BR" bottom right Yes/No?

Drakon
10-04-2003, 04:20 PM
Thanxs for answering, I've been very busy on some other project and the posted one was not able to steal a couple o'minutes from me. However I discovered the answer to my nr1 prb. All I needed to do was to create a movie clip and put the spawner button inside it. I then created a new layer and drew a square in it and converted it to a movie clip. In the action script I went along and duplicated the spawner and then i used the command setMask to the movie clip where the buttons were created in with the square movie clip as the mask. And... it worked perfectly....
About the align. Well I just want to align a darn movie clip say on the stage, say not even using actionscript. I want to place it at x=0 and y=0. But if i use the align menu and say align relative to stage to the left and up. It will place the movie clip half outside the scene because i can see that the movie clip has the "cross_and_circle" thingie in it's middle. And so it's normal if i say to align in the left upper corner to put the circle thingie in the left upper corner but i would want the circle thingie to be in the left corner of the movie clip so when it would be aligned none of the movie clip would be outside of the stage.