# Stopping a function and return back to same position - help needed

**URL:** <https://forum.kirupa.com/t/stopping-a-function-and-return-back-to-same-position-help-needed/260424>\
**Category:** flash\
**Created:** [May 15, 2008, 2:13pm UTC](https://forum.kirupa.com/t/stopping-a-function-and-return-back-to-same-position-help-needed/260424 "2008-05-15T14:13:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramamoorthi21](https://avatars.discourse-cdn.com/v4/letter/r/96bed5/32.png) [@ramamoorthi21](https://forum.kirupa.com/u/ramamoorthi21)\
**Post date:** [May 15, 2008, 2:13pm UTC](https://forum.kirupa.com/t/stopping-a-function-and-return-back-to-same-position-help-needed/260424/1 "2008-05-15T14:13:00Z")

</div>

Any one pls help ,

Friends i have a function in that movieclips color will change according to time  
what i need is if a specific action occurs say pressing a button (poweroff) or if the value of x==1; the function should be stopped where it is …

if i press some other button say poweron the function should start again from the same place…

Note: there is only one frame and stoping the movieclip like mc.stop(); not working in this case, return and killfunction completely get me out from the function.

[COLOR=“Red”]**function fadeArrayTrans(){  
//trace(“hai”);  
myCO = new Color(\_root.lightsholder1.examplered1.SomeImageClip);  
myCO.fadeTransform(transArray[lastTransArray], 3750, fadeArrayTrans);  
lastTransArray++;  
//return;  
lastTransArray%=transArray.length;  
}**[/COLOR]

transArray = [];  
transArray[0]={ra:100, rb:255, ga:100, gb:255, ba:100, bb:255, aa:100, ab:0};  
transArray[1]={ra:100, rb:0, ga:100, gb:255, ba:100, bb:100, aa:100, ab:0};  
transArray[2]={ra:100, rb:0, ga:100, gb:255, ba:100, bb:0, aa:100, ab:0};  
transArray[3]={ra:100, rb:0, ga:100, gb:255, ba:100, bb:255, aa:100, ab:0};  
transArray[4]={ra:100, rb:0, ga:100, gb:0, ba:100, bb:255, aa:100, ab:0};  
transArray[5]={ra:100, rb:255, ga:100, gb:0, ba:100, bb:255, aa:100, ab:0};  
transArray[6]={ra:100, rb:255, ga:100, gb:0, ba:100, bb:70, aa:100, ab:0};  
transArray[7]={ra:100, rb:255, ga:100, gb:40, ba:100, bb:100, aa:100, ab:0};  
lastTransArray = 0;

i have pasted small part of the code which may give idea about my problem. if you insist friends , i will post full script

Thanks in Advance :ear:
