# Dynamic condition in a loop

**URL:** <https://forum.kirupa.com/t/dynamic-condition-in-a-loop/314885>\
**Category:** flash\
**Created:** [October 11, 2010, 9:59pm UTC](https://forum.kirupa.com/t/dynamic-condition-in-a-loop/314885 "2010-10-11T21:59:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgst](https://avatars.discourse-cdn.com/v4/letter/b/f6c823/32.png) [@bgst](https://forum.kirupa.com/u/bgst)\
**Post date:** [October 11, 2010, 9:59pm UTC](https://forum.kirupa.com/t/dynamic-condition-in-a-loop/314885/1 "2010-10-11T21:59:21Z")

</div>

Hello everybody! My first post in here and I must warn you that I’m a N00b:sailor:

I have a loop in a function which condition depends on some variables a,b,c and d. I would like to change that condition depending on where the function is called from. Would it be possible to assign those conditions to a variable (string maybe)?

Like this

function varcon():void{  
while (conditionVar){  
a=…  
b=…  
blah blah  
}  
…  
conditionVar= “a==0 && b==0”;  
varcon();  
…  
conditionVar= “a==0 || b==0”;  
varcon();
