Note that there are some explanatory texts on larger screens.

plurals
  1. POmove in move out tween animation for group of movieclips using as3
    primarykey
    data
    text
    <p>I have set of 6 movieclips as array_0 and another set of 6 movieclips as array_1. It is like two choices for different screens. Both these arrays are nested in another array as all_array. all 12 movieclips are positioned to a same x and y at initial load and that is outside the visible stage. I would like to use two different global variables for indexing. for example, cCat_Sel which ranges from 0-5 and another cScr_Sel ranges from 0-1. cCat_Sel will be changed on a click event of six buttons separate objects on stage (each button for each category).</p> <p>so it will show the content for each category as per the value of cScr_Sel. if cScr_Sel is 0 then it will use all_array[0][cCat_Sel] to access the current target and similarly respective array for value of 1 as all_array[1][cCat_Sel]</p> <p>I have done all the work including all tween animations to move current target and make it visible. But the tween does not bring the second set of mcs to visible area. I have two functions one for movein and one for move out by using tween animation for mc.x property. every relevant click event; I have to move current mc out and make alpha 0 and once that is finished, move in new current target and make alpha 1.</p> <p>Somehow I have to combine these two tweens in one function. This is the part that I am stuck. or may be putting these mcs in two different arrays not a correct approach. I can easily achieve what I want on Enter Frame event of the root to check for cCat_Sel and cScr_Sel variables and do both animations one after the other but it seems like enter frame uses too much of cpu and makes it slower and probably not preferable.</p> <p>willing to try anybody's suggestions or guidance. Thanks in advance. I do not have any formal or informal programming education at all but I make things work by reading and trying out few things as per stackoverflow question and answers and sometime google. because most of my answers I have found from stack overflow. Update:</p> <pre><code> function fnSlideInOut(cMc:Object, pMc:Object){ var HideX:Number =650; var ShowX:Number = 0; if(cMc != null){ if(cMc.x != ShowX){ //cMc.alpha = 1; var SlideMcIn:Tween = new Tween(cMc, "x", Strong.easeOut, 650, ShowX, 0.5, true); SlideMcIn.addEventListener(TweenEvent.MOTION_FINISH, fnSlideInFinish); SlideMcIn.start(); } } if(pMc != null){ if(pMc.x != HideX){ //pMc.alpha = 1; var SlideMcOut:Tween = new Tween(pMc, "x", Strong.easeOut, 0, HideX, 0.5, true); SlideMcOut.addEventListener(TweenEvent.MOTION_FINISH, fnSlideOutFinish); SlideMcOut.start(); } } function fnSlideOutFinish(e:TweenEvent){ //SlideMcOut.obj.alpha = 0; SlideMcOut.removeEventListener(TweenEvent.MOTION_FINISH, fnSlideOutFinish); } function fnSlideInFinish(e:TweenEvent){ //SlideMcIn.obj.alpha = 1; SlideMcIn.removeEventListener(TweenEvent.MOTION_FINISH, fnSlideInFinish); } }//End Function fnSlideInOut(cScr_Sel, pScr_Sel); </code></pre> <p>I would like expert like you to comment on any kind of errors for the above code. It works 99 times but 1 time the movieclip either does not reach the destination or current and previous both targets showing and that too not where they are suppose to. This only happens when button click event happens in a quick succession. Thanks again</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload