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




Using Actions Script + CreateTextField To Add A Border



I cant seem to find a way in the documents to do this... You know how when u create an input text block on the stage there is a properties to put a border around it... it gives it a black border and a white background...

is there any way to create input text with these properties on the stage using actionscript? and make it selectable?



SitePoint > Design Your Site > Flash and Actionscript
Posted on: Jan 9, 2008, 13:28


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Linux: Unwanted Black Border On Left And Top Border In Mozilla
hello to all!
As the subject say, I'm having a visualization problem in Mozilla or Galeon (linux). It display an unwanted 1px black border on the top and left of the movie. I have tried any kind of publishing settings and changing the canvas background but seems doesn't solve this weird problem.
In konqueror it display well.
I have tried also changing the margin or paddings in css but without any result.
Any advice?

RE - Adding Border To Shape After Deleting Border...
I have a shape, a rectangle that I drew on my stage with a thin line border. I deleted the border, but now I decided that I'd like to add the border back. When I go to click on border - it gives the red slanted line symbol for no border. When I click on that and then click on a swatch, it just defaults back to the red line - meaning no border.

Is there a way to simply re-add the border without having to redraw the shape from scratch?

Thanks to anyone who can help.

Actions Are Overriding Other Actions Or Being Caught In A Loop Only On Double Click
I have a movie which I use actionscript to move things on/off stage to create different pages. Everything works great unless you double click a button.
When double clicking it makes objects "stick" in place and they will not move even though another command should make them move off stage (movie gets stuck). On a single click, the objects do what they are commanded to do. I even tried setting a variable to disable the button click if it has already been clicked. What causes this?

