---
title: "CSS i Flash"
type: "forum-thread"
url: "https://www.webforum.nu/amne/flash/145195-css-i-flash"
topic: "Flash"
topic_url: "https://www.webforum.nu/amne/flash"
author: "thevice"
published: "2006-04-07T13:58:52.000Z"
updated: "2006-04-08T09:48:39.000Z"
replies: 2
views: 405
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/flash/145195-css-i-flash"
---

# CSS i Flash

## #1 — thevice, 2006-04-07T13:58Z

Hej, har nu försökt att fixa så att CSS fungerar i flash, men det vill inte fungera för mig = min variabel laddas inte in i textfältet. Vad gör jag för fel? 

Min variabel heter profil i ASP dokumentet, och mitt textfält heter profil också. Kod:

```
// Create a new style sheet and LoadVars object
var myVars:LoadVars = new LoadVars();
var styles = new TextField.StyleSheet();

// Location of CSS and text files to load
var txt_url = " http://v3.booring.se/flash_variabler.asp";
var css_url = " http://v3.booring.se/inc/style.css";

// Load text to display and define onLoad handler
myVars.load(txt_url);
myVars.onData = function(content) {
    storyText = content;
};

// Load CSS file and define onLoad handler:
styles.load(css_url);
styles.onLoad = function(ok) {
    if (ok) {
        // If the style sheet loaded without error,
        // then assign it to the text object,
        // and assign the HTML text to the text field.
        profil.styleSheet = styles;
        profil.text = storyText;
    }
};
```

 

\# Timmie G

Permalänk: https://www.webforum.nu/p/145195

## #2 — mirandir, 2006-04-08T08:32Z

Är variablen storyText definerad utanför "myVars.onData" ?

T.ex:

```
[b]var storyText = "";[/b]

// Create a new style sheet and LoadVars object
var myVars:LoadVars = new LoadVars();
var styles = new TextField.StyleSheet();

// Location of CSS and text files to load
var txt_url = " http://v3.booring.se/flash_variabler.asp";
var css_url = " http://v3.booring.se/inc/style.css";

// Load text to display and define onLoad handler
myVars.load(txt_url);
myVars.onData = function(content) {
    storyText = content;
};

// Load CSS file and define onLoad handler:
styles.load(css_url);
styles.onLoad = function(ok) {
    if (ok) {
        // If the style sheet loaded without error,
        // then assign it to the text object,
        // and assign the HTML text to the text field.
        profil.styleSheet = styles;
        profil.text = storyText;
    }
};
```

/Mirandir

Permalänk: https://www.webforum.nu/p/1794810

## #3 — thevice, 2006-04-08T09:48Z

Jag fick änra lite i koden för att det skulle fungera att ladda in flash filen. Men när jag väl fick det att fungera så visar det sig att onmousover inte fungerar i flash? Eller går det att lösa?
Eftersom at jag laddar in helalänkar in i flsahen så kan jag inte använda on(rollover):
tex, \<a href="a" class="b"\>c\</a\>

\# Timmie G

Permalänk: https://www.webforum.nu/p/1794830

---

Tråden på webben: https://www.webforum.nu/amne/flash/145195-css-i-flash
