Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Load css in flash...

This is a discussion on Load css in flash... within the Flash CS3 generale forums, part of the Flash CS3 e Actionscript 3.0 category; Code: //this.createTextField("news_txt", 99, 50, 50, 550, 400); news_txt.border = false; news_txt.html = true; news_txt.multiline = true; ...


Go Back   Forum Flash CS3 Flash CS4 > Flash CS3 e Actionscript 3.0 > Flash CS3 generale

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 30-09-08, 17:10
rickymas's Avatar
Junior Member
 
Join Date: Sep 2008
Location: Emilia-Romagna, Bologna.
Posts: 13
Rep Power: 0
rickymas is on a distinguished road
Send a message via MSN to rickymas
Load css in flash...

Code:
//this.createTextField("news_txt", 99, 50, 50, 550, 400);
news_txt.border = false;
news_txt.html = true;
news_txt.multiline = true;
news_txt.wordWrap = true;

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

// Location of CSS and text files to load.
var txt_url:String = "emails.htm";
var css_url:String = "html_styles.css";

// Define onLoad handler and Load CSS file.
styles.onLoad = function(success:Boolean):Void {
    if (success) {
        /* If the style sheet loaded without error, 
            then assign it to the text object, 
            and assign the HTML text to the text field. */
        news_txt.styleSheet = styles;
} else {
        trace("Unable to load CSS file.");
    }
};
styles.load(css_url);

// Define onData handler and load text to display.
myVars_lv.onData = function(src:String):Void {
    if (src != undefined) {
        news_txt.htmlText = src;
    } else {
        trace("Unable to load HTML file");
    }
};
myVars_lv.load(txt_url);
--------------------------------------------------------------------------------
Quello che è stato fatto è attribuire delle proprietà ad una textBox dinamica dove poi verrà caricata una pagina HTML che assumerà le regole css, ma non funziona come dovrebbe, perchè se imposto colore di sfondo per il body nel css, non si vede poi in flash, per esempio se voglio creare una box attorno a ciò che è racchiuso dai tag <p></p>, non si vede, ma viene solo preso il font del testo ed il colore di esso.
Dove sto sbagliando? Oppure flash non vede tutte le regole css da attribuire?
Grazie per qualsiasi risposta. PS.Gran bel sito, il top...FlepTop
--------------------------------------------------------------------------------
Vi posto il css.
Code:
body {
    background-color: #CCCCCC;
    font-size:18px;
}
p {
    color: #000000;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 12px;
    display: inline;
}


a:link {
    color: #FF0000;
    font-size: 14px;
}

a:hover{
    text-decoration: underline;
    
}

.headline {
    color: #000000;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 18px;
    font-weight: bold;
    display: block;
}

.byline {
    color: #666600;
    font-style: italic;
    font-weight: bold;
    display: inline;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 30-09-08, 18:56
Onsitus's Avatar
CSS.FlepStudio.org
 
Join Date: Jul 2007
Location: Nettuno Beach
Posts: 973
Rep Power: 2
Onsitus is on a distinguished road
Re: Load css in flash...

Ciao, poche regole css sono supportate...principalmente quelle del testo.

http://livedocs.adobe.com/flash/9.0_...=00002174.html
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 30-09-08, 22:15
rickymas's Avatar
Junior Member
 
Join Date: Sep 2008
Location: Emilia-Romagna, Bologna.
Posts: 13
Rep Power: 0
rickymas is on a distinguished road
Send a message via MSN to rickymas
Riferimento: Load css in flash...

ecco...proprio non avevo pensato di andare a spulciare la documentazione Adobe, grazie Onsitus per il link...ciao!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Actionscript 3 load unload swf skill83 Actionscript 3.0 base 0 06-11-08 10:11
Actionscript 3 How do I Load XML in external SWF? aloysiochagas advanced Actionscript 3.0 0 11-08-08 00:59
How to load a text file with Flash CS3 Flep Tutorials 10 27-06-08 02:43
Load Error for AS 3 swf Pherankh advanced Actionscript 3.0 8 22-04-08 18:41
load Movie Flasher111 HELP free utilities 5 02-11-07 19:53


All times are GMT. The time now is 17:21.


Powered by vBulletin versione 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406