# From on (release) to onRelease (Help needed)

**URL:** <https://forum.kirupa.com/t/from-on-release-to-onrelease-help-needed/171364>\
**Category:** Uncategorized\
**Created:** [December 4, 2005, 9:36pm UTC](https://forum.kirupa.com/t/from-on-release-to-onrelease-help-needed/171364 "2005-12-04T21:36:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![theveils](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@theveils](https://forum.kirupa.com/u/theveils)\
**Post date:** [December 4, 2005, 9:36pm UTC](https://forum.kirupa.com/t/from-on-release-to-onrelease-help-needed/171364/1 "2005-12-04T21:36:31Z")

</div>

Hello around:}

I need some help about action script code of a button

I’ve an old **on (release)** command, and i would like to go with **AS2** now. But I can’t succeed in making this work out with the **btn.onRelease** = fonction(); command.

I’ve a **[color=Blue]stylesheet [/color]**([color=SeaGreen] **stylesheet.css** [/color]), a dynamic variable **[color=Blue]pageGalleryHTML[/color]** from a .txt file (**[color=SeaGreen]multimedia.txt[/color]**).  
The content field is nammed **[color=DarkOrange]TextBox[/color]**, Here is my current button code:

```auto
on (release) {
  var myCSS = new TextField.StyleSheet();
  var cssURL = "stylesheet.css";
  myCSS.load(cssURL);
  myloadVarsText = new LoadVars();
  myloadVarsText.load("multimedia.txt");
  myloadVarsText.onLoad = function(success) {
	 if (success) {
		 TextBox.styleSheet = myCSS;
		 TextBox.html = true;
		 TextBox.htmlText = this.pageGalleryHTML;
		} else {
			trace("not loaded");
		}
	};
}

```

Please help me(-:
