# \[FMX04\] Newbie needs AS2 help

**URL:** https://forum.kirupa.com/t/fmx04-newbie-needs-as2-help/266741
**Category:** flash
**Created:** [July 23, 2008, 10:26pm UTC](https://forum.kirupa.com/t/fmx04-newbie-needs-as2-help/266741 "2008-07-23T22:26:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![MalnuRulz](https://avatars.discourse-cdn.com/v4/letter/m/e5b9ba/32.png) [@MalnuRulz](https://forum.kirupa.com/u/MalnuRulz)
#### Post date: [July 23, 2008, 10:26pm UTC](https://forum.kirupa.com/t/fmx04-newbie-needs-as2-help/266741/1 "2008-07-23T22:26:50Z")

</div>

Hi all!

I am creating a navigational menu in flash and decided importing HTML with CSS formatting would be the easiest way to go. I took a GREAT tutorial called [Using CSS Styles in Flash MX 2004](http://www.kirupa.com/developer/mx2004/css2.htm) and got it all working well if I followed the instructions exactly.

The catch is that I need to import a second external .txt file (that uses the same CSS) because it needs 2 columns. I simply gave the new text box an instance name of “kirupa2” and duplicated the AS code provided in the tutorial. But when I did so, the first column disappeared.

I think it’s just an easy AS fix, so here’s the code:

```auto
var format = new TextField.StyleSheet();
var path = "flash.css";

format.load(path);
format.onLoad = function(loaded) {
    if (loaded) {
        output.styleSheet = format;
        
            myLoadVar = new LoadVars ();
            myLoadVar.load("kirupa.txt")
            myLoadVar.onLoad = function (success){
            
            if (success == true) {
            
            output.variable = "kirupa"
            output.htmlText=myLoadVar.kirupa;
            
            }
            
            }
        
    } else {
        output.text = "Error loading CSS file!";
    }
};
format.load(path);
format.onLoad = function(loaded) {
    if (loaded) {
        output2.styleSheet = format;
        
            myLoadVar = new LoadVars ();
            myLoadVar.load("kirupa2.txt")
            myLoadVar.onLoad = function (success){
            
            if (success == true) {
            
            output2.variable = "kirupa2"
            output2.htmlText=myLoadVar.kirupa2;
            
            }
            
            }
        
    } else {
        output.text = "Error loading CSS file!";
    }
};

```

You can view the movie as it stands [here](http://www.tpi-thevalueleader.com/newMovie.html).

Let me know if you need me to upload the .fla file!

Thank you in advance for you help!!!
