Flash Bug In TextFormat.size
Flash has a bug:
ActionScript Code:
var mainTextField:TextField = new TextField();
var mainTextFormat:TextFormat = new TextFormat();
mainTextFormat.font = "BankGothic Md BT";
mainTextFormat.size = 20;
mainTextFormat.color = 0xFFFFFF;
mainTextFormat.kerning = true;
mainTextField.embedFonts = true;
mainTextField.selectable = false;
mainTextField.text = "... in a land far away...";
mainTextField.width = mainTextFormat.size * 20; // THIS SHOULD WORK
trace (typeof mainTextFormat.size); // trace = number
trace (typeof mainTextField.width); // trace = number
/* Error:
1118: Implicit coercion of a value with static type Object to a possibly unrelated type Number.
*/
I should NOT receive the error. Even the trace say's mainTextFormat.size is a number.
...oh, and you would think this would work?
ActionScript Code:
var a:Number = mainTextFormat.size;
mainTextField.width = a * 20;
/* Error:
1118: Implicit coercion of a value with static type Object to a possibly unrelated type Number.
*/
NOPE!! lol... wtf??
Just look at this rediculous hack I have to make for it to work:
ActionScript Code:
var mainTextField:TextField = new TextField();
var mainTextFormat:TextFormat = new TextFormat();
mainTextFormat.font = "BankGothic Md BT";
mainTextFormat.size = 20;
mainTextFormat.color = 0xFFFFFF;
mainTextFormat.kerning = true;
mainTextField.embedFonts = true;
mainTextField.selectable = false;
mainTextField.text = "... in a land far away...";
var temp:String = String(mainTextFormat.size); // HACK
var a:Number = parseInt(temp); // HACK
mainTextField.width = a * 20; // HACK
If anyone can see what I'm doing wrong, please speak up. I've had 3 other developers within my office look at this and conclude it's definately a bug in flash. What about you folks?
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 02-07-2008, 08:31 PM
View Complete Forum Thread with Replies
Sponsored Links:
TextFormat.size Maximum?
It seem that the textFormat.size property has a maximum - attempting to set it to something like 160 doesn't work correctly...
This page says the maximum is 72, This Page says its 130 - can anyone confirm this, and are there workarounds?
View Replies !
View Related
TextFormat.size Property Dilemma
sup everyone,
i have a little problem with the size property of the TextFormat Object. I have a textfield which i will put text in with different lengths. i have a code that will try and fit the text to this textfield. The code works in such a way that the text really does fits in but the problem is that the size change is dramatic. After diving into the help file of flash, i found out that the size property is actually an integer and thus i cannot set the size from 10 to 9.5. Why is this? How come in the authoring environment i could change the size to 8.5 [for example] but this is not possible in code?
is there a way to set the size using non-integer numbers?
please advise.
thank you so much!
View Replies !
View Related
Switch Font Size By TextFormat();
PHP Code:
//TEXT FORMAT 1
var myTF:TextFormat = new TextFormat();
myTF.size = 10;
myTF.font = "arial";
myTF.color = 0xffffff;
//TEXT FORMAT 2
var myTF2:TextFormat = new TextFormat();
myTF2.size = 14;
myTF2.font = "arial";
myTF2.color = 0xc0c0c0;
//CREATE TEXT FIELD
this.createTextField("myText", 0, 50, 50, 240, 100);
myText.multiline = myText.wordWrap=myText.border=true;
myText.type = "input";
myText.setNewTextFormat(myTF);
myText.background = true;
myText.backgroundColor = 0x333333;
myText.text = "a lottt offfff wordddsssssssssssss";
//setting font size buttons
btn_14px.onRelease = function() {
myText.setNewTextFormat(myTF2);
btn_14px._visible = false;
btn_10px._visible = true;
};
btn_10px.onRelease = function() {
myText.setNewTextFormat(myTF);
btn_14px._visible = true;
btn_10px._visible = false;
};
is not working!!! mamamia!!!
please any help?
View Replies !
View Related
Maximum Text Size For TextFormat
Afternoon everyone,
I am working on an application in which text is created dynamically. I seem to be experiencing a maximum size of 130 when using textFormat. I cannot seem to find any references to this limit. Is there a way to get around it?
So far my only resolution is to create a smaller text field within a movieClip and then scale the movieClip. This moves the text of the pixel location that I need it however.
Any help with this would be very much appreciated.
Cheers,
Michael
View Replies !
View Related
Stop Flash Adding TextFormat
Hello,
I'm exporting text from an html text box to a .text file. For reasons I won't go into, I have to export it as htmlText. My problem is that flash adds a default text format to the text.
Is there any way of stopping this or do I have to clean it up with php?
Thanks
View Replies !
View Related
Flash Array TextFormat Problem
I have a problem.
I have a array with information, for each post in the array i create o textfield with information.
But when i want to use the Textformat, my first textfield wont get textformated (all the other post gets the textformat).. i have tried to solve this problem without any result.
Here is my code.
var arraydepth:Number = 1000;
var yPos:Number = 0;
for(i = 0; i < arDesigns.length - 1; i++)
{
__root.createTextField("lbl"+i, i+arraydepth, 0, yPos, 600, 600);
_root["lbl"+i].setNewTextFormat(format);
_root["lbl"+i].text = arDesigns[ i ];
_root["lbl"+i]._y = yPos;
yPos += 30;
var format:TextFormat = new TextFormat();
format.font = "Arial";
format.color = 0x0000;
format.size = 22;
}
the result is:
Text
Text
Text
Text
Does anyone know were the problem is?
Edited: 05/08/2007 at 11:41:39 AM by DaveTheNave
View Replies !
View Related
Font Property Of Flash.text.TextFormat
The font property of flash.text.TextFormat is defined as a string.
ActionScript Code:
var tf:TextFormat = txt1_ui.getTextFormat(s,e);
Dumper.info(tf.font);
tf.font = tf.font+"---";
Dumper.info(tf.font);
the output:
King's Ransom Light
King
ActionScript Code:
var str:String = "King's Ransom Light";
var tf2:TextFormat = new TextFormat();
tf2.font = "King's Ransom Light";
Dumper.info(str);
Dumper.info(tf2.font);
the output:
King's Ransom Light
King
I assume something funny is going on in the TextFormat set method, but I don't have access to that. This has been an infuriating two hour odyssey thus far.
View Replies !
View Related
Variable Data From Flash Has <textformat> Tags Etc In Database
hey all i have an input text field in flash and when i send that data to php and that sends it on to my database it looks like the following in the database:
Code:
<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="11" COLOR="#000033" LETTERSPACING="0" KERNING="0">Hello World</FONT></P></TEXTFORMAT>
instead of showing as it should like "Hello World"
and i have in flash html text render OFF so its not that
any ideas why and how to fix??
Cheers in advance peeps
View Replies !
View Related
Why Use Flash Video When It Bumps The File Size To Outrageous Size?
I have imported a flash video into my flash movie. I have run the .mov in sorenson squeeze and have it nice and small. As soon as I import it into flash (because this is the only way I know to do it in order to run a video in flash) now I have 1024 frames and a HUGE .swf file.
So what is the point to using flash at all...or am I doing something wrong. Is there a better way to handle video within flash??
Thanks
Fitchic77
View Replies !
View Related
Browser Size Doesn't Match Flash Movie Size
Can anyone help me figure out how to make the Browser or Window that launches my .swf file fit exactly the size of the Flash Movie's dimensions?
My movie is 800x550 yet when launched it in a browser there is extra space around it which shows the elements that are outside the border of the movie which I later tween onto the stage.
In short, how do I constrain the Browser Window to fit the dimension of the Flash movie?
Thanks,
Tony
View Replies !
View Related
Screen Size And Flash Movie Size
Can you create a swf larger than the resolution of the users screen and then just center it on the screen, or if not, is there a way around this. I want to have popup windows that can be moved around within the flash file, but I need the flash file to be at least as big as the users screen so that they don't just disappear. Is this possible??
View Replies !
View Related
Photoshop Size Vs Flash Size?
When i'm working with an image in photoshop, and check the size, it will say one thing, but when i save it and import it into flash its a different size, can anyone explain why this is this way? I'm going ot assume it has something to do with dpi, but i'm not sure. Will someone help me out?
View Replies !
View Related
TextFormat Example
[swf width="550" height="300" background="#FFFFFF"]http://www.zh-webdesign.ch/zoa/autosize_text3.swf[/swf].
Just an exammple of the textFormat object.
Code:
// Creating textfield text format
fieldTextFormat = new TextFormat();
fieldTextFormat.font = "Arial";
fieldTextFormat.bold = false;
fieldTextFormat.italic = false;
fieldTextFormat.align = "left";
// Creating the base textfield
createTextField("mytext", 1, 200, 100, 200, 150);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.border = true;
mytext.html = false;
mytext.type = "input";
mytext.selectable = true;
mytext.text = thetext;
mytext.autosize = "left";
mytext.borderColor = 0xaaaaaa;
mytext.text = "Test the format object!";
mytext.setTextFormat(fieldTextFormat);
// Set labelös of the button components
bold_button.setLabel("bold");
italic_button.setLabel("italic");
left_button.setLabel("LEFT");
center_button.setLabel("center");
right_button.setLabel("right");
// Set font provider
myfonts=TextField.getFontList();
fontList.setDataProvider(myfonts);
fontList.setSize(300);
fontList.setSelectedIndex(20);
// set font-size provider
fontSizes = new Array(6,8,10,12,14,16,18,20,24,28,32,40,48,56,64);
fontSize.setDataProvider(fontSizes);
fontList.setSelectedIndex(4);
// change font when new one selected
fontList.setChangeHandler("myHandler");
function myHandler(component){
fieldTextFormat.font = fontList.getSelectedItem().label;
mytext.setTextFormat(fieldTextFormat);
}
// change font-size when new one selected
fontSize.setChangeHandler("myHandler2");
function myHandler2(component){
fieldTextFormat.size = fontSize.getSelectedItem().label;
mytext.setTextFormat(fieldTextFormat);
}
// Functions for the buttons
function makeBold(){
if (fieldTextFormat.bold){
fieldTextFormat.bold = false;
bold_button.setLabel("bold");
} else {
fieldTextFormat.bold = true;
bold_button.setLabel("BOLD");
}
mytext.setTextFormat(fieldTextFormat);
}
function makeItalic(){
if (fieldTextFormat.italic){
fieldTextFormat.italic = false;
italic_button.setLabel("italic");
} else {
fieldTextFormat.italic = true;
italic_button.setLabel("ITALIC");
}
mytext.setTextFormat(fieldTextFormat);
}
function makeLeft(){
fieldTextFormat.align = "left";
left_button.setLabel("LEFT");
center_button.setLabel("center");
right_button.setLabel("right");
mytext.setTextFormat(fieldTextFormat);
}
function makeCenter(){
fieldTextFormat.align = "center";
left_button.setLabel("left");
center_button.setLabel("CENTER");
right_button.setLabel("right");
mytext.setTextFormat(fieldTextFormat);
}
function makeRight(){
fieldTextFormat.align = "right";
left_button.setLabel("left");
center_button.setLabel("center");
right_button.setLabel("RIGHT");
mytext.setTextFormat(fieldTextFormat);
}
Fredi
View Replies !
View Related
TextFormat Help
Ok, I am trying to bold a piece of selected text (like a text editor). The input text has a instance of textIns_txt, the bold button has an instance of boldButton and there is an enterFrameMovie outside the stage. Here is the code...
textIns_txt.onKillFocus = function(){
Selection.setFocus(textIns_txt);
Selection.setSelection(begin, end);
trace (begin);
trace (end);
}
enterFrameMovie.onEnterFrame = function(){
begin = Selection.getBeginIndex();
end = Selection.getEndIndex();
}
boldButton.onRelease = function(){
boldFormat = new TextFormat();
boldFormat.bold = true;
textIns_txt.setTextFormat(begin, end, boldFormat);
}
Why doesnt it work? It will trace the correct values for the beginIndex and endIndex, but doesnt bold it... Thanks for any help in advance.
View Replies !
View Related
TextFormat
HI all!
I have a string. I manage to put some caracters in bold by the use of textFormat object like this:
formatBold = new TextFormat();
formatBold.bold = true;
myString.setTextFormat(5, 7, formatBold);
How can I do to manage to know if one of my caractere in my string is bold?
if(myString.charAt(6).bold == true //that doesn't work){
do something...
}
thanks!!!!
View Replies !
View Related
Textformat
How can you apply a format (i.e. bold) to a selection of text in a text field set to input???
I think this is an important step to overcome if we are to solve the rich text editor problem...
Ian
View Replies !
View Related
TextFormat URL
I'm having a little trouble getting the TextFormat object to work with the URL and target property. I have two books that explain pretty much everything about the textFormat object except how to set up a URL and Target. And I've had no luck on Macromedia's site.
Anyone know how to use this?
THX
View Replies !
View Related
New TextFormat()
Does anyone know if I can format a manually created text field?
I have a dynamic text field that accepts students names.
I am converting the first letter to a capital and adding a full stop at the end...
The text is red...
I want to make the color of the fullstop black..
I have tried...
// make textFormat object
format = new TextFormat();
format.color = oxoooooo;
// then apply to my string
// dynamic text field named input... containing variable inputString
input.setTextFormat( 8, format);
__. but no formatting happens
Any ideas?
View Replies !
View Related
New TextFormat(); Help
Just when i thought i had sorted one problem another shows it's erie head
Most of yesterday was spent trying to figure out code for change the format of text in an input field. got that SORTED
But now i have discovered that the format is not retained when i submit the form for proccessing, wether it be email form or admin area form sending to db.
I am familiar with using TextFormat(); and the code in the fla is not mine more a combanation of posts that i have read on this subject.
If you download the attach fla and run it set some text to diffrent format then press the view format you will see that the format of the text is not retained
Any help
Cheers
Paul
View Replies !
View Related
TextFormat()
Hi, i'm using TextFormat() to display dynamic text (from XML).
Assuming this line: GeneralQLFormat = new TextFormat();
and then:
GeneralQLFormat.html = true;
the dynamic text that comes the DB is in htm format, example: <b>text</b>
but it doesn't display the "text" in Bold, nor it shows the tags (<b>) what going on???????
thanks in advance,
Maya.
View Replies !
View Related
TextFormat()
HI!
I want the format of my text to be changed on a certain event. So I tried the TextFormat object... but I can't make it work properly. It just makes my text disappear
Here is my code :
formatBold = new TextFormat();
formatBold.bold = true;
formatBold.color = 0x000000;
//My textField is placed on the same level, and the instance name is "titreBouton"
titreBouton.setTextFormat(formatBold);
Anyone has an idea about this??
Thanks in advance!!
Julie
View Replies !
View Related
TextFormat
Hi,
I am creating an application that does calculations. The application will contain 6 variables. 4 of them will be knowns and to of them will be unknows. The application will use the 4 knowns to calculate the 2 unknows. I am wanting to change the font to bold if the font is the two unknown statements that way the user can see what variables they just calculated for.
For Example (I have tried this):
if (a==0 & b==0){
//I am wanting to change the font of variable after the calculations
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = true;
//var a instance name is a
var a = c*d*e*f
a.setTextformat(my_fmt);
var b = c-a
}
Does anyone have any suggestions? All help will be greatly appreciated.
Thanks,
Jon
View Replies !
View Related
Xml With TextFormat
I am creating a menu with sub menus using xml. But cant seem to apply my textFormat to my dynamically created textfield, the menu works fine except for this problem that my TextFormat is'nt applied. Here is a sample of my code. Any help would be much appreciated as i am pulling my hair out.
PHP Code:
GenerateMenu = function (container, name, x, y, depth, node_xml) {
// variable declarations
var curr_node;
var curr_item;
var curr_menu = container.createEmptyMovieClip(name, depth);
// text format
var menu_fmt:TextFormat = new TextFormat();
menu_fmt.font = "_sans";
menu_fmt.size = 18;
// for all items or XML nodes (items and menus)
// within this node_xml passed for this menu
for (var i = 0; i<node_xml.childNodes.length; i++) {
// movieclip for each menu item
curr_item = curr_menu.attachMovie("menuitem", "item"+(i+1)+"_mc", i);
curr_item.createTextField("name_txt", i, curr_menu["item"+((i-1)+1)+"_mc"].name_txt._width+curr_menu["item"+((i-1)+1)+"_mc"].name_txt._x, 0, 100, 16), curr_item.name_txt.setNewTextFormat(menu_fmt), curr_item.name_txt.selectable=false, curr_item.name_txt.text=curr_node.attributes.name;
curr_item.name_txt.setNewTextFormat(menu_fmt);
curr_item.name_txt.selectable = false;
curr_item._y = y+curr_item._height;
// item properties assigned from XML
curr_node = node_xml.childNodes[i];
curr_item.action = curr_node.attributes.action;
curr_item.variables = curr_node.attributes.variables;
curr_item.name_txt.text = curr_node.attributes.name;
curr_item.trackAsMenu = true;
View Replies !
View Related
New TextFormat
I'm trying to set the size of a textfield. Here's the code that's not cutting it:
this.createTextField("money",2,100,50,30,20);
money.textColor="0xFF0000" ;
money.selectable=false;
MyMoney=new TextFormat();
MyMoney.size=40;
MyMoney.font= "Verdana"
money.setTextFormat(MyMoney);
This code, which I got from actionscript bible and other places, is not working...any solutions Flashers? would appreciate an succor...
View Replies !
View Related
New TextFormat
I'm trying to set the size of a textfield. Here's the code that's not cutting it:
this.createTextField("money",2,100,50,30,20);
money.textColor="0xFF0000" ;
money.selectable=false;
MyMoney=new TextFormat();
MyMoney.size=40;
MyMoney.font= "Verdana"
money.setTextFormat(MyMoney);
This code, which I got from actionscript bible and other places, is not working...any solutions Flashers? would appreciate an succor...
View Replies !
View Related
Textformat
hi,
the static text in my site is all smooth, but dynamic text comes up not so. is this something i have to live with or is there something i can adjust, in textformat or something. my current textformat is as follows:
myformat = new TextFormat();
myformat.color = 0x000000;
myformat.font = "eurostile";
myformat.size = 10
myformat.bold = true
myformat.leading = 5
thanks
View Replies !
View Related
TextFormat To And From XML
Hi, I've written a texteditor with which the user can type in text and then select parts of it and add formatting. It adds a new customized TextFormat to every selection.
It works fine, and the next step is to translate the text into XML-format. This is where I'm a bit confused. What is the best format for this? To add a
PHP Code:
<TEXTFORMAT bold='true' italic='false' color='0xff0000' ...>
selected text
</TEXTFORMAT>
for every formatchange? Or would you prefer individual tags like <B></B> using CDATA? How would the translation to/from XML work in that case?
Please share your thoughts/experiences on this!
View Replies !
View Related
Textformat Obj Being Ignored
Can anybody see why the following text formatting obj is not being applied to my text fields?
This code is in frame 1 of my _root movie & is called from within a couple nested movie clips with the following script
// Array to store text
var aText:Array = new Array;
var nHeight:Number = 15;
// Add blinking cursor movieclip
var mcRef:MovieClip = this.attachMovie("mcCursor", "mcCursor", this.getNextHighestDepth(), {_x:6, _y:7});
aText.push("blah blah testing etc");
_root.teleType(this, 0, "0xCCFFFF");
I've tried embedding the Verdana font (and obv changing the font name to the linkage name) but this has no effect.
I've also tried including a dynamic text field on the root stage with embedded characters.
Neither makes any difference - a default font is used, with default colour & size.
Any ideas?
//*************************************************************************
// Teletype printing functions ********************************************
//*************************************************************************
//Text formatting object
var tfText:TextFormat = new TextFormat();
tfText.font = "Verdana";
tfText.size = 8;
tfText.align = "left";
//tfText.underline = false;
import flash.filters.GlowFilter;
var gfObj:GlowFilter = new GlowFilter(0x000000, .5, 40, 20);
function teleType(mcRef:MovieClip, nLine:Number, sColour:String):Void
{
var nY:Number = nLine * mcRef.nHeight + 8;
txtRef = mcRef.createTextField("txt"+nLine, mcRef.getNextHighestDepth(), 10, nY, 10, 10);
txtRef.setTextFormat(tfText);
txtRef.embedFonts = true;
//txtRef.filters = [gfObj];
txtRef.ind = 0;
txtRef.line = nLine;
txtRef.autoSize = "left";
//txtRef.textColor = sColour;
txtRef.selectable = false;
txtRef.intRef = setInterval(printText, 100, txtRef, mcRef, sColour);
}
function printText(tRef:Object, tgtRef:MovieClip, sColour:String):Void
{
var nLine:Number = tRef.line;
var nIdx:Number = tRef.ind + 1;
tRef.text = tgtRef.aText[nLine].substr(0, nIdx);
tgtRef.mcCursor._x = tRef._x + tRef._width;
tgtRef.mcCursor._y = tRef._y + 5;
if (nIdx !== tgtRef.aText[nLine].length)
{tRef.ind = nIdx;}
else
{
clearInterval(tRef.intRef);
if (++nLine !== tgtRef.aText.length)
{
teleType(tgtRef, nLine, sColour);
}
}
updateAfterEvent;
}
//*************************************************************************
View Replies !
View Related
TextFormat
okay this has me stumped - what have i missed? The textfield isnt formatting to the settings of the textFormat var...
package {
import flash.display.*;
import flash.text.*;
import flash.events.*;
import flash.display.GradientType;
import flash.geom.Matrix;
import flash.filters.GlowFilter;
public class menuBtn extends Sprite {
private var box:Sprite;
public var myText:TextField;
private var myFormat:TextFormat;
public function menuBtn() {
init();
}
private function init():void {
box = new Sprite();
var matrix = new Matrix();
var colours:Array =[0x000000, 0x000000];
var alphas:Array = [0.9, 0.1];
var ratios:Array = [0, 255];
matrix.createGradientBox(190, 20, Math.PI/2, 0, 0);
box.graphics.beginGradientFill(GradientType.LINEAR, colours, alphas, ratios, matrix);
box.graphics.drawRect(0, 0, 190, 20);
box.graphics.endFill();
addChild(box);
myFormat = new TextFormat;
myFormat.font = "Gautami";
myFormat.color = 0xFFFFFF;
myFormat.size = 200;
myText = new TextField();
addChild(myText);
myText.x = 20;
myText.y = 1;
myText.text = "BUTTON";
myText.autoSize = TextFieldAutoSize.LEFT;
myText.defaultTextFormat = myFormat;
}
}
}
View Replies !
View Related
TextFormat
hi,
I have issue with TextFormat;
when I set TextFormat for TextFeild .. dose not appear !!
look at my class :)
at the end line ...
THX..
Attach Code
package {
import flash.display.*;
import flash.geom.*;
import flash.text.*;
public class tooltip extends MovieClip {
function tooltip():void {
}
public function showTip(theText:String,backGColor:Number,borderColor:Number,fnt:String,fntColor:Number) {
if (! theText) {
trace("you must declare a parameter that has a tooltip dada type as created in tooltip class for you ");
} else {
if (! fnt) {
fnt="Arial";
}
if (! fntColor) {
fntColor=0x000000;
}
//-----------------------------------------Config----------------------
var txt_fmt:TextFormat=new TextFormat()
txt_fmt.font = fnt;
var mc:MovieClip=new MovieClip ;
addChild(mc);
var catchtx:TextField=new TextField ;
catchtx.text=theText;
var txWitdh:Number=catchtx.textWidth;
//-----------------------------------------Point(s)--------------------
var p1:Point=new Point(0,0);
var p2:Point=new Point(txWitdh+15,0);
var p3:Point=new Point(txWitdh+15,20);
var p4:Point=new Point(20,20);
var p5:Point=new Point(15,30);
var p6:Point=new Point(10,20);
var p7:Point=new Point(0,20);
//-----------------------------------------drawing---------------------
mc.graphics.lineStyle(2,borderColor,1);
mc.graphics.beginFill(backGColor,1);
mc.graphics.moveTo(p1.x,p1.y);
mc.graphics.lineTo(p2.x,p2.y);
mc.graphics.lineTo(p3.x,p3.y);
mc.graphics.lineTo(p4.x,p4.y);
mc.graphics.lineTo(p5.x,p5.y);
mc.graphics.lineTo(p6.x,p6.y);
mc.graphics.lineTo(p7.x,p7.y);
mc.graphics.lineTo(p1.x,p1.y);
mc.graphics.endFill();
//-----------------------------------------wrting tip------------------
var tipText:TextField=new TextField ;
tipText.text=theText;
tipText.defaultTextFormat = txt_fmt;
tipText.x+=5;
addChild(tipText);
trace(txt_fmt.font);
}
}
}
}
View Replies !
View Related
Set TextFormat
Does anybody see why this code doesn't work? It looks identical to other code I've found on Kirupa.
Code:
card.createTextField("terms_txt", 1, 10, 10, 375, 40);
f = new TextFormat();
f.size = 18;
card.terms_txt.setTextFormat(f);
View Replies !
View Related
New TextFormat
I'm trying to set the size of a textfield. Here's the code that's not cutting it:
this.createTextField("money",2,100,50,30,20);
money.textColor="0xFF0000" ;
money.selectable=false;
MyMoney=new TextFormat();
MyMoney.size=40;
MyMoney.font= "Verdana"
money.setTextFormat(MyMoney);
This code, which I got from actionscript bible and other places, is not working...any solutions Flashers? would appreciate an succor...
View Replies !
View Related
Set TextFormat
Does anybody see why this code doesn't work? It looks identical to other code I've found on Kirupa.
Code:
card.createTextField("terms_txt", 1, 10, 10, 375, 40);
f = new TextFormat();
f.size = 18;
card.terms_txt.setTextFormat(f);
View Replies !
View Related
New TextFormat
I'm trying to set the size of a textfield. Here's the code that's not cutting it:
this.createTextField("money",2,100,50,30,20);
money.textColor="0xFF0000" ;
money.selectable=false;
MyMoney=new TextFormat();
MyMoney.size=40;
MyMoney.font= "Verdana"
money.setTextFormat(MyMoney);
This code, which I got from actionscript bible and other places, is not working...any solutions Flashers? would appreciate an succor...
View Replies !
View Related
TextFormat
Is there a way to use TextFormat to underline <a> links in loaded external text AND target Flash Player 6 at the same time? Also, is there a way to use TextFormat.target to specify the target for every link in the external text file? I'd like to eliminate the redundancy of repeating the same thing over and over again.
View Replies !
View Related
New TextFormat
I'm trying to set the size of a textfield. Here's the code that's not cutting it:
this.createTextField("money",2,100,50,30,20);
money.textColor="0xFF0000" ;
money.selectable=false;
MyMoney=new TextFormat();
MyMoney.size=40;
MyMoney.font= "Verdana"
money.setTextFormat(MyMoney);
This code, which I got from actionscript bible and other places, is not working...any solutions Flashers? would appreciate an succor...
View Replies !
View Related
New TextFormat(); Help
Just when i thought i had sorted one problem another shows it's erie head
Most of yesterday was spent trying to figure out code for change the format of text in an input field. got that SORTED
But now i have discovered that the format is not retained when i submit the form for proccessing, wether it be email form or admin area form sending to db.
I am familiar with using TextFormat(); and the code in the fla is not mine more a combanation of posts that i have read on this subject.
If you download the attach fla and run it set some text to diffrent format then press the view format you will see that the format of the text is not retained
Any help
Cheers
Paul
textformat file
View Replies !
View Related
Bug In TextFormat.url? Please Help
I'm trying to build a WYSIWYG editor in MX, which has been made easy up to now by the new TextFormat objects.
However, the TextFormat.url property doesn't seem to work..... If I create a link in a HTML textfield it works fine, but when I try to remove the link (by setting the url to null as is suggested in the Actionscript Dictionary), the hyperlink doesn't get removed!
Code:
_root.linkOn = new TextFormat();
linkOn.url = "http://somewhere";
_root.linkOff = new TextFormat();
linkOff.url = null;
var cFormat = _root.inputText.getTextFormat(5,10);
if(cFormat.url == null)
{
_root.inputText.setTextFormat(5,10,_root.linkOn);
}
else
{
_root.inputText.setTextFormat(5,10,_root.linkOff);
}
Am I doing something wrong, or is this a bug?
Please help..... I was almost there and then this happened!
P.S I've also tried checking and setting the url property to "", but that doesn't work either.
Thanks in advance,
Mark B
http://www.eclectica.nu
View Replies !
View Related
TextFormat: The Very Basics
I'm just trying to figure out the textFormat assignment. My example is stupid but it's just to isolate what I'm looking for.
Say I want to write something like:
framboiseframboiseframboiseframboise
The simplest way to do it I thought would be:
normal = new TextFormat();
normal.bold = false;
italic = new TextFormat();
italic.bold = false;
myTextField.setTextFormat(normal);
myTextField.text = myTextField.text+"framboise";
myTextField.setTextFormat(bold);
myTextField.text = myTextField.text+"framboise";
myTextField.setTextFormat(normal);
myTextField.text = myTextField.text+"framboise";
myTextField.setTextFormat(bold);
myTextField.text = myTextField.text+"framboise";
But apparently not... How do I do that?
View Replies !
View Related
TextFormat And Hyperlinks
I I was expecting that the following code would have 2 hyperlinks linking to 2 different URLs.
jazzyStyle = new TextFormat();
jazzyStyle.color = 0xFF9977;
jazzyStyle.url = "jazz.html";
bluzyStyle = new TextFormat();
bluzyStyle.color = 0x881122;
jazzyStyle.url = "blues.html";
TF.html = 1;
TF.setNewTextFormat(jazzyStyle);
TF.replaceSel("Jazz
");
TF.setNewTextFormat(bluzyStyle);
TF.replaceSel("Blues");
But it's not the case. they both point to the second URL (Blues.html) although they have a different color. That is not cool I think.
View Replies !
View Related
TextFormat Trouble
Does anyone know how to set a negative value (ie. -4) for leading using the textFormat object. I cannot seem to go lower than 0 and the font I'm using has a rather large standard leading.
It is entirely possible to use negative values when manually formatting a text through the properties inspector and I'm somewhat confused since I believed that the properties available through AS had identical behaviors...
thx in advance
idi
View Replies !
View Related
TextFormat.lineHeight Or Something?
I can set the height of each letter individually in a text field using textFormat.size, but I need to be able to format the vertical position of the letter too. I don't see the option in the code hints, anyone have any suggestions as to how to do this?
Thanks,
-J
View Replies !
View Related
TextFormat Issues
Another short but very sweet question. Here's the code:
Code:
linkText = new TextFormat();
// Set the text to blue
linkText.color = 0x0000FF;
// Below is the line that mucks everything up.
// If you comment it you, everything works,
// except the text in the box just says _level0.txt
this.txt = "Hello";
this.txt.setTextFormat(linkText);
As you can see from the comments, the line:
Code:
this.txt = "Hello"
seems to ignore the advice of the TextFormat and decides to be black rather than blue. Edit the line out, and the text turns blue but just gives a reference to the text variable (_level0.txt).
I never knew bug hunting in 4 lines of code could be so much fun. Anyone got ideas about this?
View Replies !
View Related
Help With MX TextFormat Problem, Please
I create a dynamic input text box then apply a format with a TextFormat object, everything works fine, but when i test the movie and navigate throug the fields with the tab key, as soon as the object gets the focus, the format disappears, is it normal?
how do i keep the format???
Thanks in advance!!!
Juan
View Replies !
View Related
How Does TextFormat Work?
how does textFormat work? i've seen it mentioned absolutely everywhere in the reference file and it seems to do everything weird and wonderful with text strings, but how exactly do you apply it to a piece of text?
View Replies !
View Related
CreateTextField And New TextFormat();
Hello,
I am having trouble identifying the error(s) in my code. I have created a text box and myTextFormat function doesn't seem to operate correctly. I can embed the font, make the box non-selectable and set the variable, but I cannot change the font nor adjust it's size in actionscript. Can someone help?
Code:
this.createTextField ("time_tx",1,385,275,160,20);
time_tx.variable = "dateTime";
time_tx.embedFonts = true;
time_tx.selectable = false;
myTextFormat = new TextFormat();
myTextFormat.bold = true;
myTextFormat.font = "Arial";
myTextFormat.size = 14;
time_tx.setTextFormat(myTextFormat);
View Replies !
View Related
Is TextFormat() Like CSS In Html?
Hi,
Just need a quick yes or no. If I define several textFormat objects with say different fonts and colors can you apply these to different text within the same textfield...I'm guessing that if I put text in a text field with format01 and then add more text into the textfield and use format02 that the entire textfield will take on format02.
I don't have time to test this out, so wanted to ask you guys. What I'm looking for is the ability to use the textFormat object somewhat like a cascading style sheet with <span> tags.
thanx,
marcus
View Replies !
View Related
|