Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








CreateTextField Text Being Clipped


Hi

I'm having trouble with createTextField. The text field is being created in nested mc's made dynamically with createEmptyMovieClip. They're buttons. Some of the text fields created are fine, but in a good few of them it appears to be clipped on the right. What could be the cause? Here's the script (part of a loop) ....

code:
var style_fmt:TextFormat = new TextFormat();
style_fmt.font = "Book Antiqua (embedded)";
style_fmt.size = 11;

submenuName.push(submenu[j].attributes.name);
subText = submenu_btn.createTextField("subText", 10, -50, 0, 100, 16);
subText.text = submenuName[j];
subText.autoSize = "center";
subText.antiAliasType = "advanced";
subText.embedFonts = true;
subText.setTextFormat(style_fmt);
subText.textColor = 0x8AAFE0;
subText.selectable = false;


I've traced the _width of the text field and parent mc. They both come out the same.

thanks
mark
flash8




FlashKit > Flash Help > Flash ActionScript
Posted on: 12-16-2005, 03:52 AM


View Complete Forum Thread with Replies

Sponsored Links:

How Do I Use Clipped Jpeg's?
This might be more of a photoshop question than a flash one, but here goes nothing.

Basically, I want to be able to clip out the backgrounds on some jpegs. Does that make sense? In other words, I want to be able to use non-rectangular images. If I use a photoshop .psd file with the background erased, it works fine. However, when I convert the .psd to a .jpeg, photoshop adds a white fill to the erased background, thusly returning it to a rectangular shape. Obviously I can't populate my flash file with .psd's and expect it load in a reasonable amount of time. What should I do?

View Replies !    View Related
CONTROL IS CLIPPED
I create a custom control in a FLA, and compile it to a SWC. It works no problem, even the ActionSciprt.

When I place theat control in a new FLA, it is clipped. I only see the lower right, because it thinks the center is upper left. Adding a 2nd control then makes the first available. WHAT THE FUGK IS THAT ABOUT? Also, to move either control, you have to grip it by some new blue rectangly that is no part of the control. This, also, is way off center.

MM DO YOU EVEN FUGKING TEST YOUR CODE?

View Replies !    View Related
Why Aren't The Graphics Clipped Off . . . .
Is there a method to clipping off graphics outside the stage area? Or do I have to make sure the graphics fit the stages' dimensions perfectly? Because when I publish the project the scenes graphics play outside the stage area when the window is enhanced to a larger view. The only instance this does not happen is when it is html.

Thanks, RB

View Replies !    View Related
MP3 Audio Clipped When Importing
When I import an MP3 audio file into Flash CS3, the beginning of the clip (maybe 3-5 seconds) is clipped off. When I import as a wav file it imports fine. If I play the MP3 file in the windows media player it plays fine as it does if I import it into Captivate.

To top it off, this just started happening. Does anyone have any suggestions on what might be causing this? I did just start using Audacity to do the editing and output and wonder if there is something it is doing to the file.

Jennifer

View Replies !    View Related
Start Of Audio Gets Clipped
The start of my audio segments sometimes get clipped. This happens when they're placed at the start of the movie (in frame one). Does anyone know why this happens and how it can be corrected? I've added some silent time at the start to correct this but is there an easier way to do this? Most of the time the clipping doesn't happen.

View Replies !    View Related
Script Fonts Getting Clipped In Flash
We are working on a flash presentation that is being output to DVD and with the above font, which our client wants, and the top of the capital letters are getting clipped off when we output to video from flash. Does anyone have any suggestions as to how we can get around this? I have images as examples but don't see an option to upload. Please let me know any kind of work around that is out there for this.

Thanks,
Jeremiah

View Replies !    View Related
Make Dynamic Objects To Be Clipped Off The Stage
Hi everyone:


Say, if I create a sprite like this:

Code:
var s:Sprite = new Sprite();
//Do some drawing on it
addChild(s);
and, say make that sprite move accross the screen. How can I make it to be clipped when it leaves the stage area (the same way as it happens if I drag a stage object off the stage with a mouse)?

Thanks.

View Replies !    View Related
CreateTextField, Dynamically Loaded Text, And Setting Text Format..
I'm trying to format some text that i'm loading into a text box, that's inside a movie clip, that's created at load time. It seems that I have everything but the snippet of code that will apply the text formatting. I just don't know where to get it from, or rather, what to point it at.

my code is

Code:
//creates empty movie clip
this.createEmptyMovieClip("enter_mc", 10);
//creates text field inside movie clip
this.enter_mc.createTextField("welcome_txt", this.getNextHighestDepth(), 0, 0, 100, 300);
//sets text formatting
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = true;
my_fmt.size = 20;
//

LV = new LoadVars();
// declare a new LoadVars object
LV.load("enterTxt.txt");
// load content in it
LV.onLoad = function(success) {
if (success) {
// when the file is loaded...
_root.enter_mc.welcome_txt.text = this.enterTxt;
// load the value of the variable "enterTxt" in the
// file into the text field "named" welcome_txt
}
};
and that works to create the movie clip, the text box, and load the text.

this

Code:
_root.enter_mc.welcome_txt.setTextFormat(my_fmt);
would make sense for formatting the text but it doesn't format the loaded text. there's nothing special about the text that's being loaded.

I'm at a loss, any help would be greatly appreciated.

View Replies !    View Related
CreateTextField And Text Not Showing
Basically I have two flash files one a test harness and the other the real thing - I have put the following code and embedded the font in the library and done this correctly as it works on the test hraness frame however on the real one it just display the border and not the text.

