# Problems with if statement

**URL:** <https://forum.kirupa.com/t/problems-with-if-statement/34358>\
**Category:** Uncategorized\
**Created:** [October 31, 2003, 9:47pm UTC](https://forum.kirupa.com/t/problems-with-if-statement/34358 "2003-10-31T21:47:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mucho](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@mucho](https://forum.kirupa.com/u/mucho)\
**Post date:** [October 31, 2003, 9:47pm UTC](https://forum.kirupa.com/t/problems-with-if-statement/34358/1 "2003-10-31T21:47:56Z")

</div>

Hello again,

is something like this possible?

if (\_root.count2 == “europe”) {  
\_root.gotoAndPlay(“contactscene2.home.europe”);  
}

contactscene2 is a scene  
home is a mc  
and europe is name of a framelabel,

doesn’t won’t to work here…

puzzle puzzle puzzle

m.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 9:52pm UTC](https://forum.kirupa.com/t/problems-with-if-statement/34358/2 "2003-10-31T21:52:43Z")

</div>

\_root.contactscene2.home.gotoAndPlay(“europe”)

=) works ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 9:53pm UTC](https://forum.kirupa.com/t/problems-with-if-statement/34358/3 "2003-10-31T21:53:43Z")

</div>

Try \_root.home.gotoAndPlay(“europe”)

Can you attach files so we can see how it is set up? That would help.

[edit]mlk: You can’t target scenes like that since they are not symbols[/edit]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 9:54pm UTC](https://forum.kirupa.com/t/problems-with-if-statement/34358/4 "2003-10-31T21:54:09Z")

</div>

gracias amigo!  
I knew it was something simply like that!!! argl  
m.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 10:02pm UTC](https://forum.kirupa.com/t/problems-with-if-statement/34358/5 "2003-10-31T22:02:55Z")

</div>

The file is rather big…but I can make screenshots would that help?!

m.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 10:39pm UTC](https://forum.kirupa.com/t/problems-with-if-statement/34358/6 "2003-10-31T22:39:46Z")

</div>

here we go, I stripped the file, so hopefully this still will make sense now.

thx,

m.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 10:45pm UTC](https://forum.kirupa.com/t/problems-with-if-statement/34358/7 "2003-10-31T22:45:53Z")

</div>

Ok, well I would of needed both scenes, but I have an idea.

Frame 1 of this scene with the home clip, add these actions…

[AS]home.gotoAndPlay(\_global.what);[/AS] Also right click on that frame and open the properties then give it a frame label of “contact”. Then your if statement would go something like this [AS]if (\_root.count2 == “europe”) {  
\_global.what = “europe”;  
\_root.gotoAndPlay(“contact”);  
}[/AS] That will assign the value of “europe” to the \_global variable we called what (\_global variables save on having to target) and then it will gotoAndPlay the frame with the frame label of “contact” (Flash isn’t go great with targetting scenes for gotoAndPlay, but frame labels work just peachy) And then on that frame you will gotoAndPlay the frame label that is contained the \_global.what variable.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 11:04pm UTC](https://forum.kirupa.com/t/problems-with-if-statement/34358/8 "2003-10-31T23:04:08Z")

</div>

ok, here is what I did…

but (for explanatory reasons) what I’m trying to do…

I have this contact scene. One part of the navigation tells the home mc to go to different positions and hsow different content. But to have smooth transitions while navigating somewhere else, I want the home mc to play the animation back to its original point so it can go smoothly to the content.

Then there is another part of the navigation, which should tell the home mc to play the current animation to the end, and then play to a transition part for another scene…

m.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 11:08pm UTC](https://forum.kirupa.com/t/problems-with-if-statement/34358/9 "2003-10-31T23:08:08Z")

</div>

Ok, so if I understand correctly, remove [AS]home.gotoAndPlay(\_global.what);  
[/AS] from Frame 1 of the contact scene and slap [AS]this.gotoAndPlay(\_global.what);[/AS] on frame 15 inside the home clip. That way when that frame gets reached it will then gotoAndPlay the proper frame label. 😉

BTW: Love the look and feel of this :thumb:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [October 31, 2003, 11:17pm UTC](https://forum.kirupa.com/t/problems-with-if-statement/34358/10 "2003-10-31T23:17:57Z")

</div>

I am so darn confused now…(been sitting in front of the screen since 8h)…but I think this is the way to go! I have to experiment a little more with it and then see how I can work this out…

thanks a lot,

m.

btw. glad you like the look and feel, I hope I can finished it any time soon… but you can have sneak preview here. [www.muchostylez.com/.draft](http://www.muchostylez.com/.draft)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 1, 2003, 3:21am UTC](https://forum.kirupa.com/t/problems-with-if-statement/34358/11 "2003-11-01T03:21:12Z")

</div>

Very nice, I like it 🙂

I hope everything works out for you.
