ok, let me see if i have this straight.
1. when the user releases over (clicks on) one of your 36 clips, a separate clip is going to be relocated to a specific y loc. and each of the other 36 clips besides the one clicked on will be set to _visible = false
so in the on(release) or myClip_mc.onrelease function, you will do the following
myOnReleaseFunction = function(){
moveThatOtherClip (tothisYPosition);
makeAllClipsInTheArrayInvisible (exceptTheOneAtThisIndex);
delete thatFunctionThatDoesTheScrolloingStuff;
}
- myOnReleaseFunction = function(){
- moveThatOtherClip (tothisYPosition);
- makeAllClipsInTheArrayInvisible (exceptTheOneAtThisIndex);
- delete thatFunctionThatDoesTheScrolloingStuff;
- }
if that other clip is a self containted object, you use its moveThatOtherClipFunction, otherwise just set the ._y to what you want
if the code that does the scrolling is in event handler functions or any other function, then just delete it/them. and if you want to initiate it on another button click or something, then just redeclare it.
if it isn't in a function, but just attached to the timeline, you could put it in a function and then call that function from the frame you want it to start working. then you can delete it as above.
abnother idea is to declare a global variable called something like _global.ShowMyClips:Boolean;
and have your makeAllClipsInvisible function check this variable and set the visibility as above, or all to visible if showMyClips = true;
makeAllClipsInTheArrayInvisible = function (exceptionIndex){
for (var i = 0; i < myArray.length; i++ ){
if (i == exceptionIndex || showMyClips == true){
myArray[i]._visible = true;
} else {
myArray[i]._visible = false;
}
}
}
- makeAllClipsInTheArrayInvisible = function (exceptionIndex){
- for (var i = 0; i < myArray.length; i++ ){
- if (i == exceptionIndex || showMyClips == true){
- myArray[i]._visible = true;
- } else {
- myArray[i]._visible = false;
- }
- }
- }
notice that exceptionIndex is the clips location in the array, not necessarily the number at the end of its name.
notice that the for statement starts counting at zero. if your clips aren't just named starting at 1, but are actually in the array starting at 1, instead of 0, then change the for statement to:
for (var i = 1;i < myArray.length +1; i++){
and in your scrolling code, just check the showMyClips variable
function (or code)
if (showMyClips){
doScrollingStuff;
} else {
doNothingOrSomethingElse;
}
- if (showMyClips){
- doScrollingStuff;
- } else {
- doNothingOrSomethingElse;
- }
hope that helps