# Load text from clicks

**URL:** <https://forum.kirupa.com/t/load-text-from-clicks/23426>\
**Category:** flash\
**Created:** [June 17, 2003, 8:24pm UTC](https://forum.kirupa.com/t/load-text-from-clicks/23426 "2003-06-17T20:24:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![beanboy](https://avatars.discourse-cdn.com/v4/letter/b/91b2a8/32.png) [@beanboy](https://forum.kirupa.com/u/beanboy)\
**Post date:** [June 17, 2003, 8:24pm UTC](https://forum.kirupa.com/t/load-text-from-clicks/23426/1 "2003-06-17T20:24:21Z")

</div>

Hi,

I have several buttons that load different jpegs onto the stage.

What I need to do then is display some text about the image. I want the buttons to set text variables like ‘date’ and ‘location’ that are then loaded into a dynamic text boxes on the stage. I suppose that it could be done by loading a dynamic \*.txt file but seems pointless for such short lines of text.

I have searched for this but found nothing, I am sure that it is easy but my head hurts.

Thanks,

---

<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 17, 2003, 8:31pm UTC](https://forum.kirupa.com/t/load-text-from-clicks/23426/2 "2003-06-17T20:31:26Z")

</div>

You can try something like this:[AS]on (release){  
myTextField.text = “location here”;  
}  
[/AS]

myTextField would be the variable given to the text box where you want the “locaction here” text to show up.

---

<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 17, 2003, 8:42pm UTC](https://forum.kirupa.com/t/load-text-from-clicks/23426/3 "2003-06-17T20:42:03Z")

</div>

Awesome,

I seems I was just missing the .text bit. How about this then, I have the text typeing out a la the infamous typewriter effect. But the text appears first then types out, as the variable is set then the function called. How could I hide it until the function is called, as I write this I am thinking visible = false.

I have attached the FLA for u to poke at.

Thanks

---

<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 18, 2003, 4:28am UTC](https://forum.kirupa.com/t/load-text-from-clicks/23426/4 "2003-06-18T04:28:03Z")

</div>

```auto
TextField.prototype.typeWriter = function(str, cps) {
	var index = 0, field = this, typer = function () {
		index<=str.length ? field.text=str.substr(0, index++) : clearInterval(init);
	}, init = setInterval(typer, 1000/cps);
};

```

```auto
on (release) {
	abc123.typeWriter("Once upon a time I wrote some working code", 24);
	def456.typeWriter("but not today", 24);
}

```
