# Button with value

**URL:** <https://forum.kirupa.com/t/button-with-value/28253>\
**Category:** Uncategorized\
**Created:** [August 11, 2003, 9:06pm UTC](https://forum.kirupa.com/t/button-with-value/28253 "2003-08-11T21:06:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tast](https://avatars.discourse-cdn.com/v4/letter/t/a9a28c/32.png) [@tast](https://forum.kirupa.com/u/tast)\
**Post date:** [August 11, 2003, 9:06pm UTC](https://forum.kirupa.com/t/button-with-value/28253/1 "2003-08-11T21:06:59Z")

</div>

I´m totaly green to this Flash MX,- but i think great.  
However i have a problem that i hope i can get a solution to.  
Who ever that may answer me has to REALLY SPELL IT OUT,- cause i may not know what is genneraly obvious.

Okay here for the description.

I have 2 buttons that when they a pressed play the movie called"Brag"(containing a circle that end up beeing big)  
After playing the movie sequence i want it display some text, so if you played button 1 you´ve gonna get a text(on top of the “Brag”), and if you pushed button 2 you get another text …

This is what i have done:

## This is the action for the button: on (press) {gotoAndStop(2);(this is the frame with the “Brag” button==1; }

## on (press) {gotoAndStop(2);(this is the frame with the “Brag” button==2; }

In the end of the movie called “Brag” i have putted a action with this:  
stop();  
if (button==1) {\_root.gotoAndPlay(3);(this is the frame for “text 1”)  
}  
else if (button==2)  
{\_root.gotoAndPlay(4);(this is the frame for “text 2”)

}

The problem is that it Will show the “brag” movie when a button is pressed,- but then it just stop,- and it seems that it can´t figure out the button value, part…

Hope that anyone would help me…thank´s

(if anyone want the file just say so.)

---

<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:** [August 11, 2003, 9:21pm UTC](https://forum.kirupa.com/t/button-with-value/28253/2 "2003-08-11T21:21:48Z")

</div>

If you post the fla I think i can help. can you also try explaining your problem again, im not sure i understood

---

<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:** [August 11, 2003, 9:51pm UTC](https://forum.kirupa.com/t/button-with-value/28253/3 "2003-08-11T21:51:42Z")

</div>

press Button 1 or 2

If button 1 then goto movie “Brag” play it, and then goto “Scene 1” frame 3

If button 2 then goto movie “Brag” play it and then goto “Scene 1” frame 4

Hope this is better

---

<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:** [August 11, 2003, 10:10pm UTC](https://forum.kirupa.com/t/button-with-value/28253/4 "2003-08-11T22:10:42Z")

</div>

ok give me a couple of minutes

---

<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:** [August 11, 2003, 10:18pm UTC](https://forum.kirupa.com/t/button-with-value/28253/5 "2003-08-11T22:18:08Z")

</div>

Your problem was you were using a logical operator to try and assign a value. AKA. you said knap == 3 when you wanted to say knap = 3.

---

<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:** [August 11, 2003, 10:20pm UTC](https://forum.kirupa.com/t/button-with-value/28253/6 "2003-08-11T22:20:25Z")

</div>

Dahhhhhhhh,- okay 1001 thanks…  
if you knew how long time i have been looking at this…

Great

---

<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:** [August 11, 2003, 10:23pm UTC](https://forum.kirupa.com/t/button-with-value/28253/7 "2003-08-11T22:23:55Z")

</div>

🙂 glad to help
