Develop PHP Website for Learning Web Design Free Online
  Home   |   Forums   |   DevCMS
  Join   |   Log In
 
   

Flash and ActionScript 3 Tutorials - Learn Flash and ActionScript 3

Tutor at Develop PHP
CSS styling a Flash dynamic website Actionscript 3.0 html Text tutorial CS3+4
By: Adam      Created: Mar 11, 2009      Views: 18135 Tweet This Page  Post page to Facebook  Post page to Facebook

Download Source Files


In this Flash ActionScript 3.0 tutorial suitable for Flash CS3 or CS4 you can learn how to load an external CSS style sheet to allow a dynamic text field in flash to be affected by it. A few code considerations must be met which enable the text field to properly render the CSS styles you set in the external file,and we address them in the video. There are several ways you can go about using CSS in your flash text fields... use an external file like we did in this example... set the styles directly in actionscript and do away with the need for an external CSS file... but you can choose the method that is right for you.




ActionScript 3.0 Code Reference Actionscript 3.0 Tutorial - Learn Actionscript 3.0

var cssLoader:URLLoader;
var myText:String = "<P>Paragraph style in the external css file</P><BR>"
+ "Regular line of text, not styled.<BR>"
+ "<SPAN class=myTextStyle1>This is style 1 from external css</SPAN><BR>"
+ "<SPAN class=myTextStyle2>This is style 2 from external css</SPAN>";

function cssLoadComplete(event:Event):void {

var sheet:StyleSheet = new StyleSheet();
sheet.parseCSS(cssLoader.data);
myTextField.styleSheet = sheet;
myTextField.htmlText = myText;
}

var myTextField:TextField = new TextField();
myTextField.width = 500;
myTextField.multiline = true;
myTextField.wordWrap = true;
addChild(myTextField);

var req:URLRequest = new URLRequest("myStyleSheet.css");
cssLoader = new URLLoader();
cssLoader.addEventListener(Event.COMPLETE, cssLoadComplete);
cssLoader.load(req);




Comment on CSS styling a Flash dynamic website Actionscript 3.0 html Text tutorial CS3+4

Search Tags:
css   ·  file   ·  external   ·  design   ·  text   ·  html   ·  download   ·  website   ·  free   ·  tutorial   ·  video   ·  flash   ·  as3   ·  learn   ·  how   ·  tutorial   ·  create   ·  make   ·  source   ·  edit   ·  free   ·  actionscript   ·  3.0   ·  cs3   ·  cs4   ·  custom   ·  online   ·  script   ·  code   ·  site   ·  build   ·  
 
 
Arbitrary Links and Archives
Home
Active Forums
Members
SIte News
Link To Us
Gear
2009 Forum Archive
Programming Courses
Learn HTML
Learn CSS
Learn PHP
Learn MySQL
Learn Javascript
Learn jQuery
Learn ActionScript 3.0
Learn Java
Learn XML
DevelopPHP Requires Flash Player
Get Adobe Flash player
___________________________________________

Terms of Use  •  Privacy  •  Admin Notes

©2010 developphp.com   |   Powered By FlashBuildingHolder