# Basic ActionScripting (I would Imagine)

**URL:** https://forum.kirupa.com/t/basic-actionscripting-i-would-imagine/5044
**Category:** flash
**Created:** [August 29, 2002, 7:14pm UTC](https://forum.kirupa.com/t/basic-actionscripting-i-would-imagine/5044 "2002-08-29T19:14:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jOEL](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jOEL](https://forum.kirupa.com/u/jOEL)
#### Post date: [August 29, 2002, 7:14pm UTC](https://forum.kirupa.com/t/basic-actionscripting-i-would-imagine/5044/1 "2002-08-29T19:14:39Z")

</div>

I’m trying to make a button that plays a MC and has a value associated with it, so that when the MC instance plays it has a title that was determined by the button that was clicked.

The MC Instance name is “LinkBar”.  
In the MC LinkBar there is a Dynamic text Field which I’ve given the variable name “LinkName”.

So on rollOver of the button I set the variable “LinkName” and give it a value, Right?

Right now I have this actionscript on the button:

on (rollOver) {  
LinkName = “The Setup”;  
\_root.LinkBar.gotoAndPlay(“Down”);  
}  
on (rollOut) {  
\_root.LinkBar.gotoAndPlay(“Up”);  
}

What am I missing?

Any help would be tremendously appreciated,

jOEL

---

<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 29, 2002, 7:28pm UTC](https://forum.kirupa.com/t/basic-actionscripting-i-would-imagine/5044/2 "2002-08-29T19:28:36Z")

</div>

Try this…

```auto

on (rollOver) {
_root.LinkBar.LinkName = "The Setup";
_root.LinkBar.gotoAndPlay("Down");
}
on (rollOut) {
_root.LinkBar.LinkName = ""
_root.LinkBar.gotoAndPlay("Up");
}

```

The Link Name code in the rollOut will clear the Text Field. Otherwise it will say “The Setup” until you roll over another button.

---

<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 29, 2002, 7:33pm UTC](https://forum.kirupa.com/t/basic-actionscripting-i-would-imagine/5044/3 "2002-08-29T19:33:45Z")

</div>

That worked sweet!

I was close, just needed the “\_root.”

Thanx a bunch,

jOEL

---

<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 29, 2002, 7:35pm UTC](https://forum.kirupa.com/t/basic-actionscripting-i-would-imagine/5044/4 "2002-08-29T19:35:00Z")

</div>

No Problem. Glad I could help:)
