Question
Tweening Font Size
I have a text field that is created by ActionScript, and it
brings in its content through an external html file. The content is
then styled by an external css file.
Later in the swf, this textField goes through an alpha tween using the Tween package, and it disappears. If possible, I'd like to cause this textField to tween in size as it tweens in alpha; so that it gets larger and fainter, and finally disappears. I know this is very easy without scripting, but my goal is to be able to stay as close to the existing code as possible.
Code that I'm using is as follows:
function writeMiddleHeader() {
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
// text field
headerMovieOne.createTextField("middleHeadingText", headerMovieOne.getNextHighestDepth(), 250, 75, 500, 184);
headerMovieOne.middleHeadingText.selectable = true;
headerMovieOne.middleHeadingText.html = true;
headerMovieOne.middleHeadingText.multiline = true;
headerMovieOne.middleHeadingText.wordWrap = true;
headerMovieOne.middleHeadingText.condenseWhite = true;
// glow filter
var myGlowFilter = new GlowFilter (0xffffff, 0, 0, 0, 0, 0, false,false);
// Applies the filter to the object
headerMovieOne.middleHeadingText.filters = [myGlowFilter];
// html file
var loadTheHTML:LoadVars = new LoadVars();
loadTheHTML.onData = function(stringData:String):Void {
headerMovieOne.middleHeadingText.htmlText = stringData;
};
cssStyles.onLoad = function(bSuccess:Boolean):Void {
if(bSuccess) {
headerMovieOne.middleHeadingText.styleSheet = this;
loadTheHTML.load("packages-middleheading.html");
}
};
// css file
cssStyles.load("/packages-styles.css");
};
I've used textFormatting in the past, but it's been a while. I'm assuming that I might have to remove the CSS styling from this text field, and style everything with textFormat instead. When I tried this, though, none of the formatting displayed in the movie. Is there a way, using as much of the current code as possible, that I can accomplish this tween?
Thanks!
Jon
Later in the swf, this textField goes through an alpha tween using the Tween package, and it disappears. If possible, I'd like to cause this textField to tween in size as it tweens in alpha; so that it gets larger and fainter, and finally disappears. I know this is very easy without scripting, but my goal is to be able to stay as close to the existing code as possible.
Code that I'm using is as follows:
function writeMiddleHeader() {
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
// text field
headerMovieOne.createTextField("middleHeadingText", headerMovieOne.getNextHighestDepth(), 250, 75, 500, 184);
headerMovieOne.middleHeadingText.selectable = true;
headerMovieOne.middleHeadingText.html = true;
headerMovieOne.middleHeadingText.multiline = true;
headerMovieOne.middleHeadingText.wordWrap = true;
headerMovieOne.middleHeadingText.condenseWhite = true;
// glow filter
var myGlowFilter = new GlowFilter (0xffffff, 0, 0, 0, 0, 0, false,false);
// Applies the filter to the object
headerMovieOne.middleHeadingText.filters = [myGlowFilter];
// html file
var loadTheHTML:LoadVars = new LoadVars();
loadTheHTML.onData = function(stringData:String):Void {
headerMovieOne.middleHeadingText.htmlText = stringData;
};
cssStyles.onLoad = function(bSuccess:Boolean):Void {
if(bSuccess) {
headerMovieOne.middleHeadingText.styleSheet = this;
loadTheHTML.load("packages-middleheading.html");
}
};
// css file
cssStyles.load("/packages-styles.css");
};
I've used textFormatting in the past, but it's been a while. I'm assuming that I might have to remove the CSS styling from this text field, and style everything with textFormat instead. When I tried this, though, none of the formatting displayed in the movie. Is there a way, using as much of the current code as possible, that I can accomplish this tween?
Thanks!
Jon