Basically the real file is more complecated and runs through a server
- I've tried loading text onto nummerous levels etc and tried having htmltext instaed etc.

What I need to know is what prevents text from showing? - Is there something which gets published in the html file I'm missing?

Or is it a level thing - but if that was the case I wouldnt see the border

Any suggestions?


//Text Format Object
rf = new TextFormat();
rf.size = 21;
rf.bold = true;
rf.selectable = false;
rf.multiline = true;
rf.wordWrap = true;
//use font from library
rf.font = "VerdanaCumMacronBold";
rf.align = "left";

//creates dynamic text field
createTextField("myText_field", 1, 136.1, 330.0, 634.0, 127.0);

//associate text field with text format
myText_field.setNewTextFormat(rf);

myText_field.type = "dynamic";
myText_field.embedFonts = true;
//*****************************/
myText_field.borderColor = 0x00FF00;
myText_field.border = true;
//*****************************/
myText_field.selectable = false;
myText_field.text = "Hello everyone";
stop();

View Replies !    View Related
Formatting Text With CreateTextField
External text files can be modified with <html> tags with the "render text as HTML" option from within the Flash properties panel.
How do I do this with script on the button scripts below?
I would like to be able to have the same formating with a TextField created with script "createTextField" using TextField object methods and properties however script generated textfield does not seem to have this option.
After searching I have tried :-
MC.html =
MC.htmlText =
But these would not work.

What Does?

View Replies !    View Related
Dynamic Text W/ CreateTextField
I have no problem dynamically loading text if I place a textField on the stage but I can't seem to get the following to work using the createTextField. I shortened my code to make it easier to read and still show what I am trying to do. Also I can I place the text within the "bueMenu" or only on top of it? Is so how?


Code:
import flash.filters.BlurFilter;
import flash.filters.*;
import mx.transitions.Tween;
import mx.transitions.easing.*;
Stage.scaleMode = "noScale";
//
import flash.geom.*;
import flash.display.BitmapData;
//
var myMCL:MovieClipLoader = new MovieClipLoader ();
var myListener:Object = new Object ();
myMCL.addListener (myListener);
//
var lvGalleries:LoadVars = new LoadVars ();
lvGalleries.onData = function (stateData) {
stateRollOver.htmltext = stateData;
};
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet ();
cssStyles.load ("styles/stateStyles.css");
//
stateMenu ();
function stateMenu () {
for (var i = 0; i < 1; i++) {
var menu:MovieClip = this.attachMovie ("bluBox", "bluMenu", +i, i);
menu._x = 300;
menu._y = 200;
menu._yscale = 75;
var t1:Tween = new Tween (menu, "_xscale", Strong.easeOut, 0, 350, .5, true);
bluMenu.enabled = false;
t1.onMotionFinished = function () {
this.createTextField ("stateRollOver", this.getNextHighestDepth, 100, 100, 400, 400);
stateRollOver.autoSize = "right"
stateRollOver.border = true;
stateRollOver.multiline = true;
stateRollOver.wordWrap = true;
stateRollOver.html = true;
cssStyles.onLoad = function () {
stateRollOver.text = this;
lvGalleries.load ("vars/pickStateCSS.html");
};
};
}
}

View Replies !    View Related
CreateTextfield And Fading The Text
searched high and low but nobody seems to be making textfields with code. and I have a problem so I'm resorting to posting.

I have a movieclip created with the createEmptyMovieClip bite of code.

inside that movieclip I have created a textfield using the createtextfield code

now settin up a text format for this text is simple I'm using sans and everythign is going fine... tonight I decided that I wanted teh text to fade up then fade out.

this is my problem I attempt to fade the movieclipholding the textfield and its a no go. tracin out the alpha of said movieclip reveals that the alpha is changing. tho the text remains the same.

any answers out there.

thanks!


drew

View Replies !    View Related
Dynamic Text Vs CreateTextField Vs EmbedFont
Here's a bit of a performance optimization problem for the more experienced flash MXers floating around here. I am attaching links for 3 different flash apps. The all do the same exact thing, although each a little differently.

The first app scrolls a large block of text up the screen using a motion tween. The block of text is a dynamic text block that is hardcoded. Links are:
http://www.fusioncon.com/preview/flash/TweenScroll.fla
http://www.fusioncon.com/preview/flash/TweenScroll.html

The second app scrolls a large block of text up the screen using onClipEvent(enterFrame) to alter the _y value of a dynamically attached movie clip. The block of text is created using createTextField and the text is passed to it at the time the movie is attached. Links are:
http://www.fusioncon.com/preview/flash/ScriptScroll.fla
http://www.fusioncon.com/preview/fla...iptScroll.html

The third app is identical to the second app (dynamically attached movie clip, text block is made with createTextField, moved with enterFrame) except that in this case the font used is embedded. Links are:
http://www.fusioncon.com/preview/flash/EmbedScroll.fla
http://www.fusioncon.com/preview/flash/EmbedScroll.html

On a slower computer (500mhz), the first app will appear to move fairly quickly, will stutter a little bit, but it will stay consistent even when the full text is on the screen. The second app will move more smoothly at first, but as the full amount of text gets onto the screen it will slow down a bit. The third app will also move more smoothly at first, but as the full amount of text gets onto the screen it slows down even more. The font in the second and third app is the same, except that in the third app it is embedded.

So what is it about embedded fonts that makes flash use more processing power?

