# If statements

**URL:** <https://forum.kirupa.com/t/if-statements/115402>\
**Category:** Uncategorized\
**Created:** [July 8, 2004, 6:42am UTC](https://forum.kirupa.com/t/if-statements/115402 "2004-07-08T06:42:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![reweb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/reweb/32/135_2.png) [@reweb](https://forum.kirupa.com/u/reweb)\
**Post date:** [July 8, 2004, 6:42am UTC](https://forum.kirupa.com/t/if-statements/115402/1 "2004-07-08T06:42:15Z")

</div>

I heve this code:

```php

_root.my.myw_b.onRelease = function() {
	if (yoyo = "1") {
		_root.sub_work.sub_work1.onEnterFrame = function() {
			this.nextFrame();}
		_root.sub_work.sub_work2.onEnterFrame = function() {
			this.nextFrame();}
		_root.sub_work.sub_work3.onEnterFrame = function() {
			this.nextFrame();}
		}
	 else {	
	
		_root.sub_just.sub_just_1.onEnterFrame = function() {
			this.prevFrame();}
		_root.sub_just.sub_just_2.onEnterFrame = function() {
			this.prevFrame();}
	}
};

```

what i need:

else statement work fine but in frame 1 of \_root.sub\_just.sub\_just\_1 i set the variable yoyo = 1; and I need to execute the if code only when \_root.sub\_just.sub\_just\_1 arrive at frame 1.

I need help :{
