Hi all,
I got some help here from Charleh here earlier but am syuck on another problem and have no idea why?
I have my main FLA with a doc class of Main. The following imports some nav sprites from the Main class and does load the MainText class (traces the ‘done’ at the end of it) but doesn’t actually add the text - any help here would be much appreciated!
(happy weekend to you all!)
Main.as:
[COLOR=darkred][SIZE=1]package {
import flash.display.Sprite;
import flash.display.MovieClip;
public class Main extends Sprite {
public function Main():void {
doBuild();
var mainText = new MainText();
}
public function doBuild():void {
var Navigation2:Sprite=new rightPanel2();
addChild(Navigation2);
var Navigation:Sprite=new rightPanel();
addChild(Navigation);
}
}
}[/SIZE][/COLOR]
The MainText.as:
[COLOR=darkred][SIZE=1]package {
import flash.display.MovieClip;
import flash.text.*;
public class MainText extends MovieClip {
public function MainText() {
var css:StyleSheet = new StyleSheet();
var body:Object = new Object();
body.fontFamily = “Verdana”;
body.textIndent = 0;
var heading:Object = new Object();
heading.fontSize = 16;
heading.textIndent = 0;
heading.leading = 10;
heading.letterSpacing = 0;
heading.fontWeight = “bold”;
heading.color = “#333333”;
heading.textAlign = “center”;
var byline:Object = new Object();
byline.fontSize = 14;
byline.leading = 20;
byline.fontStyle = “italic”;
byline.textAlign = “right”;
css.setStyle(".heading", heading);
css.setStyle(".byline", byline);
css.setStyle(“body”, body);
var txtFld:TextField = new TextField();
txtFld.x =830;
txtFld.y =10;
txtFld.width = 100;
txtFld.multiline = true;
txtFld.wordWrap = true;
txtFld.selectable = false;
txtFld.embedFonts = true;
txtFld.autoSize = TextFieldAutoSize.LEFT;
txtFld.styleSheet = css;
txtFld.htmlText = “<body>”;
txtFld.htmlText += “<span class=‘heading’>Text</span>”;
txtFld.htmlText += “</body>”;
addChild(txtFld);
trace(“done”);
}
}
}[/SIZE][/COLOR]