webForumDet fria alternativet

CSS i Flash

2 svar · 388 visningar · startad av thevice

theviceMedlem sedan dec. 2005198 inlägg
#1

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

mirandirMedlem sedan maj 2003750 inlägg
#2

Ä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

theviceMedlem sedan dec. 2005198 inlägg
#3

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

131 ms totalt · 3 externa anrop · v20260731065814-full.3ab8d573
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
128 ms — hämta tråd, inlägg och bilagor (db)