In the code below, the objects in the function home() will not leave the stage once the services button is double clicked (they are commaned to ease off the stage once other mc's are pressed) . BUT it works if only the services mc is only single clicked...please help. I'm pulling my hair on this one and about to start pulling my teeth.


if (_global.whichMovieLoaded != "services" && _global.isMovieLoaded != "stop") {
_global.whichMovieLoaded = "services";
services.onPress = function() {
remove();
function Pause() {
// bring home
home();

clearInterval(PauseInterval);
};

PauseInterval = setInterval(Pause,1000);

valet.easeY(400, 1.09);
itinerary.easeY(425, 1.09);
dining.easeY(400, 1.09);
ground.easeY(425, 1.09);
};
};



function remove(){
valettxt.fadeOut(9);
diningtxt.fadeOut(9);
itinerarytxt.fadeOut(9);
groundtxt.fadeOut(9);

mindtxt.fadeOut(9);
nauticaltxt.fadeOut(9);
scenictxt.fadeOut(9);
terrtxt.fadeOut(9);

mind.easeY(650, 1.09);
nautical.easeY(650, 1.09);
terr.easeY(650, 1.09);
scenic.easeY(650, 1.09);

valet.easeY(650, 1.09);
itinerary.easeY(650, 1.09);
dining.easeY(650, 1.09);
ground.easeY(650, 1.09);

logo.easeX(950);

imageLoader.unloadMovie();

};
//takes objects back to the home page
function home(){
maui.easeX(200, 1.09);
con.easeX(200, 1.09);
bar.easeX(625, 1.09);
patio.easeX(400, 1.00);
patio.fadeIn(2);
discover.easeX(625, 1.09);
discover.fadeIn(1);
imageLoader._alpha = 0;
VIP.fadeIn(.9);
};

Actions On The Main Page..do They Affect Actions On Movie Buttons?
ON the home page I've created, the buttons I used with the code in my previous thread ("two questions about HTML publishing and buttons"), I added an on rollover action to the actions layer of the main timeline (not the movie button timeline) so that on rollover, a picture would change according to the button that was rolled over. I did this for all three buttons. The rollover action works great, but now the links don't work in either the html OR the swf version. Would the added action disable the movie-clip button actions? Here's the added main timeline code, edited for space: photobtn_mc.onRollOver = function() {
gotoAndStop(2);
photobtn_mc.onRollOut = function() {
gotoAndStop(1); ( Again, help is greatly appreciated!)

Actions On Clip Kill Parent Actions? Workaround?
Hello, i have a nav clip, with rollover actions. When the nav clip is rolled over, i want the nav to zoom in. Which isn't a problem,
there are 6 buttons inside the nav clip which have onRelease actions. However, since the nav clip (the parent to the buttons clip) has the rollover state, it kills the actions of the buttons. Is there a workaround for this?

here is my code, the clip structure is nav.buttons.but1 etc.

code:
Stage.scaleMode = 'noScale';
import flash.filters.*;
//------------------------------------------------------------------------------------------------------------------
this.nav.onRollOver = function() {
};
this.nav.onRollOut = function() {
};
//------------------------------------------------------------------------------------------------------------------
for (i=1; i<=6; i++) {
nav.buttons["but"+i].onRelease = function() {
trace(this._name);
};
}

[mx2004] Actions Window Won't Show Actions
Well the problem is rather annoying and stops me from doing any work...

If I open my actions window, it opens up, but I just have a gray area inside the window, I can't put any scripting in, and even funnier, if I try to put my actions window locked into place it will actually crash flash entirely without any error message.

Any help would be much appreciated, thanks in advance!

[F8] Rewriting Button Actions To This.on Actions
Evening! I could do with a little help if possible - basically I need to combine a number of different button commands into script for a movieclip button.

I want these actions

PHP Code:




on (rollOver) {    // slider - Movie Clip's Instance Name. button_1 - Button's Instance Name.    slider.xMove = button_1._x;}on (rollOver) {    tellTarget ("_root.PC_Cursor") {        gotoAndStop("Finger");    }}on (rollOut) {    tellTarget ("_root.PC_Cursor") {        gotoAndPlay(1);    }}on (release) {    if (_root.CENTERpages.clip._currentframe == 10) {        _root.CENTERpages.clip.gotoAndPlay(11);    }}on (release) {    if (_root.world._currentframe == 2) {        _root.world.gotoAndPlay(1);    }}on (release) {    tellTarget ("_root.CENTERpages") {        gotoAndStop("name");    }}on (release) {    unloadMovieNum(1);}on (release) {    if (_root.CENTERpages.A1._currentframe == 1) {        _root.CENTERpages.A1.gotoAndPlay(2);    }}on (release) {    if (_root.CENTERpages.A2._currentframe == 1) {        _root.CENTERpages.A2.gotoAndPlay(2);    }}on (release) {    if (_root.CENTERpages.A3._currentframe == 1) {        _root.CENTERpages.A3.gotoAndPlay(2);    }}on (release) {    if (_root.CENTERpages.A4._currentframe == 1) {        _root.CENTERpages.A4.gotoAndPlay(2);    }}







to work like this in a movieclip:

PHP Code:




this.onRollover = function() {    // slider - Movie Clip's Instance Name. button_1 - Button's Instance Name.    slider.xMove = button_1._x;}this.onRollover = function() {    tellTarget ("_root.PC_Cursor") {        gotoAndStop("Finger");    }this.onRollout = function() {    tellTarget ("_root.PC_Cursor") {        gotoAndPlay(1);    }this.onRelease = function() {    if (_root.CENTERpages.clip._currentframe == 10) {        _root.CENTERpages.clip.gotoAndPlay(11);    }this.onRelease = function() {    if (_root.world._currentframe == 2) {        _root.world.gotoAndPlay(1);    }this.onRelease = function() {    tellTarget ("_root.CENTERpages") {        gotoAndStop("name");    }this.onRelease = function() {    unloadMovieNum(1);}this.onRelease = function() {    if (_root.CENTERpages.A1._currentframe == 1) {        _root.CENTERpages.A1.gotoAndPlay(2);    }this.onRelease = function() {    if (_root.CENTERpages.A2._currentframe == 1) {        _root.CENTERpages.A2.gotoAndPlay(2);    }this.onRelease = function() {    if (_root.CENTERpages.A3._currentframe == 1) {        _root.CENTERpages.A3.gotoAndPlay(2);    }this.onRelease = function() {    if (_root.CENTERpages.A4._currentframe == 1) {        _root.CENTERpages.A4.gotoAndPlay(2);    }







but it doesn't work!!! period! am I supposed to be keeping all of the functions together after I call the action? ie; all of the onrelease functions run on after a single this.onrelease call?
or have I took the wrong approach altogether on this?

Any pointers welcome!

Frame Actions Vs Object Actions
In preparation for AS3 which no longer supports object actions, I am on the process of converting flash movies created with Object actions in AS2 to Frame actions. While I understand some valid reasons for switching to Frame actions, I am discovering that converting button and clip actions to Frame actions is a very tedious process and so far, more than half the files I have tried to convert do not work. Having worked with Flash since version 3, I know about timelines, targeting and variable scope but this whole conversion process is driving me nuts! Is there a place that I can go to or tutorials available that teach how to attack this conversion? What are the main guidelines in converting from Object to Frame Actions? I have looked in the CS3 Help (from the program or Adobe online) and I have not found anything to guide me. Am I the only one experiencing this? Thanks for your help.
Yvan

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?

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);
    }
}

CreateTextField In AS2
Does anyone know how to use createTextField within a method

I have tried, and searched but am unable to.

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);
}
};
}

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

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.

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);

