# On(release) dilemma.......? Help Please!

**URL:** https://forum.kirupa.com/t/on-release-dilemma-help-please/184014
**Category:** Uncategorized
**Created:** [March 31, 2006, 10:53pm UTC](https://forum.kirupa.com/t/on-release-dilemma-help-please/184014 "2006-03-31T22:53:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Flash\_Boi](https://avatars.discourse-cdn.com/v4/letter/f/b5ac83/32.png) [@Flash\_Boi](https://forum.kirupa.com/u/Flash_Boi)
#### Post date: [March 31, 2006, 10:53pm UTC](https://forum.kirupa.com/t/on-release-dilemma-help-please/184014/1 "2006-03-31T22:53:01Z")

</div>

Hi there everyone!

My dilemma is this, upon on(release) of the dpmoreinfonext\_btn it displays my external text file dpmoreinfo.txt in the dynamic text field dpmoreinfo\_txt. Now I would like to be able to apply a style sheet so that I can control the look of my text in file dpmoreinfo.txt.

My ActionScript is on the actual button dpmoreinfonext\_btn:

on(release) {  
loadText = new LoadVars();  
loadText.load(“dpmoreinfo.txt”);  
loadText.onLoad = function(success) {  
if (success) {  
//trace (success)  
dpmoreinfo\_txt.html = true;  
dpmoreinfo\_txt.htmlText = this.dpmoreinfopage;  
}  
};  
}

How would I incorporate the actionscript to load my courses.css file into my current code ?

---

<div class="post-metadata">

### Author: ![therafiman](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@therafiman](https://forum.kirupa.com/u/therafiman)
#### Post date: [March 31, 2006, 11:24pm UTC](https://forum.kirupa.com/t/on-release-dilemma-help-please/184014/2 "2006-03-31T23:24:17Z")

</div>

on(release) {  
loadText = new LoadVars();  
myCSS = new StyleSheet();

myCSS.load(“courses.css”);  
loadText.load(“dpmoreinfo.txt”);

loadText.onLoad = function(success) {  
if (success) {  
//trace (success)  
dpmoreinfo\_txt.html = true;  
dpmoreinfo\_txt.htmlText = this.dpmoreinfopage;  
}  
};

myCSS.onLoad = function(success) {  
if(success) {  
dpmoreinfo\_txt.styleSheet = myCSS;  
}  
};

}
