Irridessa
03-21-2010, 09:46 PM
i need to change the color in an external format from within the actionscript layer. all the myFormat things are for the external txt but none of it works. this is what i need to do:
Create a variable of a TextFormat object
called "myFormat":
create a TextField object called "myFormat" using the TextFormat constrictor
Create a TextFormat object called "myFormat"
Modify the TextFormat attributes of
"myFormat" to specify these values for the
following properties:
Set the font face to "Verdana" (.font Property)
Set the font point size to 10 (.size Property)
width (.width Property)
Set the font color to Blue (.color Property and using the proper format of the hex value 0x, zero and lowercase x)
height (.height Property)
Set the letter spacing to 1 pixel (.letterSpacing Property)
------ here is the script on my actions layer:::
var myFormat: TextFormat = new TextFormat();
var external_txt:TextField = new TextField();
var externalReq:URLRequest = new URLRequest("external.txt");
var externalLoad:URLLoader = new URLLoader();
myFormat.font = "Verdana";
myFormat.size = 10;
myFormat.color = 0x00FF00;
myFormat.letterSpacing = 1;
external_txt.setTextFormat(myFormat);
externalLoad.load(externalReq);
externalLoad.addEventListener(Event.COMPLETE, textReady);
up_btn.addEventListener(MouseEvent.CLICK, scrollUp);
down_btn.addEventListener(MouseEvent.CLICK, scrollDown);
external_txt.x = 175;
external_txt.y = 100;
external_txt.border = true;
external_txt.width = 200;
external_txt.height = 200;
external_txt.wordWrap = true;
addChild(external_txt);
function textReady(event:Event):void
{
external_txt.text = event.target.data;
}
function scrollUp(event:MouseEvent):void
{
external_txt.scrollV --;
}
function scrollDown(event:MouseEvent):void
{
external_txt.scrollV ++;
}
::::::
how do i get the external text to change font, size and color from the actions panel and not the exteral text?
<Irridessa>
Create a variable of a TextFormat object
called "myFormat":
create a TextField object called "myFormat" using the TextFormat constrictor
Create a TextFormat object called "myFormat"
Modify the TextFormat attributes of
"myFormat" to specify these values for the
following properties:
Set the font face to "Verdana" (.font Property)
Set the font point size to 10 (.size Property)
width (.width Property)
Set the font color to Blue (.color Property and using the proper format of the hex value 0x, zero and lowercase x)
height (.height Property)
Set the letter spacing to 1 pixel (.letterSpacing Property)
------ here is the script on my actions layer:::
var myFormat: TextFormat = new TextFormat();
var external_txt:TextField = new TextField();
var externalReq:URLRequest = new URLRequest("external.txt");
var externalLoad:URLLoader = new URLLoader();
myFormat.font = "Verdana";
myFormat.size = 10;
myFormat.color = 0x00FF00;
myFormat.letterSpacing = 1;
external_txt.setTextFormat(myFormat);
externalLoad.load(externalReq);
externalLoad.addEventListener(Event.COMPLETE, textReady);
up_btn.addEventListener(MouseEvent.CLICK, scrollUp);
down_btn.addEventListener(MouseEvent.CLICK, scrollDown);
external_txt.x = 175;
external_txt.y = 100;
external_txt.border = true;
external_txt.width = 200;
external_txt.height = 200;
external_txt.wordWrap = true;
addChild(external_txt);
function textReady(event:Event):void
{
external_txt.text = event.target.data;
}
function scrollUp(event:MouseEvent):void
{
external_txt.scrollV --;
}
function scrollDown(event:MouseEvent):void
{
external_txt.scrollV ++;
}
::::::
how do i get the external text to change font, size and color from the actions panel and not the exteral text?
<Irridessa>