This content has been marked as final. Show 14 replies
you can use actionscript to mask dynamically. check the setMask() method of movieclips.
Can't get it to work. This is supposed to show col3_mc but instead it hides it and all the other columns show.
Imagine there are 5 columns of movie clips on the stage | | | | |
each column containing 5 small images.
I only want the one column at position 2 (the second from the left) to show at any time. When it comes time for the others to show, they will be tweened on their _x to slide under the mask. I've been doing this successfully before trying the dynamic mc method. Either I get a mask that blots out everything on the stage except the column I want to show OR I blot out the column I want to show with everything else being visible including all the other columns.
each colum should be a child of the same parent. you can then mask the parent and if myMask_mc is "covering" col3_mc, col3_mc will be the only visible column.
okay, that makes sense. Suppose I have the following:
"thumbSet_mc" = the grandParent
"col1_mc" , "col2_mc" ,"col2_mc"etc. = the children of "thumbSet_mc"
"mc1, m2, mc3" etc = the grandChildren of "thumbSet_mc"
Does each clip have to be on a separate level? I.E can "thumbSet_mc" and its children "col1_mc, col2_mc etc." be on the same level?
This is the most perplexing thing, levels, ...what can exist on the same level? I'm thinking that disassociated (unrelated) mcs need a separate level but is seems that children should be on the same level as their parent. Else it would be like a "dysfunctional family"!
levels/depths make no difference when using actionscript to assign a mask. flash handles that for you.
when using the authoring environment to assign a mask, layers/depths do make a difference.
Ok. I make "thumbSet_mc" the parent of all.
This made all columns invisible.
I put the "matrixMask_mc" clip so it covered the col1_mc on the left of the stage. This made it visible, keeping the others invisible. The same "mask" both show AND hides objects. I guess that's what I had trouble with, as well as the use of [ ] within dot syntax.
Anyway I think I get it.
Thanks for your assistance once again
by changing matrixMask_mc's x property so it covers one column, you reveal that column and hide the others.
I've come across one more, hopefully final, glitch in this method:
thumbSet_mc.onRelease=function() // this works when I click on any of the columns
thumbSet_mc.col3_mc.onRelease=function() // this works when I click on the particular column targeted
thumbSet_mc.col3_mc.mc3.onRelease=function() // this doesn't work when I click on the individual target "mc3" or any of the grandchildren of thumbSet_mc.
Is it because I've loaded an image into the grandchild? That's the only difference between the 3 "generations".
thanks in advance for your help
will fail if:
1. there is a mouse handler defined for thumbSet_mc or thumbSet_mc.col3_mc or
2. you loaded something into one of those ancestors of mc3 AFTER defining the onRelease.
I don't think I've done either of the two you listed. My script is as follows:
Yes, but that comes before defining the onRelease doesn't it?
Ahhh! Okay I get it.
Not all images have loaded. The script runs ahead a little. A coule of extra frames or a Listener for the loadMovieClip.. yes, that's it.
I suppose I'll have ti set up some sort of polling procedure for the .onRelease() . I can't "hard wire" in every possibility of mc1... etc if there are 50-100 clips. Although I DO know which column is showing, so that narrows it down a little.
you can either use the onLoadInit() to determine when you can assign your onRelease handlers or even easier: load into a child of thumbSet_mc[thisColName][thisClipName] and leave your onRelease defined for the parent.