# Calling Functions From Within An If Statement

**URL:** <https://forum.kirupa.com/t/calling-functions-from-within-an-if-statement/228175>\
**Category:** flash\
**Created:** [June 5, 2007, 9:37pm UTC](https://forum.kirupa.com/t/calling-functions-from-within-an-if-statement/228175 "2007-06-05T21:37:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajmedway](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ajmedway/32/3704_2.png) [@ajmedway](https://forum.kirupa.com/u/ajmedway)\
**Post date:** [June 5, 2007, 9:37pm UTC](https://forum.kirupa.com/t/calling-functions-from-within-an-if-statement/228175/1 "2007-06-05T21:37:50Z")

</div>

Hi all,

I posted earlier about a preloader sticking, but beat around the bush a bit - my problem has been narrowed down and it is simply this:

while the condition of a if statement is true, as in the following hypothetical example, will it keep executing that code continuously until the condition somehow becomes false?

i.e. - will it keep trying to load the photo into the [COLOR=green]photo\_movieClip [/COLOR][COLOR=black]instance continuously until the condition is false?[/COLOR]

```auto

[COLOR=blue]if[/COLOR] (*condition == true*) {[INDENT][COLOR=green]photo_movieClip[/COLOR].loadPhoto(image*); [COLOR=red]//send image from array to load into photo_mc[/COLOR]*[/INDENT]
*};*

```

\*…If so, how can i make it call that function only once even if the condition _remains_ true?
