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




Multiple Dynamic Textfields.



Hi there,I am trying to show i (i can be any number) textfields.I created this actionscript for 1 textfield:var myTextField:TextField = new TextField();addChild(myTextField);myTextField.text = "TextField 1";myTextField.width = 250;myTextField.x = 0;myTextField.y = 0;myTextField.selectable = false;myTextField.border = true;myTextField.autoSize = TextFieldAutoSize.LEFT;var myFormat:TextFormat = new TextFormat();myFormat.color = 0x000000; myFormat.size = 24;myFormat.font = "Verdana";myTextField.setTextFormat(myFormat);But I have no idea how to make this code dynamic so that I can call ie:myTextField1.setTextFormat(myFormat);myTextField2.setTextFormat(myFormat);myTextField3.setTextFormat(myFormat);...myTextField.setTextFormat(myFormat);I tried this:var i:int = 0;var myTextField[ i ]:TextField = new TextField();addChild(myTextField[ i ]);But this is not working :(Thanks Peter.Edited: 12/05/2008 at 04:52:38 AM by pninos



Adobe > ActionScript 3
Posted on: 12/05/2008 04:48:03 AM


View Complete Forum Thread with Replies

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

Dynamic Naming Of Multiple TextFields
hey all,
Trying to created multiple textFields, in order to make a clickable index page (like a table of contents):

ActionScript Code:
package {
    import flash.events.*;
    import flash.text.*;
    import flash.utils.*;
    import flash.display.*;
    import flash.net.*;
    import flash.media.*;

    public class theIndex extends Sprite {

        var theSections:Array=new Array("Creating a lesson","Choosing a lesson","Opening a lesson");

        var doSections:TextField=new TextField();

        var indexY=10;
       

        public function theIndex() {

            for (var i:int=0; i < 3; i++) {

                var this["doThisSection"+i]:doSections=new doSections();
                var chapter;

                this["doThisSection"+i].x=100;
                this["doThisSection"+i].y=indexY * i*30;

                this["doThisSection"+i].text=theSections[i] + "
";
                this["doThisSection"+i].addEventListener(MouseEvent.MOUSE_DOWN,checkChapter);
                this["doThisSection"+i].name="p"+i;
                addChild(this["doThisSection"+i]);
                function checkChapter(event:MouseEvent) {
                    trace(this["doThisSection"+i].name);
                                    }

            }

        }
    }
}

But, when I compile it, I get:



HTML Code:
1084: Syntax error: expecting identifier before this.
What am I doing wrong??

Thx

Spacing Of Multiple Dynamic TextFields
Plug this straigh into Flash:


ActionScript Code:
createEmptyMovieClip("shell_mc", 99);
//-------ADD FORMATING
var myFormat:TextFormat = new TextFormat();
myFormat.size = 30;
//-------ADD TEXT
var temp:String = "P R O M O T I O N :";
var promotion:Array = temp.split(" ");
//-------DUPLICATE CLIPS
for (var i = 0; i<promotion.length; i++) {
    var mc = shell_mc.duplicateMovieClip("shell"+i+"_mc", i, {_x:80+25*i});
    mc.createTextField("_txt", 100, 0, 0, 70, 35);
    mc._txt.setNewTextFormat(myFormat);
    mc._txt.text = promotion[i];
}
How do you recommend to fix the spacing issue?

BTW, I did search!

Multiple Textfields?
Simple question... I hope. How can one create multiple textfields? trying e.g.


Code:

var textvalue:TextField = new TextField();
var format:TextFormat = new TextFormat();
format.size = 48;
textvalue.defaultTextFormat = format;

addChild(textvalue);
textvalue.text = "hi everyone";

addChild(textvalue);
textvalue.text = "hello world";
will only generate "hello world". Apparently second overwrites first, no?
Anyone?
t.i.a
P

Multiple TextFields...
I want to create multiple textfields, when i make 1 my code works, but if i put a loop around it, it doesn't do a thing. Is there anything wrong with this code?
======================================================
i = 0;
y = 100;
myformat = new TextFormat();
myformat.color = 0xff0000;
myformat.bullet = false;
myformat.underline = true;
while (i<5) {
if (i>0) {
var y = "text"+(i-1)._height+"text"+(i-1)._y+5;
}
_root.createTextField(("text"+i), i+1, 100, y, 300, 20);
("text"+i).border = true;
("text"+i).text = "text"+i;
("text"+i).setTextFormat(myformat);
i++;
}
======================================================

greetz
Stefano004

Scroll Bar And Multiple Textfields
I'm looking for a way or should I say the correct way to attach a scroll bar to multiple textfields. Is there a way to do that or whats the correct way to make that happen. I've got a mc that has multiple text fields all named the same instance. I drag a scroll bar component on stage and give it the target of the instance for the text fields and nothing.

Suggestions?

Creating Multiple Textfields
If I want to create textfields like this where represents the number of textfields to be created.

_level0.paneContent.createTextField("mytext"+i, 1, 100, 100, 300, 100);


How can I get the properties of each textfields?


_level0.paneContent.mytext +i.text = something;

(xml)Generate Multiple Textfields
Hey people, Im new to actionscript.org, well I've followed a lot of the tutorials here, and they have helped me alot!
But Now I have a question...

How do you generate multiple textareas in flash with only one xml file as information source: example

<text>
<fieldset1>this goes into one fieldset</fieldset1>
<fieldset2>this goes into second fieldset</fieldset2>
<fieldset3>this goes into third fieldset</fieldset3>
</text>
And I want fieldset two generated in a different textfield than for example fieldset 1 and 3.
Hope this makes sense!

Thanx in advance grtz T

Creating Multiple TextFields
I thought I knew what I was doing.

I'm creating a logbook form that has about 500 different input textFields. Using a simple for loop, I trying to create a portion of the textFields then change their properties to an Input textFeild that is prepopulated with data.

Here's the code:

var maxColumns:Number = 10;
var maxRows:Number = 8;
var tc_TabOrderStart = 13;
var xStart:Number = 256;
var yStart:Number = 123;
var xOffset:Number = 46.3;
var yOffset:Number = 21.8;
var txtFieldWidth:Number = 41;
var txtFieldHeight:Number = 81;
for (var j:Number = 0; j<maxRows; j++)
{
for (var i:Number = 0; i<maxColumns; i++)
{
var tc_tfld:String = "tc"+j+"_"+i;
trace("tc_tfld = "+tc_tfld);
this.createTextField(tc_tfld, this.getNextHighestDepth(), xStart+(xOffset*i), yStart+(yOffset*j), txtFieldWidth, txtFieldHeight);
with (this.tc_tfld)
{
type="input";
text = "DUMB";
}
}
}

Thanks for any help. I've been stuck for three days.

FlashVars And Multiple TextFields
I'm using AS3 and FlashVars to pass info from the page into the SWF to write content into a TextField. The whole process is actually using ASP to pull info from the URL and write it into the FlashVars field which in turn gets put into the TextField. I'ts working great - I've got the formatting and positioning and everything looking and functioning just how I want. My only problem is I'm a bit of an AS3 newbie and for the life of me I can't figure out how to use 2 different Variables to create 2 different TextFields. Thanks a lot.







Attach Code

// ACTIONSCRIPT:

var tf1:TextField = new TextField();
var myFormatWhite:TextFormat = new TextFormat();

myFormatWhite.font = "Times";
myFormatWhite.size = 36;
myFormatWhite.bold = true;
myFormatWhite.color = 0xCC0000;

tf1.x = 175;
tf1.y = 100;
tf1.border = false;
tf1.width = 200;
tf1.height = 200;
tf1.wordWrap = true;

addChild(tf1);

tf1.appendText("
");
try {
var keyStr1:String;
var valueStr1:String;
var paramObj1:Object = LoaderInfo(this.root.loaderInfo).parameters;
for (keyStr1 in paramObj1) {
valueStr1 = String(paramObj1[keyStr1]);
tf1.appendText(" " + keyStr1 + " " + valueStr1 + "
");
}
}

catch (error:Error) {
tf1.appendText(error.toString());
}

tf1.setTextFormat(myFormatWhite);




// PAGE CODE:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
width="550"
height="400"
align="middle"
id="lv_10">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="lv_10.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffcc" />
<param name="FlashVars" value="<%=Name%>" />
<embed src="lv_10.swf"
width="550"
height="400"
autostart="false"
quality="high"
bgcolor="#ffffcc"
FlashVars="<%=Name%>"
name="lv_10"
align="middle"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Targeting Multiple Textfields Within Duplicated MC's
Hey all,
I have a movie that contains one MC with the instance name of "MC". I have this clip duplicated 42 times across the screen. I'm using code similar to this:

Code:
on (press) {
_root.MC.duplicateMovieClip("MC" + _root.x, _root.x);
clip = _root["MC" + _root.x];
clip._x = _root._xmouse;
clip._y = _root._ymouse;
++_root.x;
}
In the MC there is a textfield with the variable "num". When the MC's are duplicated, they end up with the instance names MC0 - MC42. If I wanted the visible text in clip "MC3" to be the number "1" and to have each following MC to count up by one, how would I script this? I want to have the textfields to start out empty, but show digits starting with the number 1, on a certain duplicated MC (MC3) and count up from there. Any ideas?

Can I Assign 1 Scrollbar To Multiple Textfields?
Using the scrollbar control, can I assign it to more than 1 textfield.

I am creating a price list where I want 1 field with the descriptions and another with the prices. Both fields will be the same number of lines.

Cheers

Creating Multiple Textfields Programatically
hi I am doing some work with creating textfield programatically.

USING mx2004



The code is written to create 2 text fields with properties based on the value of tmp[i].

I am having trouble applying text formatting after I have created each of the texfields.

ANy Ideas? I have tried using eval("myTextFormat" + i) instead of just myFormat, it causes a syntax error. How can i get the formatting to apply for each textfield?

Thanks

______________________________________

CODE FOLLOWS
______________________________________

var jsVar1 = "100,50,ff,0xff0000,24,Verdana,false,false|100,100 ,gg,0xff9900,24,arial,false,false";
var elements = jsVar1.split("|");
trace(elements.length);
for(i = 0; i <= elements.length-1; i++)
{

tmp = elements[i].split(",");


for( k = 0; k <= elements.length-1; k++)
{
_root.createTextField("myPoint" + i , 100 + i ,100,100,85,85);
eval("myPoint" + i)._x = tmp[0];
eval("myPoint" + i)._y = tmp[1];
eval("myPoint" + i).text = tmp[2];
myFormat = new TextFormat();
myFormat.color = tmp[4];
myFormat.size = tmp[5];
myFormat.font = tmp[6];
eval("myPoint" + i).setTextFormat(myFormat);

}

}

[CS3] Can Static Textfields Have Multiple Fonts?
On compliling a movie, we are getting an error that reads :

two camps here: bad fontstoo many fonts in one static textfield
is suspect the later, but wanted to take this to the community. The file has multiple static textfields with different fonts in each field. For example, the text may ready" Hey, this is a textfield"-> the word "Hey" may be arial bold 19pt and the word "textfield" Helvetica Nue 25pt red.--but the entire phrase is one text field

Is this a no-no, or does it matter? FWIW, in my fla, these text instances in Helvetica Nue are black bars...not the actual text written in them

Css'd Textfields With Multiple Shared Fonts
I'm currently working on a project, where we've created swfs for each font we need embedding, and import them for runtime sharing. This works fine to actually embed the fonts, but by styling the textfield with external css, it doesn't seem possible to have more than one font in each textfield.

In the following xml snippet, you can see that different words for the line, have different styles. £1500, is blue, Interest free is black, and overdraft is green. But these also need to be Different fonts ie. NewsGothicBT Bold, NewsGothic BT Roman, and NewsGothicBT Demi, respectively.


Code:
<span class='overdraftAmount'>£1,500 </span><span class='overdraftInterest'>interest-free</span><br><span class='overdraft'>overdraft</span>
Does anyone know if it is possible to achieve this?

With the fonts embedded as I outlined previously, surely they should be available for the css to implement?

Is there a better way of doing this perhaps?

Thanks in advance for your time.

Apply Formatting To Multiple TextFields
welp -

heres where im at:

function defTxt(m){
for(i in m){

if(m[i] instanceof mx.controls.TextField){

//apply formatting function here, already made - working.
}
}
}
defTxt(_root);

Ive tried a few combos (_root, _level0, this)

nuttin!

any ideas?

Remove Multiple TextFields With Loop
Hi!
How can I remove textFields with a loop? I know that I could do this: txtT1.removeTextField(). And this works but I would loke to replace the number in it with a variable: eg: txtT+i.removeTextField(). Of course this one doesnt work. What do i need to do?

Splitting Text Across Multiple Textfields
Hey!
Working with textfields in AS3 and have some musings. I´ve two textfields where I splitting a text across.

ActionScript Code:
myText1_txt.type = "input";myText1_txt.htmlText = "Looong text goes here...";myText2_txt.type = "input";myText2_txt.htmlText = myText1_txt.htmlText;for (var i:int = 0; i < myText1_txt.bottomScrollV; i++){    myText2_txt.htmlText += "<br>";}    myText2_txt.scrollV = myText1_txt.bottomScrollV + 1;

This works fine. It counts the lines in the left textfield (visible lines) and then scrolls the right field. Now I want to add input functionality so that you can type into myText1_txt textfield (left field) and it will automatically flow over to myText2_txt - the right textfield. Any suggestions?!

[FMX] LoadVariablesNum, .txt, Display Same Text In Multiple TextFields
Hello,

Maybe a bit unclear but here I go.

I'm loading a .txt file into a textfield on the _root of my movie.
This text displays fine.

Now I have a mc called 'news' on the _root wich holds another textField.

I want the textField on the _root and the textField inside the _root.news to have the same text. (the text loaded in from the .txt file).

i tried something like this :
_root.news.content.text=_root.agenda.text

But that ain't working.

Any help apreciated.

Dynamically Create Multiple Textfields For A Mindmapper
Hi Guys

Any idea what code I need to dynamically create 'thoughtcloud' movie clips
based on an existing MC that contains a dynamic text field when a single button is clicked over and over?

I have a text input box on the screen that will update the text in each thoughtcloud. However at the moment I don't know how to auto increment the instance names of the thoughtclouds and the updater script. Can I use variable names for the textfields to do this and how would I go about it??

At present I have a button that creates a single static textfield which you can enter text into but then it isn't draggable as such. I need to make the text input box switch to updating the newly created textfield inside the thoughtcloud movieclip.

Its for a flash mindmapping tool I'm building for a school. Please help if you can. I've got so far but I need to finish this last bit of the puzzle. If it will help I have uploaded what I've done so far...

Thanks for any help you can give me.

Create Multiple TextFields Base On XML Data
I need to create a textField for each label element in my xml file. Below is my xml file and a function that doesn't work (produces a syntax error), but kind of shows what I am looking for. Any help would be appreciated.


Code:

<?xml version="1.0" encoding="utf-8"?>

<item title="Brachial Plexus">
   <sideLabels>
      <label>subclavian vein</label>
      <instanceName>sideLabel01</instanceName>
      <description>Description text will go here</description>
      <label>medial cord</label>
      <instanceName>sideLabel02</instanceName>
      <description>Description text will go here</description>
      <label>label name</label>
      <instanceName>sideLabel03</instanceName>
      <description>Description text will go here</description>
   </sideLabels>

</item>

Code:

private function xmlLoaded(evt:Event):void
      {
         labelXML = XML(evt.target.data);
         
         for(var i:uint = 0; i<=labelXML.sideLabels.label.length() - 1; i++)
         {
            textLabel = labelXML.sideLabels.label[i].toString();
            var textBox[i] = new TextField();
            textBox[i].text = textLabel;
            textBox[i].x = textBox[textLabel].x + 15;
            addChild(textBox[i]);
         }
         
      }

MX Dynamic TextFields
I'm using an external text file variable to load text into a dynamic textfield in flash MX. I have a new scrollbar UI Component working with the text field. But there seems no way to get the HTML tags in the external text file working. Any ideas! I want to keep the text content for my textfields in separate files. Do I have to stop using the "oh-so-useful " scrollbar component?"

Dynamic Textfields?
I am currently making a personal website and I want it to include a news section. It's a pain to upload the flash movie every time something is changed, so I was looking for an alternitive. I know there is a way to create an external file that can be loaded into the movie, which solves my problem. However, I don't know how to do this correctly. I've done this one time, but every time I tried to use html in the file, it wouldn't load. I tried selecting and deselecting the html option in the textfield options in flash, but still no text!

---
Version:
-Flash 5

Questions:
-How do I go about making a text field that can contain loaded text ( including basic html ) from an external file.
-What specific coding will I need to include in the external file.
---

Any help will be greatly appreciated, thanks.

Sorry if I'm the 50,000 person to ask about this, oh well

Dynamic Textfields Help
I am relatively fresh to ActionScript since all my work so far has been done in the "graphic" part of the flash. I 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 text.

I could not find this in the manual and don't know how to solve this problem. Help is appreciated! here is the code i used so far

//--------------------------------------------------------------------

MovieClip.prototype.create_text=function(sTextName ){
var nWidth:Number = mcDisplayBackground._width;
var nHeight:Number = mcDisplayBackground._height+1;
var nX:Number = mcDisplayBackground._x+3;
var nY:Number = mcDisplayBackground._y-1.5;
this.createTextField("tData", this.getNextHighestDepth(), nX, nY, nWidth, nHeight);
tData.text = sTextName;
tData.selectable = false;
tData.multiline = false;
tData.wordWrap = false;
var tfFormatter:TextFormat = new TextFormat();
tfFormatter.font = "kroeger 05_56";
tfFormatter.size = 8;
tfFormatter.color = 0x7fdc09;
tData.setTextFormat(tfFormatter);
}
create_text("INTERACTIVE PORTFOLIO");


//--------------------------------------------------------------------

agent _toto

Having An '&' In Dynamic Textfields
Excuse me,

I am getting dynamic information pulled in from a txt file which contain multiple variables, so the variable name has to start with the '&' for each variable in the txt file. But is there a way I can have an '&' pulled in from the txt file into the flash's dynamic text box without flash thinking it's the start of another variable?

Dynamic Textfields ...
Hi, thanks for viewing this thread,
Created an e-mail textfiled (var-name = Email).
-
Is it possible to tell a button to only accept an entry when certain characters appear in that textfield? Here is what I'm about trying to do:
code: on (release) {
if (Email eq "" || Email eq "undefined") {
_parent.Status = "PLEASE ENTER YOUR E-MAIL ADDRESS.";
} else if (/* Email does not contain characters "@" and "." */) {
_parent.Status = "PLEASE ENTER A VALID E-MAIL ADDRESS";
} else if /* +++ FURTHER SCRIPT +++ */
Thanks for your advice!
aut.

Tab To Dynamic TextFields
Is it possible to tab to a dynamic TextField? I've failed miserably to do so today.

Tabbing to input text fields works but it ignores the dynamic TextFields. I need to tab to them in order for screen readers to read them. I've set tabEnabled, tabIndex, the AccessibilityProperties but can't for the life of me find a way to tab to dynamic TextFields.

Any help would be greatly appreciated.

Thanks
Bob

[AS2 OOP] - Dynamic MCs Or TextFields
Hi,
as you'll see with the following snippet of code, I'm rather new to OOP for Flash.
I've been trying to dynamically create a textField with no luck.

Code:
//mcPath:MovieClip is a parameter passed to the class' constructor
var myArray:Array = new Array("one", "two", "three");
for (var i=0; i>myArray.length; i++) {var eval("myMc_" + i):MovieClip = mcPath.createTextField("tempText" + i, mcPath.getNextHighestDepth(), 9, 30, 552, 0);
}
The problem is that I get an error: (Syntax error)
Any help would be very much appreciated. Thanks

ps. I did look around, but couldn't find anything that could be of help to my problem. I'm sorry if this issue has already been dealt in the pass.

Dynamic Textfields
I was wondering...
Can you somehow have a text dynamically loaded into textfields in separate columns?
Like if you had paragraph 1 on the right, and paragraph 2 on the left, but they actually load one text file or xml ?

if I read this I wouldn't understand it myself so I'll have to post a picture if you think it'd help.

ciao

Dynamic Textfields.
Hi all,

I have lite bit of a problem.

What i want to do is to use an dynamic text field like a Iframe, like in html.

Reason for this is that i whant to load an text file with a bunch of variables in to the text field. Some of these variables is html links to other text files(also with a bunch of variables). I want to be able to click the links and the new text file is loaded in the dynamic text field, insteed of the original text file.

I hope i didn't make my self to un clear.

Best regards fredrik

Dynamic Textfields
Hey

I have a function called addMenuText that is supposed to add ilnks, like a menu. So far i have this.

Code:

      public function addMenuTxt() {
         
         var _menuItem:Array = new Array("WEB", "DIGITAL ART", "3D MODELING", "IDENTITY", "PRINT");
         
         for (var i=0; i<_menuItem.length; i++) {
            
            var item = _menuItem[i];
            trace(item);
            
         }
         
         
         trace("-------------------------------------");
         trace("/////////////ADD MENU TEXT///////////");
         trace("-------------------------------------");
         
      }

How do i put the content from the Array into som dynamics textfields and make them a button?

Linking From Dynamic Textfields
I have a textfield containing various names that i wish to convert into links:

textfield="link1
link2
link3";

I want these fields to be regular text links, like in HTML, but loading seperate MC's into a given target.

Is this even possible? would i need to use different scripting to acheive this?

help!!!!!!

Placing Dynamic Textfields
I'm wondering how I can give a dynamic textfield his place in my movie by setting it's _x and _y property. It seems like it ain't possible to do this. Or am I just looking in the wrong direction?

I would really appreciate your help on this subject.

Adding Dynamic Textfields
Hi

I've set up the following script on a mc to add two sets of two dynamic textfields (simply using single digit numbers), all of the four getting their info from external txt files:

onClipEvent (enterFrame) {
_root.right = (Number(righttestcheck)+Number(righttestcheck3));
_root.wrong = (Number(_root.wrongtestcheck))+(Number(_root.wrong testcheck3));
}

Check this out for weird - the _root.right section is duff. In the setup above (without _root. statements for the two variables), it won't do the addition, the 'right' or result textbox simply remains '0'. If the _root. pointers are added, it returns a NaN error.

And to top it all off, the _root.wrong part works just fine.

I've checked the paths, the combinations of variables, etc and nothing works. Is there a specific set up for more than one onClipEvent on a mc, maybe.
Anyone have any ideas? If you need the files, please just ask.
I'm going mad.

Addressing Dynamic TextFields?
So I am using this function to generate a row of movieClip instances to serve a navigational button on my site:

function makeButtons(){

nav._visible=0

var Button_array = _level0.one.buttons.split(",");

Button_length = Button_array.length;

xposition=80
for (i=0; i<Button_length; i++) {
duplicateMovieClip (nav, "nav" add i, i);
setProperty ("nav" add i, _x, xposition);

set ("nav" add i add ".Button", Button_array[i]);


--> set ("nav" add i add "_width", Button_array[i].length * 8);


--> xposition = xposition + (((Button_array[i].length) * 8) + 10);

}

}


the "-->"'s in the above quote are not part of the code. Those are the lines I wan to call attention to.

The first sets the width of the clip based on the length of the string stored in the Button_array; these strings are all navigational choices.

The second attempts to maintain even spacing by examining each string and mulitplying it by an average pixel value.

This is all irrelevant in a way, since it has been pointed out to me in this very forum that examining the string is not the correct wat to do what I want to do.

It seems instead that I want to examine the .textWidth property of the textField object which inhabits each duplicated movie clip and has an instance name of "field" in the original.

When I place this code directly on the movieClip to be duplicated:

trace (this.field.textWidth);

I get the values I need, but I can't seem to reference them correctly from within the function described above. It is defined on the first frame of the same movie which the button duplication takes place.

It seems to me that if I could solve the addressing problem, and replace the call for this value:

Button_array[i].length

with one that corresponded instead to the textWidth property of the intance a hand, I'd be closer to the edge of the woods, on the way out.

I know I am kind of retrofitting strategies here, and I should point out that I have already been steered toward using the textField.autoSize method, though I do not
yet know how to get it to work for what I am trying to do.

?

Thanks for listening

Dynamic Naming Of Textfields
I am trying to set up a dynamic tab order. This requires that textfields in a source movieclip are named dynamically (that is with increasing numbers) as the source movieclip is copied into the main movie. How can I do that?

Problem With Dynamic Textfields
Well in my main swf (the main site) i have this mc (called container) in which I load other swfs (to minimalise loading time).

Now these swfs have some dynamic textfields in them, that work just fine (show the text) when i test the swfs.
In the actions layer of these swfs i have code like : textbox ="texthere";

But... when i load the swfs in the main site, the textfields do not show at all.
I've tried changing the code in the swfs to _root.container.textbox ="test"; and I have even tried to put this exact code in the actionslayer of the main site, but nothing works. The text just won't show.

Thats about the best i can explain...


Does anyone of you have any idea what the problem might be?
Thanks for your time

Printing Dynamic Textfields?
Hi

I am workong on an app that parses in XML data in 6 languages. I need to be able to print out portions of this data. As I don't know the number of pages to print out, because this will vary from user to user and language to language, I am testing ways of achieving the printout. I have a few issues so far:

1) How can I add dynamic #p markers?
I don't think this is possible, I have tried attaching MCs with a #p marker embedded but I only want one print dialog box coming up for the user. I am using the printasbitmap(movie,"bmovie") command and can only target one MC.

2) How can I measure page overlap?
I have autosize textfields that I am populating from the XML, however I can't work out how to obtain the 'chunk' of data that I will need to be moved to the next page. Because of the multilingual aspect I can't rely on character counts. I will need to determine exactly how many lines I can fit on each page. I have experimented with textfield heights, but this doesn't give me a way of targeting the data to move to the next page.


Any help would be greatly appreciated.
Thanks
Wayne

Limitations With Dynamic Textfields?
Hi,
I set up a whole website and then i realized that small fonts couldn't be read in small resolutions. So I changed the text blocks into dynamic text fields (with different variable names) and then they just won't appear (other parts of the symbol.
Is there any limitation under masks? is it because they are nestled in various other movieclips?
What kind of limitations do they have?
info: they are used inside buttons nestled in movieclips.

Info In Dynamic Textfields
flash mx

i have two arrays and a dynamic textfield


Code:
arrayA = new Array(3);
arrayA[0] = "a";
arrayA[1] = "b";
arrayA[2] = "c";

arrayB = new Array(3);
arrayB[0] = "d";
arrayB[1] = "e";
arrayB[2] = "f";
and with a click of a button, i want to have "this" display in the dynamic textfield:


Quote:




arrayA[0]=a&arrayA[1]=b&arrayA[2]=c&arrayB[0]=d&arrayB[1]=e&arrayB[2]=f




here is the code that i am using, but it's only displaying part of the information that i want

the dynamic textfield is the clipboard


Code:
on (release)
{
for(i=0;i<2;i++)
{
clipboard = clipboard + "arrayA[" + i + "]=" + arrayA[i] + "&";
}
for(i=0;i<2;i++)
{
clipboard = clipboard + "arrayB[" + i + "]=" + arrayB[i] + "&";
}
}
and here is what the code is displaying:


Quote:




arrayA[0]=&arrayA[1]=&arrayA[2]=&arrayB[0]=&arrayB[1]=&arrayB[2]=&




it's not dispalying the string that's stored in the array element

if anyone knows how i can fix that, please help me...
thank you!!!

Spacing Dynamic Textfields. Why Not?
Hi there,

I would have liked to be able to space the text in a dynamic textbox. This, however, isn't possible. Why? What's so different between 'leading' and 'kerning (/spacing)'? Every other text property is adjustable (even dynamicaly now, in MX) BUT the spacing. And I think this is an important property when working with text on a screen.

What do you think my fellow flashers?

cYa.

Not All Dynamic Textfields Load
Does anyone have an idea why Some of my sites dynamic text fields load from the external text files and some don't.
On the site the 'about', 'contact', 'calendar', and 'notes' sections are all loaded fron external text files. The calendar and notes sections are fine but the other two are blank. I have no problem when testing these from my HD. I have checked and checked again the script in the movie to be sure of spelling and everything correct. I have the text files in the same location as the movie.

If you would like to take a look here is the link: Study Buddy

thanks,

chosenson

Dynamic Textfields = Godsend
My text looks so much more crisper now that I use dynamic text-fields more often, kinda like a flash side-effect (the text doesnt anti-alias when using dynamic textfields), just wanted to thank oldnewbie for helping me with the custom scrollbar, aswell i want to thank whoever pointed out that nifty trick with dynamic textfields, tho i did notice that dynamic textfields did that in the past, i never thought to actually use it to my advangtage, good sh!#


http://cgnation.netfirms.com/Flash/d...mscroller.html

Pictures In Dynamic Textfields?
Is there any way to get pictures to show in a dynamictextfield that I used to make a actionscripted scrollpane?

I want to have a few pictures along with the choosen text I have. If ye want to look at the page then go to:

http://home.swipnet.se/Zazi/Artifacts/

Formatting Dynamic Textfields With Css
Hi there, ive made an xml driven navigation menu for our website, im just in the final stages of formatting it and was trying to give the new .css support a go.

The buttons are generated and then this function was used to format them:


Code:
function FormatNewClip (i, x, y, Clip, style, buttonText)
{
Clip.trackAsMenu = true;
Clip.createTextField ("name", i, x, y, 1, 1);
Clip.name.autoSize = true;
Clip.name.type = "dynamic";
Clip.name.embedFonts = true;
Clip.name.setNewTextFormat (style);
Clip.name.text = buttonText;

}
That's all good.

I try to throw in .css styling and it all seems to go pete tong - the buttons aren't getting formatted. I've just been trying inline styling to see if i could get it to work:

Code:
function FormatSubClip (i, x, y, Sub, buttonText)
{
Sub.trackAsMenu = true;
Sub.createTextField ("name", i, x, y, 1, 1);
Sub.name.html = true;
Sub.name.autoSize = true;
Sub.name.type = "dynamic";
Sub.name.embedFonts = true;
SubStyle = new TextField.StyleSheet();
SubStyle.setStyle("a:link", {color: "#ff0000"});
Sub.name.styleSheet = SubStyle;
Sub.name.text.htmlText = "&lta&gt + buttonText + "&lt/a&gt";

}
I might be being ridiculous (it is monday morning!) if you can help then i'd be much obliged.

Cheers guys,

James

Rotate Dynamic Textfields?
why do dynamic textfields appear blank when it's rotated?

Dynamic Textfields And Fonts
hi,
i'm in the middle of a thing involving text loaded dynamically from xml files on which i apply a TextFormat()...
i need to apply bold on some part of it but the fake bold from flash doesn't work on the font i use and i was wondering if there was a way to apply another font (eg: the bold version of my font previously used) in the text...

Dynamic Textfields Not Generating ? Help
Hi guys im expecting this following code to give me 5 rows of username firstname familyname
But instead i just get 5 rows with just
familyname


username and firstname do not appear in each row..does anyone have any idea why this is happening..im sure im making some silly mistake bu ti cant see it Thanks in advance..appreciate it

the code is


Code:


mcMain= _root;

var depth:Number;
var nX:Number = 50;
var nY:Number = 100;

for(var i:Number=0; i<5;i++){
depth = mcMain.getNextHighestDepth();

mcMain.createTextField("username"+i,depth,nX,nY,0,0);
mcMain.createTextField("firstname"+i,depth,nX+40,nY,0,0);
mcMain.createTextField("familyname"+i,depth,nX+60,nY,0,0);

mcMain["username"+i].autoSize = "left";
mcMain["firstname"+i].autoSize = "left";
mcMain["familyname"+i].autoSize = "left";

mcMain["username"+i].text = "username";
mcMain["firstname"+i].text = "firstname";
mcMain["familyname"+i].text = "familyname";
trace(depth);
nY+=50;

}

Dynamic TextFields In ScrollPane... Or Thats
Dynamic textFields in scrollPane... or thats what I'm trying to achieve.

I want to have a flash page dynamically grow as I add content (text and images).



Any ideas on how to do this?

Populating Dynamic Textfields
Hi, im using this code to create dynamic text fields on my stage and populate them from an array.

Code:
for (i=1;i<Number(_root.myvars.total)+1;i++){
myarray=_root.myvars["player"+i]
myarray=myarray.split(",");

_root.createTextField("mytext"+i,i,300,200+(i*10),300,100);
_root["mytext"+i].multiline = true;
_root["mytext"+i].wordWrap = false;
_root["mytext"+i].border = false;

myformat = new TextFormat();
myformat.color = 0x000000;
myformat.font = "eurostile";
myformat.size = 10
myformat.bold = true
myformat.leading = 5


_root["mytext"+i].text = myarray[4];
_root["mytext"+i].setTextFormat(myformat);

}


however, i want to have these inserted to a movie clip inserted on my stage, how should i adjust accordingly?

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