[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.

[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

[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

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;

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

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

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

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)    };}

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?

CreateTextField()
hi.

i'm looking for the most efficient way to program this:


Code:
for (var i:Number=0; i <= 7; i++){
// create 7 text fields

// place them in 7 equal columns across the stage
i thought i might need these variables to do it:


Code:
var stageWidth:Number = _width;
var numCols:Number = 7;
var indivColWidth = stageWidth/7;
but i am unsure how to go about writing this best.

any suggestions?

thanks. fumeng.

CreateTextField
I tried everything, it works perfectly without the loop but when I try to put it in a loop it displays nothing.
I figured out it has something to do with the naming of mytext, It seems it needs to be quoted I colored red where I think the fault is.

Code:
xwaarde = 20;
for(i=0;i<3;i++){
mytext = "mytext"+i;
_root.createTextField(mytext, i, xwaarde, 100, 50, 100);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.border = true;
mytext.text = "this is my first test field object text";
xwaarde = xwaarde+80;
}
the following works perfectly :

Code:
xwaarde = 20;
_root.createTextField("mytext", 0, xwaarde, 100, 50, 100);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.border = true;
mytext.text = "this is my first test field object text";
thanks

Help With CreateTextField
Trying to learn actionscript and I do not understand why I can not make the text width and height bigger but I can make it smaller. 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;
};

Help On Mc.createTextField
Quote:




Hi,
I'm trying to create multiple textfields, to load images onto them via html+loadvariables.


Code:
//frame 1
var i:Number = 1;

//frame 2-3-
if(i <= 10){
//instanceName, depth, x, y, width, height
this.createTextField("img_load"+i,+1,0,0,60,60)
// How do I change the other properties (aside from width/height, x & y) on the
// newly created text field? (the var value most importantly)
// doing img_load+i.class wont work, since all the text fields generated
// dynamically
i++;
}
Thanks in advance




edit- found http://www.actionscript.org/forums/s...d.php3?t=73115
for the solution.

Please delete this thread. Thanks

I Need Some Help With MC.createTextField
I'm working with a flash program that dynamically creates a user-specified amount of text fields in an MC using the createTextField function. However, it seems only one of the text fields will show up.

I've done some testing, and I found that when you create multiple text fields in an MC using this method, only the most recent one shows up. Is there any way to avoid this?

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)    };}

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?

CreateTextField()
hi.

i'm looking for the most efficient way to program this:


