# Set variable + Load to Text box?

**URL:** https://forum.kirupa.com/t/set-variable-load-to-text-box/22747
**Category:** flash
**Created:** [June 8, 2003, 1:24am UTC](https://forum.kirupa.com/t/set-variable-load-to-text-box/22747 "2003-06-08T01:24:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![awarlock](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@awarlock](https://forum.kirupa.com/u/awarlock)
#### Post date: [June 8, 2003, 1:24am UTC](https://forum.kirupa.com/t/set-variable-load-to-text-box/22747/1 "2003-06-08T01:24:39Z")

</div>

I have a button with instance name “MC1”.  
When you press the button i want it to display the text “[www.google.com](http://www.google.com)” into a text box.  
Then when you click on it. It will take u to [google.com](http://google.com)

The idea is that then i can have many buttons with different URL’s attatched to them. So user clicks button1 and it displays the URL for that button…

I have an idea that first you set the variable to be [google.com](http://google.com)  
on the button, then onPress you load it to the dyn textbox.  
But not too sure how to do this.

ANyone?:cowboy:

---

<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: [June 8, 2003, 5:28am UTC](https://forum.kirupa.com/t/set-variable-load-to-text-box/22747/2 "2003-06-08T05:28:02Z")

</div>

You wanted to get the button pressed twice right ?  
I’m not sure if you use Flash MX or Flash 5, but I’ll be explaining for Flash MX since I haven’t got any experience in Flash 5.

Ok, so the code for your button should be:  
[AS]  
on (release){  
url = “[http://www.google.com](http://www.google.com)”;  
if (\_root.path.dynamictextbox == url){  
getURL(url);  
} else {  
\_root.path.dynamictextbox = url;  
}  
}  
[/AS]

It would be something like this I guess. I couldn’t test it 'cause I aun’t got Flash on this pc so there might be an error in it. Anyway, it’s worth a try 🙂

---

<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: [June 8, 2003, 5:34am UTC](https://forum.kirupa.com/t/set-variable-load-to-text-box/22747/3 "2003-06-08T05:34:49Z")

</div>

There’s no need to crosspost :-\

---

<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: [June 8, 2003, 5:35am UTC](https://forum.kirupa.com/t/set-variable-load-to-text-box/22747/4 "2003-06-08T05:35:36Z")

</div>

sorry.  
:\*(
