PDA

View Full Version : New Text and CSS Features export to FP6


Scottae
12-13-2003, 06:38 PM
Does anyone know if it's possible to do something like this (http://www.dynamicflash.co.uk/flash7/stylesheet.html) in Flash MX 2004 and export it to Flash 6 player and have it function properly? ???

dv8
12-18-2003, 05:18 PM
Your refering to loading an external CSS I'm guessing.
Yes it is possible, but very extensive code written would need to be done.

There is a product called DENG Factory 3.0 (http://mozquito.markuplanguage.net/) that is capable of interpreting CSS.

Of course you could do it yourself, but it gets pretty hairy... a lot of what if's to worry about.

Very Rough Example:

// External CSS test.css
.art_body {
font: normal 10pt Verdana, Arial, Helvetica, sans-serif;
color: #000000;
text-decoration: none;
}
.art_hdln {
font: bold normal 9pt Verdana, Arial, Helvetica, sans-serif;
color: #000033;
text-decoration: none;
}



CSSParse = function (data) {
this._massURLEncodedCSSJunk = unescape(data);
this.findAllClassNames();
}
// Chop up sloppy string and parse css class names
CSSParse.prototype.findAllClassNames = function () {
this._classNamesList = new Array();
var foundClassLine = [];
createTextField("display", 1, 0, 0, 550, 400);
display.text = this._massURLEncodedCSSJunk;
var breakJunk= this._massURLEncodedCSSJunk.split("\r");
for (var x=0; x<breakJunk.length; x++) {
var junkLine = breakJunk[x];
if (junkLine.indexOf(".") != -1) {
trace(junkLine);
foundClassLine.push(junkLine);
}
}
for (var i=0; i<foundClassLine.length; i++) {
var end = foundClassLine[i].lastIndexOf("{");
this._classNamesList[i] = foundClassLine[i].substr(1, (end-2));
}
}
// Return CSS class names list
CSSParse.prototype.getStyles = function () {
return this._classNamesList;
}

// LoadVars as simple file handler
lv = new LoadVars();
lv.onLoad = function (successful) {
if (successful) {
delete this.onLoad;
t = new CSSParse(this.toString());
trace(t.getStyles());
}
}

lv.load("test.css");

Scottae
12-18-2003, 05:41 PM
I was actually wondering if someone with MX 2004 were using those new features of embedding image in text fields, using CSS to format text, etc......is it possible to export that as Flash 6 player? I don't have 2004 so I can't test it out. I ask because I know there were some methods and functions that were only in Flash 5+ that could be exported as Flash 4 and those newer methods and functions would still work.

Tulrin
01-06-2004, 02:47 PM
No it is not. The best way to tell if something will not work is to avoid using any ActionScript 2.0 since that will not work in Flash 6.

If you look at the ActionScript reference it will tell you if it is available for Flash 6. The CSS features are not available for the Flash 6 player so when you do a "save as" from Flash MX 2004 it will tell you that you will lose some functionality if you save it as a Flash 6 movie.

Generally if you save from FlashMX 2004 as a Flash MX file it will at the very least tell you that you will lose Unicode data. If you used any Actionscript 2.0 it will tell you that you are losing that as well.

If you simply publish a Flash MX 2004 movie and set the version to "Flash Player 6" the ActionScript 2.0 code will not work. The CSS that you are importing will simply do nothing but Flash will not warn you that some functionality will not work.

Scottae
01-06-2004, 04:24 PM
Cool....thx :)