The real-world problem we are having with this is that we have some applications that read data from external sources via flash remoting, some of which is displayed as text fields in flash. We use createTextField objects to make the textfields to display this data, and sometimes the performance isn't all that great, especially on slower machines. Some of the textfields are required to be presented by fading them in, and we manipulate the alpha of the movieclip the textfield is in to accomplish this, and that requires the font used to be embedded, or at least we couldn't get alpha to work without it being embedded. But using embedded fonts seems to be causing part of the performance issue.

Note that if you scale the size of the browser to be smaller, the second and third apps can eventually keep the scroll speed consistent, so it appears to be a performance issue with the raw amount of pixels that flash has to draw on the screen. The textfields in these examples were made large to show the difference in performance more easily, in our real apps we have smaller textfields, but there are also multiple textfields, so the net effect is similar and we see slowdown on slower cpu's.

Now, I am aware that there is a trick for fades where you don't change the alpha of the object you are fading in, but instead place a graphic or vector in a layer above that object that you want to fade in, and then change the transparency of the graphic or vector to allow the object to appear through it gradually until it is fully visible. I don't want to do that though, because in addition to all of the different size/shaped/format textfield objects we have in our library, I will have to create a different size/shaped graphic/vector for each one, and theres quite a lot of them, so I am trying to avoid going that route.

Thanks in advance if you took the time to read this, I know its a bit long...

View Replies !    View Related
OnPress For Text Created By CreateTextField()?
I understand the default type for createTextField is dynamic, is it possible to assign onPress and other "button" functions to text created with createTextField?

How could I assign an onPress to the following?
code:
this.createTextField('myText', 1, 0, 0, 100, 100);
this.myText.text ='a link';


thanks for any help