Code:
for (var i:Number=0; i <= 7; i++){
// create 7 text fields

// place them in 7 equal columns across the stage
i thought i might need these variables to do it:


Code:
var stageWidth:Number = _width;
var numCols:Number = 7;
var indivColWidth = stageWidth/7;
but i am unsure how to go about writing this best.

any suggestions?

thanks. fumeng.

CreateTextField
I tried everything, it works perfectly without the loop but when I try to put it in a loop it displays nothing.
I figured out it has something to do with the naming of mytext, It seems it needs to be quoted I colored red where I think the fault is.

Code:
xwaarde = 20;
for(i=0;i<3;i++){
mytext = "mytext"+i;
_root.createTextField(mytext, i, xwaarde, 100, 50, 100);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.border = true;
mytext.text = "this is my first test field object text";
xwaarde = xwaarde+80;
}
the following works perfectly :

Code:
xwaarde = 20;
_root.createTextField("mytext", 0, xwaarde, 100, 50, 100);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.border = true;
mytext.text = "this is my first test field object text";
thanks

CreateTextField
Have a question, is there a way to change the variable name of a dynamic text box that gets created via a createTextField?? I tried this:

text_box.variable = "box2";

but it doesn't work because it continues to pull in the original variable from the loadVariables("info.txt", "box") that I have in frame 1

I basically want it to change variables at different frames so it can cycle through

Sample Text file:

box=Here you are at the box&box2=Yes at box 2&box3=Final box&done=1

thanks for all your help!!!

CreateTextField()
is there any reason anyone can see why this text field I'm creating isn't displaying any text.....it will show the cursor change to a hand indicating that the <a> tag is working, however, the text physically isn't there...

can anyone help me?

_root.main.createTextField("newText", 10, 672, 23, 100, 15);
_root.main.newText.multiline = true;
_root.main.newText.wordWrap = true;
_root.main.newText.autoSize = true;
_root.main.newText.border = false;
_root.main.newText.font = "Arial";
_root.main.newText.size = 8;
_root.main.newText.textColor = 0x333333;
_root.main.newText.bold = false;
_root.main.newText.align = "left";
_root.main.newText.leftMargin = 0;
_root.main.newText.rightMargin = 0;
_root.main.newText.indent = 0;
_root.main.newText.leading = 0;
_root.main.newText.html = true;
_root.main.newText.htmlText = "<a href="asfunction:TestFunction,movie01">Testing</a>";

CSS/createTextField
Hey,

Has anyone encountered problems with dynamically created textfields and style sheets?

I'm building a textfield as follows:



ActionScript Code:
this.createTextField("dateField", this.getNextHighestDepth(), 0, 0, 160, 20);
this.dateField.wordWrap = true;
this.dateField.multiline = true;
this.dateField.autoSize = "left";
this.dateField.selectable = false;
this.dateField.condenseWhite = true;
this.dateField.html = true;
this.dateField.styleSheet = dateCSS;
this.dateField._y = this.stackHeight;
this.dateField.htmlText = dateVar;


dateCSS is properly loading, and has a class called dateTxt:

ActionScript Code:
.dateTxt{
    color: #666666;
    font-style : italic;
    font-family: Verdana,sans-serif;
    font-size: 12px;
}


And the htmlText for the dateField reads, "<span class="dateTxt">2/24/2005</span>"

So here's the issue-- I can control everything but the italics. Those simply get ignored.

Is this an embedded font issue? The documentation I've found on embedding fonts is spotty at best. (And, if so, how do I embed the font and link it to the dynamic textField and still invoke the classes in the CSS?)

Any advice/solutions are greatly appreciated.

Thanks!

CreateTextField
Hi guys,

I need to create several TextFields one under each other.

The fields need to be of a fixed width (250px), but depending on the content they will need varying heights - any help would be appretiated I can only seem to manually set the height!

Also on how to position the following field would be cool - thanks!

CreateTextField();
Hi,

Problem with myTextField.multiline = 1;

Just create a new text field via createTextField();

The multiline property did not work at all.

Please help

Thanks

exemple:

// Create a new text field
this.createTextField("myTextField", 1, 0, 0, 0, 0);
// Property
myTextField.type = "dynamic";
myTextField.autoSize = "left";
myTextField.multiline = 1;
// Create text format
myTextFormat = new TextFormat();
myTextFormat.embedFonts = 1;
myTextFormat.size = 8;
myTextFormat.color = 0x000000;
myTextFormat.font = "ceriph 07_55";
myTextFormat.align = "left";
// Set text format
myTextField.setNewTextFormat(myTextFormat);
//
stop();

CreateTextField? I Want More
Hi,

i'm see the method createTextField, but I wanna to create radio, checksan combos in a dynamic form, with actionscript. Have one chance? I thought in create a movieClip for each one and attach in my Scene?

Thanks

CreateTextfield With Loop
my problem is that my script is only makeing 12 new textfields: massage1,massage2 etc. it seems to overwrite:name and email.
Please take a look!

on (press) {

for (i=1; i<=12; i++) {

name = "name"+i;
email="email"+i
message="massage"+i

_root.createTextField(name, i, 125, 0,200,20);
_root.createTextField(email, i, 125, 20, 200,20);
_root.createTextField(message, i, 125, 40, 200, 20)

_root[name].type = "dynamic";
_root[email].type = "dynamic";
_root[message].type = "dynamic";

_root[name].border = true;
_root[email].border = true;
_root[message].border = true;

_root[name].text = eval("name" add i);
_root[email].text = eval("email" add i);
_root[message].text = eval("mess" add i);

_root[name]._y = 0+i*40
_root[email]._y = 20+i*40
_root[message]._y = 40+i*40


}
}

Rollover In A CreateTextfield?
This is (stripped) what I have now:

for (i=0; i<amount; i++) {
MasterPhotoHolder.createTextField("mytext" + i,i+3,10,i*25,100,50);
MasterPhotoHolder["mytext" + i].html = true;
MasterPhotoHolder["mytext" + i].htmlText = "<font color='#FFFFFC' ><u><a href="asfunction:_root.jump,Scene1">" + _level0.NAMEarray[i] + "</a></u></font>";
}

So the viewer sees a list of hyperlinked names.

What I want is a rollover behavior of the text. So that when the mouse goes over the text, BUD THE HYPERLINK IS NOT CLICKED, I call a function. (this function will show the photo of the person)

Can I give a textfield created like this a rollover behavior or not?

Thanks

Major Bug? CreateTextField
OK, so I made a work around to Flash not being able to pass object variables between loaded SWF, but now I find createTextField is screwing up.

This is the situation, I am dynamically building a menu. The menu file works under the following situations:
1. On its own in any situation.
2. When loaded into another movie in IE.

But, when loaded into another movie in Flash, or in the projector, the createTextField() method fails and I have blank menus with no labels.

I have done traces on all the targetpath()s and tried multiple methods of referencing the MC. The createTextField line is the only line that doesn't work.

Is there a maximum number of MC you can nest?

Is there a bug in createTextField?

Is there a bug in the player?

CreateTextField Question
Hi,

I want to create a textfield with the following script:

myformat = new TextFormat();
myformat.font = "Arial";
myformat.size = "12";
myformat.color = 0x54534B;
myformat.bullet = false;
myformat.align = "Right";

_root.createEmptyMovieClip("item"+1, 1);
with ("item"+1) {
createTextField("mytext"+1, 1, 50, 10, 250, 250);
eval("mytext"+1).embedFonts = true;
eval("mytext"+1).selectable = false;
eval("mytext"+1).multiline = true;
eval("mytext"+1).wordWrap = true;
eval("mytext"+1).border = false;
eval("mytext"+1).html = true;
eval("mytext"+1).htmlText = "<B>test</B><i>test</i>test";
eval("mytext"+1).setTextFormat(myformat);
}

I've embedded the font Arial in the library and Linked it for actionsctipt with the linkage name: "Arial"

But when I use HTML tags like: <B>test</B><i>test</i>test

....the text is not bold or italic...?

What am I doing wrong here? Please help!!

CreateTextField Help? My Code:
I am trying to make a flash movie for my client that will dynamically show a match record for his gaming team, and I cannot seem to figure out why I can't get it to work. It could be that the createTextField depths arent random and they need to be for them all to show up.


Code:
stop();
matches_xml = new XML();
matches_xml.load("scripts/matches.xml");
matches_xml.onLoad = startMatches;
matches_xml.ignoreWhite = true;


function startMatches(success) {
if (success == true) {
rootNode = matches_xml.firstChild;
firstMatchNode = rootNode.firstChild;
currentMatchNode = firstMatchNode;
totalMatches = rootNode.childNodes.length;
currentMatch = 1;
startTextFields(firstMatchNode);
}//if
}//function
//
function startTextFields(newMatchNode) {
matchDate = newMatchNode.attributes.matchDate;
matchFoe = newMatchNode.attributes.matchFoe;
matchType = newMatchNode.attributes.matchType;
matchMap = newMatchNode.attributes.matchMap;
matchFinal = newMatchNode.attributes.matchFinal;
matchStatus = newImageNode.firstChild.nodeValue;
makeTextFields1();
}//startTextFields
//
//
function finishTextFields() {
for(i=1; i<totalMatches; i++) {
currentY=currentY+15;
currentMatch=nextSibling;
makeTextFields1();
}
}
currentY=15;
function makeTextFields1() {
//DATE
this.createTextField("date_"+currentMatch, 1, 158, currentY, 50, 20) ;
this["date_"+currentMatch].text=matchDate;
this["date_"+currentMatch].textColor=0x96F0FF;
this["date_"+currentMatch].embedFonts=true;
myTextFormat = new TextFormat();
myTextFormat.font = "1FFFharmony";
myTextFormat.size = 8;
this["date_"+currentMatch].setTextFormat(myTextFormat);
//FOE
this.createTextField("foe_"+currentMatch, 2, 211, currentY, 50, 20) ;
this["foe_"+currentMatch].text=matchFoe;
this["foe_"+currentMatch].textColor=0x96F0FF;
this["foe_"+currentMatch].embedFonts=true;
myTextFormat = new TextFormat();
myTextFormat.font = "1FFFharmony";
myTextFormat.size = 8;
this["foe_"+currentMatch].setTextFormat(myTextFormat);
//TYPE
this.createTextField("type_"+currentMatch, 3, 242, currentY, 50, 20) ;
this["type_"+currentMatch].text=matchType;
this["type_"+currentMatch].textColor=0x96F0FF;
this["type_"+currentMatch].embedFonts=true;
myTextFormat = new TextFormat();
myTextFormat.font = "1FFFharmony";
myTextFormat.size = 8;
this["type_"+currentMatch].setTextFormat(myTextFormat);
//MAP
this.createTextField("map_"+currentMatch, 4, 281, currentY, 90, 20) ;
this["map_"+currentMatch].text=matchMap;
this["map_"+currentMatch].textColor=0x96F0FF;
this["map_"+currentMatch].embedFonts=true;
myTextFormat = new TextFormat();
myTextFormat.font = "1FFFharmony";
myTextFormat.size = 8;
this["map_"+currentMatch].setTextFormat(myTextFormat);
//FINAL
this.createTextField("final_"+currentMatch, 5, 372, currentY, 90, 20) ;
this["final_"+currentMatch].text=matchFinal;
this["final_"+currentMatch].textColor=0x96F0FF;
this["final_"+currentMatch].embedFonts=true;
myTextFormat = new TextFormat();
myTextFormat.font = "1FFFharmony";
myTextFormat.size = 8;
this["final_"+currentMatch].setTextFormat(myTextFormat);
//
}//makeTextFields1
finishTextFields();



I attached a sample of the xml file, and the flash. Please check it out and enlighten me. Else I might take forever in trying to make this work, and that would be bad for my client.

note: the data is going to be displayed in a table-like format, and the goal here, is to dynamically list as many nodes/matches that are in the XML file.

Thanks! =D

CreateTextField _x Position
Hi All

I've been working on something similar to what can be found here
http://www.macromedia.com/support/fl...textfields.htm

One thing that I can't figure out is how to position the text field in the scrollpane.

_root.myscroll.createTextField(mytextfield,i,30,my y,88,18);

I've made the scrollpane bigger and I've tried changing the x pos (30 in the example above).
But the text boxes still line up flush against the left hand side.
What I ultimately want to do is create another list of text boxes in the same scrollpane.

Any ideas?

thanks

CreateTextField And _level1
Does anyone know why createTextField in _level1 doesn't seem to work?
I have 2 movies. 1 is the main timeline and the other movie is loaded in level1. If I play the movie with the createTextField by itself it's fine, but when I load the movie with createTextField in level1 the createTextField doesn't work.

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);

