MANDAR

Flash with CSS attachment

Posted in Flash Designer by Mandar on December 31, 2008

Using CSS
One of the first reasons I wanted to use because of cut of long, tedious and time consuming process.

First make CSS called “style.css”
Code Example

p {
font-family: Arial,Helvetica,sans-serif;
font-size: 12px;
}
.headline {
font-size: 14px;
font-weight: bold;
}

.bURL {
color: #000099;
text-decoration: underline;
}

.author {
text-align: right;
font-style: italic;
}

.errorMessage {
color: #CC0000;
font-weight: bold;
}

First function is to get the CSS stylesheet, parse it, and apply it to our text box. Select the first frame in your “Actions” layer and put the below in. This is straight out of the Flash help documents:

Action Script

function getNewsStyles() {
news_txt.text = “Getting news…”;
// load stylesheet first, then get content (separate function)
var flash_css = new TextField.StyleSheet();
flash_css.onLoad = function(success:Boolean) {
if (success) {
news_txt.styleSheet = flash_css;
getNewsContent();
} else {
news_txt.htmlText = “Could not load CSS stylesheet.”;
}
};
flash_css.load(“news_styles.css”);
};

Congratulations to Bharat Patel

Posted in Flash Designer by Mandar on December 31, 2008

Congratulations to Bharat Patel who become Adobe Certified Flex Developer.