# Adding Movie actions to an XML mov - Sweet!

**URL:** <https://forum.kirupa.com/t/adding-movie-actions-to-an-xml-mov-sweet/51982>\
**Category:** programming\
**Created:** [May 19, 2004, 12:13am UTC](https://forum.kirupa.com/t/adding-movie-actions-to-an-xml-mov-sweet/51982 "2004-05-19T00:13:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjmancini](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@jjmancini](https://forum.kirupa.com/u/jjmancini)\
**Post date:** [May 19, 2004, 12:13am UTC](https://forum.kirupa.com/t/adding-movie-actions-to-an-xml-mov-sweet/51982/1 "2004-05-19T00:13:48Z")

</div>

Sorry for all the posts but obviously I am running into many small problems.

I have an XML menu where I attach XML text to dynamic text fields.

How can I add the following code which causes the mov to have a rollover function:

```auto
onLoad = function () { _root.m1.but._alpha = 20;};
Button.prototype.goPlay = function() {
	this.onRollOver = function() {
		newThis = this._parent;
		newThis.onEnterFrame = function() {
			if (this._alpha<100) {
				this._alpha += 15;
			}
		};
	};
	this.onRollOut = function() {
		oldThis = this._parent;
		oldThis.onEnterFrame = function() {
			if (this._alpha>50) {
				this._alpha -= 15;
			}
		};
	};
};
_root.m1.but.goPlay();

```

I think the problem is that it no longer finds

```auto
_root.m1.but.goPlay()

```

Because it is being Dynamically loaded.

Any help would be awesome! Thanks!