Alignment And CreateTextField
I'm using a createTextField, and really it works great.
Except, if it's an input type, and I have the alignment set to anything but "left", then a person types inside it it still left justifys unless you "recreate" the mc using the text data after they typed it.
Here's my code:
code:
function bk_txt_text(comp) {
if (beenbkfont == "1") {
$bktxtfont = (_root.db_fontb.getSelectedItem().data);
} else {
$bktxtfont = "AntiqueOliT";
}
if (bktxt_place == "1") {
$bktxtx = $bktxtx;
$bktxty = $bktxty;
} else {
$bktxtx = "345";
$bktxty = "320";
}
if (_level0.btbeenalign != "1") {
_level0.back_txt_align = "center";
}
if (beenbktxttext == "1") {
$bk_txt_txt = _level0.bktxt;
} else {
$bk_txt_txt = "Your text here";
}
if (beentxtsizeb == "1") {
_level0.bts = _level0.btsx;
} else {
_level0.bts = 10;
}
//$bk_txt_txt = "Your text here";
_root.createTextField("bk_txt", 324, $bktxtx, $bktxty, 120, 70); // depth, x, y, width, height
txt_bk_myformat = new TextFormat();
txt_bk_myformat.size = _level0.bts;
txt_bk_myformat.color = 0x000000;
txt_bk_myformat.align = _level0.back_txt_align;
txt_bk_myformat.font = $bktxtfont;
txt_bk_myformat.bold = true;
txt_bk_myformat.bullet = false;
txt_bk_myformat.underline = false;
txt_bk_myformat.variable = "var_bk_txt";
bk_txt.embedFonts = true;
bk_txt.multiline = true;
bk_txt.wordWrap = true;
bk_txt.border = false;
bk_txt.type = "input";
bk_txt.text = $bk_txt_txt;
bk_txt.setTextFormat(txt_bk_myformat);
//
if (bktxtswitch == "1") {
setProperty("_root.bk_txt", _visible, "100");
} else {
setProperty("_root.bk_txt", _visible, "0");
}
//
bk_txt.onKillFocus = function() {
_level0.bktxt = bk_txt.text;
};
bk_txt.onSetFocus = function() {
_global.beenbktxttext = "1";
};

txt_bts_txt.text = _level0.bts;
//$btt = bk_txt.htmlText;
}

