Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Data Integration / April 2005



Tip: Looking for answers? Try searching our database.

Loading CSS into Flash

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
johnny t - 22 Apr 2005 15:30 GMT
Hi,

Does anyones know how you load an external CSS file into a movie clip that's 2
MCs deep from the _root timeline?

I've managed to do it on the _root timeline, but it doesn't work when i'm in
the movie clips's timeline...

The XML loads in ok and the text field is called myText. The code below is on
frame 1 of the movie clip's timeline that's nested two MCs in from the _root.

Thanks in advance :)

Here's my code:

//init Text Field
myText.html = true;
myText.wordWrap = true;
myText.multiline = true;
myText.label.condenseWhite = true;
/******************************/
//load css
mapStyle = new TextField.StyleSheet();
mapStyle.load("map.css");
myText.styleSheet = mapStyle;
/******************************/
//load in XML
mapContent = new XML();
mapContent.ignoreWhite = true;
mapContent.load("south_africa.xml");
mapContent.onLoad = function(success) {
    if (success) {
        myText.text = mapContent;
    }
};
tomeanand@hotmail.com - 28 Apr 2005 08:02 GMT
hi johnny t
if you are changing your last piece of code to the following it will work
you have say htmlText instead of text
ie; myText.htmlText = "<p class=yourCSSClass>"+mapContent+"</p>"
or you can use the <span> tag also

/******************************/
//load in XML
mapContent = new XML();
mapContent.ignoreWhite = true;
mapContent.load("south_africa.xml");
mapContent.onLoad = function(success) {
    if (success) {
        myText.htmlText = "<p class=yourCSSClass>"+mapContent+"</p>"
       
    }
};

Anand
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.