Join Login


Video Tutorials
Blog



Stock Photos from 123RF

Label Component


By: RiverCityGraphix      Views: 2628      Share: Bookmark and Share

In this tutorial, you will learn how to use the Label Component in Flash CS4.

The label component can be very helpful in Flash. It can be easily used to bring in Dynamic information regarding photos or other objects. The label component is typically a one line object than can be customized to display text in any desired format. If you prefer to use the dynamic text box, it can do the same things. For the most part, this component is easy to use and set up. Good luck using it in your projects.

ActionScript 3.0
mylabel.textField.background = true;
mylabel.textField.backgroundColor = 0xDDDDDD;
mylabel.text = "Please Select an Image";

water.addEventListener(MouseEvent.CLICK, watertxt);
flowers.addEventListener(MouseEvent.CLICK, flowerstxt);
tomato.addEventListener(MouseEvent.CLICK, tomatotxt);
fox.addEventListener(MouseEvent.CLICK, foxtxt);

function watertxt (event:MouseEvent):void{
mylabel.htmlText = "<b>These rapids look dangerous!</b>";
}
function flowerstxt (event:MouseEvent):void{
mylabel.text = "These look pretty.";
}
function tomatotxt (event:MouseEvent):void{
mylabel.htmlText = "<a href='http://www.rivercitygraphix.com'><u>These look very delicious.</u></a>";
}
function foxtxt (event:MouseEvent):void{
mylabel.text = "The fox is crossing the road.";
}




Free Source Files Zip

Adobe Education Store