Yeah, I know it's kind of clumsy, but it's my 1st AS project.
And of course some of the variables are defined "off screen". Like level0.back_txt_align is defined using a radio button set with the options "left" "center" and "right".

Anyway my question is, is there a way when the centering is set to center or right, that the justify can BE that while it's clicked in and being typed in?

Thanks for any suggestions!!
Liam

Alignment And CreateTextField
(If this is a duplicate entry, my apologies. My browser crashed as I posted it the 1st time.)
I'm using a createTextField, and really it works great.
Except, if it's an input type, and I have the alignment set to anything but "left", then a person types inside it it still left justifys unless you "recreate" the mc using the text data after they typed it.
Here's my code:
code:
function bk_txt_text(comp) {
if (beenbkfont == "1") {
$bktxtfont = (_root.db_fontb.getSelectedItem().data);
} else {
$bktxtfont = "AntiqueOliT";
}
if (bktxt_place == "1") {
$bktxtx = $bktxtx;
$bktxty = $bktxty;
} else {
$bktxtx = "345";
$bktxty = "320";
}
if (_level0.btbeenalign != "1") {
_level0.back_txt_align = "center";
}
if (beenbktxttext == "1") {
$bk_txt_txt = _level0.bktxt;
} else {
$bk_txt_txt = "Your text here";
}
if (beentxtsizeb == "1") {
_level0.bts = _level0.btsx;
} else {
_level0.bts = 10;
}
//$bk_txt_txt = "Your text here";
_root.createTextField("bk_txt", 324, $bktxtx, $bktxty, 120, 70); // depth, x, y, width, height
txt_bk_myformat = new TextFormat();
txt_bk_myformat.size = _level0.bts;
txt_bk_myformat.color = 0x000000;
txt_bk_myformat.align = _level0.back_txt_align;
txt_bk_myformat.font = $bktxtfont;
txt_bk_myformat.bold = true;
txt_bk_myformat.bullet = false;
txt_bk_myformat.underline = false;
txt_bk_myformat.variable = "var_bk_txt";
bk_txt.embedFonts = true;
bk_txt.multiline = true;
bk_txt.wordWrap = true;
bk_txt.border = false;
bk_txt.type = "input";
bk_txt.text = $bk_txt_txt;
bk_txt.setTextFormat(txt_bk_myformat);
//
if (bktxtswitch == "1") {
setProperty("_root.bk_txt", _visible, "100");
} else {
setProperty("_root.bk_txt", _visible, "0");
}
//
bk_txt.onKillFocus = function() {
_level0.bktxt = bk_txt.text;
};
bk_txt.onSetFocus = function() {
_global.beenbktxttext = "1";
};

txt_bts_txt.text = _level0.bts;
//$btt = bk_txt.htmlText;
}

Yeah, I know it's kind of clumsy, but it's my 1st AS project.
And of course some of the variables are defined "off screen". Like level0.back_txt_align is defined using a radio button set with the options "left" "center" and "right".

Anyway my question is, is there a way when the centering is set to center or right, that the justify can BE that while it's clicked in and being typed in?

Thanks for any suggestions!!
Liam

Copyright © 2005-08 www.BigResource.com, All rights reserved