View Replies !    View Related
CreateTextfield, Not Wrapping Text Properly :(
Afternoon guys,

I am using createTextField() for the first time. So far it working just about. For some strange reason some of the text wont wrap. I have tried to increase the width of the text field but this is not helping.
If you check the link and broswe the news story dated 13/04/2005 you will see what i am talking about.
http://www.innovativedesigns.me.uk/rk/
code:
if (newsImg.length>0) {
this.createTextField("newsText", 1, 105, 22, 320, 190);
my_fmt = new TextFormat();
my_fmt.color = 0xffffff;
my_fmt.font = "FFF Business";
newsText.embedFonts = true;
my_fmt.size = 8;
newsText.multiline = true;
newsText.wordWrap = true;
newsText.html = true;
newsText.selectable = false;
newsText.border = false;
newsText.htmlText = newsStory;
newsText.setTextFormat(my_fmt);
img.gotoAndStop(2);
img.img.imgUrl = newsImg;
} else {
this.createTextField("newsText", 1, 0, 22, 400, 190);
my_fmt = new TextFormat();
my_fmt.color = 0xffffff;
my_fmt.font = "FFF Business";
newsText.embedFonts = true;
my_fmt.size = 8;
newsText.multiline = true;
newsText.wordWrap = true;
newsText.html = true;
newsText.selectable = false;
newsText.border = false;
newsText.htmlText = newsStory;
newsText.setTextFormat(my_fmt);
}


Can anyone see where i am going wrong?

View Replies !    View Related
[F8] CreateTextField And External Text Problems
I'm basically trying to get text loaded via an XML file to behave as if it were an image (ie effect alpha etc)

It all must be done through action script and not on the stage as everything in the application is generated on the fly. At the minute i'm loading the text into a CreateTextField, however the text is selectable and can't be treated in the same way as my image movieclips (loaded via. LoadMovie() )

Is there any way through actionscript to break text into vectors and convert to a symbol? or even just a way to import the text so as it displays as a graphic?

View Replies !    View Related
CreateTextfield, Not Wrapping Text Properly :(
Afternoon guys,

I am using createTextField() for the first time. So far it working just about. For some strange reason some of the text wont wrap. I have tried to increase the width of the text field but this is not helping.
If you check the link and broswe the news story dated 13/04/2005 you will see what i am talking about.
http://www.innovativedesigns.me.uk/rk/

ActionScript Code:
if (newsImg.length>0) {
        this.createTextField("newsText", 1, 105, 22, 320, 190);
        my_fmt = new TextFormat();
        my_fmt.color = 0xffffff;
        my_fmt.font = "FFF Business";
        newsText.embedFonts = true;
        my_fmt.size = 8;
        newsText.multiline = true;
        newsText.wordWrap = true;
        newsText.html = true;
        newsText.selectable = false;
        newsText.border = false;
        newsText.htmlText = newsStory;
        newsText.setTextFormat(my_fmt);
        img.gotoAndStop(2);
        img.img.imgUrl = newsImg;
    } else {
        this.createTextField("newsText", 1, 0, 22, 400, 190);
        my_fmt = new TextFormat();
        my_fmt.color = 0xffffff;
        my_fmt.font = "FFF Business";
        newsText.embedFonts = true;
        my_fmt.size = 8;
        newsText.multiline = true;
        newsText.wordWrap = true;
        newsText.html = true;
        newsText.selectable = false;
        newsText.border = false;
        newsText.htmlText = newsStory;
        newsText.setTextFormat(my_fmt);
    }

Can anyone see where i am going wrong?

View Replies !    View Related
CreateTextField() Not Displaying. Dynamic Text
Hi

Im trying to create textfield inside my movieclip dynamically (at runtime). So I created a function called "CreateTextField()" which accepts parameters, including the "instanceName" and "txtValue".

Inside that function is a MovieClip.createTextField() function that takes the values and creates a textfield with the "instanceName" provided and assigns a value to the .text property of the textfield through "txtValue".

The code compiles. But it just doesnt want to show the textfield.

What Ive got in my constructor is:

ActionScript Code:
CreateTextField("txtNum", "02.", 0, 120, 18, 30, 30);


The CreateTextField function:

ActionScript Code:
public function CreateTextField(instanceName:String, txtValue:String, depth:Number, x:Number, y:Number, width:Number, height:Number)    {        mcButton.createTextField(instanceName, depth, x, y, width, height);        trace(mcButton.instanceName._name);                //format information for the textfield        var txtFieldFormat = new TextFormat();                     //format the look of the textfield        txtFieldFormat.bold = true;        txtFieldFormat.color = 0xFFFFFF;        txtFieldFormat.font = "_sans";            //assign a value to the textfield        mcButton.instanceName.text = txtValue;        mcButton.instanceName.setTextFormat(txtFieldFormat);    }


Does any one have an idea as to whats going on. I think it has to do with my instanceName as when i run trace it outputs: undefined

Any help would be great

Cheers

View Replies !    View Related
CreateTextField And Changing Text Color
What im trying to do is: have a dynamically created text field change color when i roll over a movieclip.

This is what i have:
a movie clip with this code:

Code:
this.createTextField("header", 99, 10, 10, 100, 300);
header.autoSize = true;
header.embedFonts = true;
var my_fmt:TextFormat = new TextFormat();
my_fmt.size = 50;
my_fmt.color = 0x9A9A9A;
my_fmt.font = "Impact";
header.setNewTextFormat(my_fmt);
Now 2 instances of this moveiclip are placed inside another movieclip. Each one showing a different text. (these instance are to act like buttons)

INSTANCE 1:

Code:
onClipEvent (enterFrame)
{
this.header.text = "SOUP";
}
INSTANCE 2:

Code:
onClipEvent (enterFrame)
{
this.header.text = "PIZZA";
}
The dynamically created textfield (lets call it "header") works fine. However, i cannot seem to get the text field to change color once you roll over the instances. I've tried using "

Code:
on (rollover) {
this.header.textColor = 0xFFFFFF;"
}
, but no such luck....can anyone point me in the right direction.

Thanks.

View Replies !    View Related
AS2: Adjust Text Box Height (createTextField)
I'm trying to dynamically create a static text field on the stage, but I want it to automatically shrink to the smallest height possible, much like a static text box dragged created using the Text Tool. I don't know how to get it to work, so hopefully there is an easy answer.

Here's my code at current:

ActionScript Code:
_root.createTextField("text_box"+i,i,10,10,530,100);            _root["text_box"+i].type = "static";            _root["text_box"+i].text = text_arr[i];            _root["text_box"+i].wordWrap = true;            _root["text_box"+i].multiline = true;


Thanks a lot!

View Replies !    View Related
Help.. CreateTextField And Reading A Text File
hi,

i have a movieclip and it's action creates a textfield:

onClipEvent(load) {

this.createTextField("words", 1, 0, 0, 400, 300); //words.autosize = "left";
words.type = "dynamic";
words.multiline = true;
words.wordWrap = true;
words.border = true;
words.background = false;
words.html = false;
words.embedFonts = false;

formatStyle = new TextFormat();
formatStyle.color = 0xff0000;
formatStyle.font = "Verdana";
formatStyle.size = 10;
formatStyle.textColor = 0x000000;

//words.text = "This is a test of the emergency broadcasting system."
words.setTextFormat(formatStyle);

}

i want to read a text file in my created text field, words. i am confused as to where to place the loadVariables("words.txt", words);

i tried doing words.text = this.loadVariables("words.txt", words); inside the clip load event.. i tried placing it at the beginning before creating the text field, and after creating the text field.. under formatStyle... those didn't work.

any help would be appreciated. thanks. my text file is in the same directory as the .fla

View Replies !    View Related
AS2 - Problem With Dynamic Text In Createtextfield
Code:

function anima_banner(XMLObj){

var container:MovieClip = this.__mc.bholder.fotos;
var viewer:GetImage = new GetImage(container, 137, 98, 0xFFFFFF);

var titulo:MovieClip = this.__mc.bholder.btit_txt

img = XMLObj.childNodes[1].childNodes[4].firstChild.nodeValue;
trace(img)

t1 = XMLObj.childNodes[1].attributes.titulo_esp
trace(t1)

titulo.text = "t1"

var my_fmt:TextFormat = titulo.getTextFormat();
for (var prop in my_fmt) {
trace(prop+": "+my_fmt[prop]);
}

foto = path_fotos+img
viewer.loadImage(foto);

/*titulo_txt.text = "de"
trace("t "+tmp.text)
*/
}
function crea(XMLObj){
//trace(XMLObj)

var b_mc = this.__mc.createEmptyMovieClip(("bholder"), this.__mc.getNextHighestDepth());
b_mc._x = 43
b_mc._y = 184

var f_mc = b_mc.createEmptyMovieClip(("fotos"), b_mc.getNextHighestDepth());
f_mc._x = 125
f_mc._y = 0

var titulo_txt = b_mc.createTextField("btit_txt",b_mc.getNextHighestDepth(),0,0,125,31);
var my_fmt_ti:TextFormat = new TextFormat();
my_fmt_ti.color = 0x000000;
my_fmt_ti.font = "Futura LT Condensed";
my_fmt_ti.align = "right"
my_fmt_ti.size = 23
titulo_txt.embedFonts = true;
titulo_txt.text = "a"
titulo_txt.autoSize = false;
titulo_txt.variable = "titulo";
titulo_txt.type = "dynamic";
titulo_txt.setTextFormat(my_fmt_ti);

var texto_txt = b_mc.createTextField("btex_txt",b_mc.getNextHighestDepth(),0,31,125,45);
var my_fmt_te:TextFormat = new TextFormat();
my_fmt_te.color = 0x000000;
my_fmt_te.font = "Futura LT Book";
my_fmt_te.align = "right"
my_fmt_te.size = 12
texto_txt.embedFonts = true;
texto_txt.text = "b"
texto_txt.autoSize = false;
texto_txt.variable = "texto";
texto_txt.type = "dynamic";
texto_txt.setTextFormat(my_fmt_te);

var fecha_txt = b_mc.createTextField("bfec_txt"+i,b_mc.getNextHighestDepth(),0,76,125,17);
var my_fmt_fe:TextFormat = new TextFormat();
my_fmt_fe.color = 0x000000;
my_fmt_fe.font = "Futura LT Book";
my_fmt_fe.align = "right"
my_fmt_fe.size = 10
fecha_txt.embedFonts = true;
fecha_txt.text = "c"
fecha_txt.autoSize = false;
fecha_txt.variable = "fecha";
fecha_txt.type = "dynamic";
fecha_txt.setTextFormat(my_fmt_fe);

this.anima_banner(XMLObj)

}
well my problem is that i call crea with an xmlobject i create dynamic movieclips and dynamic textfields

if i see that i see it ok
but when i try to chance one of the dynamic textfields i create the text disappear.
i dont know whats happening.
can someone help me.
thanks

View Replies !    View Related
Dynamic Text Woes With CreateTextField
Just when I think I have this text stuff under wraps...

I'm creating a number of text fields using createTextField(). Flash help states that these fields are set to "dynamic" by default, but for some reason mine are showing up as "input". Not a big deal, I can change it anyway, the problem is that for some reason the code below produces a number of visible (bordered and backgrounded) text boxes with no visible text in them (in spite of the fact that the debugger shows me that the my_txt.text property has a value) any thoughts?


Code:

wid=200;
hgt=80;
myx=0;
myy=0;
this.Token_mc.createEmptyMovieClip("Items_mc", this.Token_mc.getNextHighestDepth())
for (i=0;i<_global.numItems;i++)
{
this.Token_mc.Items_mc.createTextField("test"+i,this.Token_mc.Items_mc.getNextHighestDepth(),myx,myy+(i*hgt), wid, hgt);
eval("this.Token_mc.Items_mc.test"+i).type="dynamic";
eval("this.Token_mc.Items_mc.test"+i).font = "Verdana";
eval("this.Token_mc.Items_mc.test"+i).embedFonts = true;
eval("this.Token_mc.Items_mc.test"+i).border=true;
if (i%2==0)
{
eval("this.Token_mc.Items_mc.test"+i).background=true;
eval("this.Token_mc.Items_mc.test"+i).backgroundColor=0xCCCCCC;
}
eval("this.Token_mc.Items_mc.test"+i).selectable=true;
eval("this.Token_mc.Items_mc.test"+i).text="Testing "+i;
}

View Replies !    View Related
Formating Input Text Created With CreateTextField
I have created input text fields using createTextField and want to format the text typed by the user. My first though was to use the same method you'd use to format Dynamic text. This works if you have an existing value in the input field but as soon as the user begins to type in that field, the text is formated based on default values. To fix this, I used an onChanged function so that everytime the characters change in theat field they are reformated based on my specifications. The only trouble with is it seems inefficient. Is there a better way to do this other than the below code?

code: //<-------createTextFields------->
//Name Input
this.createTextField ("a",2,61,68,178,20);
//Company Input
this.createTextField("b",3,245,68,178,20);
//phone input
this.createTextField ("c",4,61,90,178,20);
//e-mail Input
this.createTextField("d",5,61,112,178,20);
//<-------Text Fields End-------->
this.onLoad = function() {
textFieldArray = new Array (a, b, c, d);
textFormat = new TextFormat
textFormat.color = 0x000000;
textFormat.bullet = false;
textFormat.underline = false;
textFormat.size = 14;
for (i=0; i<textFieldArray.length; i++) {
textFieldArray[i].type = "input"
textFieldArray[i].background = true;
textFieldArray[i].backgroundColor = 0xCCCCCC;
textFieldArray[i].border = true;
textFieldArray[i].borderColor = 0x000000
textFieldArray[i].setTextFormat(textFormat);
textFieldArray[i].onChanged = function() {
this.setTextFormat(textFormat);
}
}
}

View Replies !    View Related
Text Problems With Embedded Movies Etc - CreateTextField
just a friendly reminder to people having probs with createTextField..
ALWAYS REMEMBER TO SET THE LINKAGE TO THE FONT NAME ON YOUR EMBEDDED FONTS!! I just spent hours trying to fix a problem, and all that was wrong was that F*ing linkage entry I thought i'd set already!!

View Replies !    View Related
Rotating Text Fields Created With CreateTextField
i've created a movie clip that contains several text fields created using createTextField. that bit all works fine, but when i rotate the movie clip the text inside is no longer visible. the fields all have fonts embedded correctly (i think, because the movie clip is masked and the mask works fine). I've tried rotating the text fields individually using textfield._rotation, but this also make the text invisible.

anyone got any ideas?

muchos grassy ass.

View Replies !    View Related
CreateTextField Text Location - Simple Question
please help me with a simple problem.

im using CreateTextField to get data from php, no problem there, but the placement of the text has be baffled.

here's what i got:

here.CreateTextField("t_txt", 1, 1, 1, 10, 10);
here.t_txt.Size = 12

what i WANT is to put the text in the top middle of the movie but no matter what i change in the number it just moves to strange places in different sizes and sometimes cut in half, heres a screenshot of current one.



also, one other thing, this number basically keeps track of people in a chatroom, how can i get flash to refresh itself every few seconds to ensure it has the latest number, just have 2 frames the same and loop them?

View Replies !    View Related
CreateTextField -> Dynamic Text -> Embed Different Language
Hi folks. That's my first message on this forum. Whatever..

When I create a text box by usig text box tool, I can embed the fonts and the Turkish characters with embed button (autofill).

But when I create a text field by AS2.0, I can embed the font but text box shows only the English charachters with my font.

What can I do about it?

View Replies !    View Related
CreateTextField Text Location - Simple Question
please help me with a simple problem.

im using CreateTextField to get data from php, no problem there, but the placement of the text has be baffled.

here's what i got:

here.CreateTextField("t_txt", 1, 1, 1, 10, 10);
here.t_txt.Size = 12

what i WANT is to put the text in the top middle of the movie but no matter what i change in the number it just moves to strange places in different sizes and sometimes cut in half, heres a screenshot of current one.



also, one other thing, this number basically keeps track of people in a chatroom, how can i get flash to refresh itself every few seconds to ensure it has the latest number, just have 2 frames the same and loop them?

View Replies !    View Related
CreateTextField And _height: Problem With Placement Of Text Fields
I'm using createTextField to create several text fields dynamically. I'm also using an external XML file and a style sheet to populate the text fields.

My problem is that I'm trying to position the various text fields on the page so that they are spaced evenly on the page (regardless of how much content they might contain). I'm trying to use _height of the prior text fields to place subsequent text fields, but I'm getting very inconsistent results. When I trace the value of _height, I get differing results, even if I don't actually change any of the parameters. So, the question is...is there a way for Flash to get the height of a dynamically created text field that's populated via an exteral XML file and using CSS? I know that's asking a lot, but I'm trying to avoid using scroll bars if at all possible.

Thanks for any pointers.

Bill

View Replies !    View Related
Read Text File, Embed Font, CreateTextField Help
hi,

i have an external text file i am reading into a movie clip that creates a textfield using createTextField. i want to mask the text.. i have embedded the font by going to the Library > New Font, etc. but my text still doesn't show up.

also, the text, regardless without the mask will not show up if in the createTextField, i set embedFonts = true;

can someone take a look at this? any help would be appreciated.

here is the fla and text file:

www.mcs.drexel.edu/~tlta/loadText.zip

View Replies !    View Related
Read Text File, Embed Font, CreateTextField Help
hi,

i have an external text file i am reading into a movie clip that creates a textfield using createTextField. i want to mask the text.. i have embedded the font by going to the Library > New Font, etc. but my text still doesn't show up.

also, the text, regardless without the mask will not show up if in the createTextField, i set embedFonts = true;

can someone take a look at this? any help would be appreciated.

here is the fla and text file:

www.mcs.drexel.edu/~tlta/loadText.zip

View Replies !    View Related
Dynamic Text From PHP Using LoadVars & CreateTextField & Attach Component Scrollbars
I've been trying to combine the follow two tutorials without much success:
http://www.flashguru.co.uk/000026.php
http://www.macromedia.com/support/fl...t_scrollmx.htm

On frame 1 I attempt to use loadVars() to grab a variable written from a PHP script:
code: loadVarsText = new loadVars();
loadVarsText.load("variables.php?category=news");

loadVarsText.onLoad = function(success) {
if (success) {
trace("done loading");
// make a variable to contain the "content" sent from PHP
textContent = this.content;
} else {
trace("not loaded");
}
};

...The PHP script spits back:

PHP Code:



echo 'content='.rawurlencode($content);




...And on frame 2, I try to build and populate a textbox w/ scrollbar component attached:
code: this.createTextField("myTextField", 1, 35, 75, 230, 270);
myTextField.wordWrap = true;
myTextField.font = "Verdana";
myTextField.textColor = 0x000033;
myTextField.size = 10;
myTextField.html = true;
myTextField.htmlText = textContent;
// attach & set up the scrollbar
initialization = {_targetInstanceName:"myTextField", horizontal:false};
this.attachMovie("FScrollBarSymbol", "myScrollBar", 2, initialization);
myScrollBar._x = (myTextField._width + 35);
myScrollBar._y = 75;
myScrollBar.setSize(myTextField._height);
stop();


No dice, though. Any insight would be overwelmingly appreciated! Thank you kindly

argh|pal|www.dumb-dumb.com

View Replies !    View Related
Textfield.embedFonts Doesn't Work With Text Fields Created From CreateTextField()?
hi all,

I've created a text field with createTextField()

here is my Code:


Code:
mcText.createTextField("tf", 1, 0, 0, 0, 0);
mcText.tf.multiline = true;
mcText.tf.autoSize = "left";
mcText.tf.selectable = false;
mcText.tf.border = false;
mcText.tf.textColor = 0xffffff; //(1)
mcText.tf.type = "dynamic";
and format the text field

Code:
myTextFormat = new TextFormat();
myTextFormat.font = "Verdana";
myTextFormat.size = "10pt";
myTextFormat.color = 0xffffff;
mcText.tf.setTextFormat(myTextFormat);
I also noted that this format code doesn't work for the text field I created (for instance, when I deleted the line
(1) it didn't appear in white at all?

I don't know why but this line of code made the text white but didn't make it 10pt ???

Code:
mcText.tf.setNewTextFormat(myTextFormat);
later I load into that text from a text file

Code:
loadVarsText = new loadVars();
loadVarsText.load("test.txt");
loadVarsText.onLoad = function(success) {
if (success) {
mcText.tf.Text = this.var1;
}
};
without the formatcode the text appeared, how to say..., very ugly?

I also tried with

Code:
mcText.tf.html = true;
...
mcText.tf.htmlText = this.varText;
but it didn't seem to solve the problem

Experts, please help. It's urgent !

Thanks in advance

==========

[Edited by huynt on 08-26-2002 at 11:58 PM]

View Replies !    View Related
Problem Making Multiple Dynamic Text Boxes With "createTextField"
Hello FK community!

I am relatively fresh to ActionScript since all my work so far has been done in the "graphic" part of the flash. This time I am trying to swim in ActionScript that calculates the several astronomical positions and would like to know if it is possible to create more than 1 dynamic text box with createTextField command and followed by setTextFormat? If I tried to do it in a row Flash will display only the last one.

I could not find this in the manual and don't know how to solve this problem. I tried with creating dynamic text boxes, but found it is almost impossible to control the "bold" and "align" like that. And with more than 20 dynamic boxes things get complicated even more...

Help is appreciated!

Best regards, David

View Replies !    View Related
CreateTextfield And For
Hi,
my problem is that only the last button is displayed on the screen.
count is 6!

for (i=1; i<=count; i++){
_root.createTextField("button"+i,1,30,30+(i*20),80 ,50);
_root["button"+i].text = "Button" +i;
trace(i);
}

any idea?

View Replies !    View Related
CreateTextField
Hi there,

1. I am going to use the action to createTextField in the MC of navMC
2. loop 5 times and postion the textField down 50pix

Can u pls help me to check the code below?

Cheers


PHP Code:



_root.createEmptyMovieClip("navMC", 1);
for (i=0; i<5; i++) {
    _root.navMC.createTextField("navText", i+1, 100, 100, 500, 100);
    with (_root.navMC.navText) {
        _y += 50;
        multiline = false;
        selectable = false;
        wordWrap = false;
        border = false;
        myformat = new TextFormat();
        myformat.color = 0xff0000;
        //myformat.font = "Verdana";
        myformat.bullet = false;
        myformat.underline = false;
        text = "this is line" + " " + i
        mytext.setTextFormat(myformat);
    }
}

View Replies !    View Related
CreateTextField In AS2
Does anyone know how to use createTextField within a method

I have tried, and searched but am unable to.

View Replies !    View Related
CreateTextField
Why is this not working. The xml file is loading ok. The problem is with the creatTextField(). It does create it because I can select it when it is published but the text is not showing up. Even if I try to place text directly like
t.htmlText ="testing text";


Code:
XML.prototype.ignoreWhite = true;
var my_fmt:TextFormat = new TextFormat();
my_fmt.font = "Univers 55";
function loadXML(url, target) {
main_xml = new XML();
main_xml.load(url);
var t = target.createTextField("_text", target.getNextHighestDepth(), 0, -100, 200, 300);
t.html = true;
t.autoSize = true;
t.multiline = true;
t.type = "dynamic";
t.wordWrap = true;
t.selectable=true;
main_xml.onLoad = function(success) {
if (success) {
//t.styleSheet = myCSS;
t.htmlText =main_xml;
t.setTextFormat(my_fmt);
}
};
}

View Replies !    View Related
CreateTextField()
I am trying to create a textField at runtime and format it. I am using the following code:


Code:
_root.createTextField("imageDesc", 3, 0, 0, 300, 50);
imageDesc.font = "Trebuchet MS";
imageDesc.size = 14;
imageDesc.textColor = 0xFF0000;
imageDesc.multiline = true;
imageDesc.wordWrap = true;
It all works except it isn't taking the font size or the font type. Can anyone tell me why that is?

Thanks

View Replies !    View Related
Help With CreateTextField
I am trying to create a empty movieclip with actionscript then use createTextfield. This movieclip will then animate across the screen. Everything works, but I am trying to get the text to a bigger font and having no luck. Here is the code I am using

this.createEmptyMovieClip("myText_mc", 0);
myText_mc.createTextField("word_txt",0,20,100,100, 100);
myText_mc.word_txt.text = " Hi Britni";
myText_mc.onEnterFrame = function() {
this._x += 5;
};
If I set the width to a higher number the text stil does not get bigger.

View Replies !    View Related
CreateTextField
I am creating dynamically the following text filed (see script). I want flash to embed the font but it is not doing it. When I set the "embedFonts" command to TRUE the text doesn't come up when I rollover the buttons that send dynamically the text variable to the text field.

Right now it works but the font that comes up it is arial and it is too big and doen't brake toa third line, in other words: the user can't see the total label of some products.

What can I do to make flash embed the fonts I want?

Thanks a lot.

createTextField("paintingLabel_txt",10,53,380,160,44);
with(paintingLabel_txt){
background = false;
html = true;
multiline = false;
selectable = false;
type = "dynamic";
wordWrap = true;
restrict = null;
embedFonts = false;
}
var labelStyle:TextFormat = new TextFormat();
with(labelStyle){
font = "Univers LightUltraCondensed";
size = 15;
color = 0x989289;
}
paintingLabel_txt.setNewTextFormat(labelStyle);

View Replies !    View Related
[F8] Help With CreateTextField
I have no clue why this isn't working. This is really frustrating me, and there is nothing more really that I can explain, so I'll just post the code.

Code:
_root.createEmptyMovieClip("box_mc", _root.getNextHighestDepth());
box_mc.beginFill(0xFF0000);
box_mc.lineStyle(3, 0x000000, 100, true, "none", "none");
box_mc.moveTo(0, 0);
box_mc.lineTo(200, 0);
box_mc.lineStyle(2, 0x000000, 100, true, "none", "square");
box_mc.lineTo(200, 100);
box_mc.lineTo(0, 100);
box_mc.lineStyle(3, 0x000000, 100, true, "none", "none");
box_mc.lineTo(0, 0);
box_mc.endFill();
xx = 0;
yy = 0;
thewidth = 100;
theheight = 100;
box_mc.createTextField("mytext_box",
_root.getNextHighestDepth(), xx, yy, thewidth, theheight);
mytext_box.multiline = true;
mytext_box.selectable = false;
mytext_box.border = true;
mytext_box.wordWrap = true;
var fmt:TextFormat = new TextFormat();
fmt.color = 0x000000;
mytext_box.text = "Work you!";
mytext_box.setTextFormat(fmt);





box_mc.onEnterFrame = function():Void {
this._x = _root._xmouse;
this._y = _root._ymouse;
};
When it runs, it creates the red box and it follows the mouse just like I want, but there is NO TEXT BOX! Grrrrrrrrr, help please! Thanks in advance.

View Replies !    View Related
[F8] More Fun With CreateTextField
I am trying to create 7 text boxes named ITEM that will run vertical 45 pixels apart. I have tried a bunch of stuff, but nothing seems to work. here was my final idea.


PHP Code:



for (var i = 0; i<7; i++){
        var myItem = ['ITEM'+i+'_txt'];
        this.createTextField(myItem, i, 205, (215 + (i*45)), 165, 30);
        myItem.autoSize   = 'left';
        myItem.wordWrap   = true;
        myItem.selectable = false;
        myItem.embedFonts = bIsLatin;
        myItem.html       = true;
        myItem.htmlText   = rootNode.childNodes[1].childNodes[i].attributes.ITEM;
        myItem.setTextFormat(selectionText);
    }




anybody have any thoughts on this, or seee what I am doing wrong.

IMS

View Replies !    View Related
[F8] CreateTextField
I have been creating text fields using

createTextField

I notice that it doesn't go "Blue" indicating I think that its an allowed phrase (if that's the correct word...). The help files say use this.createTextField or put it within a movie clip?

But it seems to work fine without a movie clip to contain it, and without the "this"

So, what should I do? Do I always have to put the text within a mc (I need no interactivity at this point, just text that will be of varying length)

Apprecaite any comments

Edward

View Replies !    View Related
CreateTextField Help
Hi,

I am trying to create a dynamic text field that will control the number of lives a player will have in a simple game I am attempting to make.

I want the text field to be create dynamically. Could anyone point out where I am going wrong with the code below (actionscript 2). Nothing appears on screen.



Code:
this.createTextField("lives",9,10,10,100,50);
lives=6;
lives.txt = "lives" + lives;
lives.border = true;

View Replies !    View Related
CreateTextField Help
Hey All, does anyone have a snippit of code that will allow me to create a multiline textField (250x100) that I can:

1. set the text
2. render at HTML
3. set text color
4. embed linked font (verdana)
5. make scrollable - this one is pretty easy but I figure I would thorw it in for good measure.

Thanks Much, I have been fighting with the Flash text Beast for years now. Hopefuly this will put an end to that fight. Thanks, Dvl

View Replies !    View Related
CreateTextField
Hello,

I am creating a title using createTextField. Then I want to align some stuff to the bottom of the title, so I use:

var txtField:TextField = this.createTextField("txtField", this.getNextHighestDepth(), 0, 0, 200, 50);
txtField.text = 'My Title';

// this to the y
var yPos:Number = txtField.textHeight;

When I use this code and place my next mc at this Y position, it displays over the bottom of the text. It seems to align to the bottom of a 'x' but over right the dangly bit of a 'q' or 'g'

Does the createTextField have padding in it? Or is there a way to measure the pixel position of the bottom of the text?

Many thanks,

monk.e.boy

View Replies !    View Related
CreateTextField
I am working on project as under:

on first step ( screen) there are 2 text fields
user inserts text in a field and on the second text field same text appear as he types.

he clicks on a button to go to step 2

On the second step he has the written text from previous screen and buttons to change font, colors and position of the text box.

Thats it.

Can anybody help me how to do this or provide link.
I would appreciate your help

Thanks

View Replies !    View Related
CreateTextField Pb
Why isn't this working? I trace "myNews", it loads ok but the field myfield is undefined and i don't understand why.. can anyone help me?


ActionScript Code:
onClipEvent (load) {    loadText = new LoadVars();    loadText.load("TEXT.txt");    loadText.onLoad = function() {        _root.MCtexte.createTextField("myfield", 500, 15, 8, 387, 460);        //trace(_root.MCtexte.myfield);        _root.MCtexte.myfield.html = true;        _root.MCtexte.myfield.htmlText = this.myNews;        _root.MCtexte.myfield.condenseWhite = true;        _root.MCtexte.myfield.multiline = true;        _root.MCtexte.myfield.wordWrap = true;        //trace(this.myNews)    };}

View Replies !    View Related
CreateTextField
I'm using createTextField to make some tooltips. The AS dictionary says:

Quote:




A text field created with createTextField receives the following default TextFormat object:
font = "Times New Roman"




How or where can I change this font?

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved