Weird problem with dynamic text

Hello

I created a dynamic text field - mediaImportName001 (created and it contains the name of a file that I have chosen to import them using a browser (as3 and AIR) button.)

It works very well - I can import the file, and the name appears in the field.

I would now like to pass the content of the text field to another text field.  But I'm not content. If I try to find the contents of the textField trace("mediaImportName"+thisNum).text - Flash returns "undefined" (even though I'm him asking to draw once the field has been filled).

I use the following code to check that the material is really there and named correctly (the code returns the children):

for (var i: uint = 0; i < this.numChildren; i ++) {}
trace (this.getChildAt (i) .name + "\t type:" + typeof (this.getChildAt (i)) + "\t" + this.getChildAt (i));
}

It returns:

object: type instance370 [object, form]
object: type mediaImportName001 [TextField object]
object: type mediaFiletype001 [TextField object]

How can I get Flash to give me the text in mediaImportName001?

It's weird - this.getChildAt (i) .name

from above gives me...

mediaImportName001,

yet

trace (['mediaImportName' + thisNum] .name);

returns undefined (thisNum represents an increment I used to name several clips and text fields and in this case trace (thisNum); return 001)

Any ideas why this happens?

Thank you

Shaun

No logic problem, just a problem with describing the problem (as far as the fix goes) and using the property name (as far as the issue goes).  There is a difference between the creation of a dynamic textfield (a type of textfield) and dynamically a textfield (using code to create).

In AS3, the name property is a property and it is not the same as the name of the instance that you can assign to an object on the stage.  To target an object using its name property, you must use the getChildByName() method, or alternatively, you can use the variable you used to create it.  You may need to cast as a TextField object as well as to operate...

trace (TextField (this.getChildByName ("mediaImportName" + thisNum)). (Text);

which would produce the same result as the use of...

trace (mediaImportName.Text);

I don't know how the numbering disperses on "001", but you might find it easier to work with by storing just the instances of an Array by using the media_file_num to set the index where they get.  Then, you would be able to target the textfield to help...

trace (tfArray [thisNum]. (Text);

Tags: Adobe Animate

Similar Questions

  • Problem with dynamic text

    Hello, all.

    I'm having trouble with dynamic text not displaying only not on the scene during execution.  When I test the scene, fields of text but loading, but when I test the movie, or run publish a snippet, the text is not there.  Some figures appear unstable in the text fields, but are often completely empty. --J' did ensure that the fonts have been included and I can't understand why this is happening.

    Any ideas or suggestions are greatly appreciated.

    Thank you.

    Try another font which has called to work correctly, such as Arial and see if you still have the problem. Not all fonts can be embedded correctly...

  • ScrollPane + problem with dynamic text.

    Hello

    I use the ScrollPane component to display a movieclip that contains text. So far, I went to a few paragraphs, with the text field defined on "Static text"... but as I wrote a few more I noticed that the text box displays only half of my text. So I went to the "dynamic text", which solves the problem of display and get 100% of my text but now I always displayed onstage, even if it is available in the library... strange!

    Could somone help me please?

    Kind regards

    vedtam

    There is no visible scrollpane.

  • CFIF weird problem with dynamic form variables? Very strange...

    I can't understand what I'm doing wrong here.  Here is my code.  Question explained below.

    < name cfquery = "reviewconfigloader" datasource = "MOLMS" >
    SELECT *.
    FROM dbo. BaseModel
    WHERE the dbo. BaseModel.AccountID = #molmsAccountID # AND.dbo.BaseModel.basemodelActive = 1
    < / cfquery >

    < table width = "100%" border = "0" cellspacing = "0" cellpadding = "3" >
    < cfloop query = "reviewconfigloader" > < cfif AND isdefined("form.baseconfig#reviewconfigloader.basemodelID#") ("form.baseconfig #reviewconfigloader.basemodelID # ') NEQ" "AND (" form.baseconfig #reviewconfigloader.basemodelID # ') QNE 0 > < cfoutput > < tr >
    < td width = "40%" bgcolor = "# F7F7F7" class = "basemodelsub" > #form ['baseconfig #reviewconfigloader.basemodelID #'] # #reviewconfigloader.basemodelName # #reviewconfigloader.basemodelSubName # < table >
    < td width = "15%" bgcolor = "# F7F7F7" class = "basemodelsub" > < div align = "center" > x 14 < / div > < table >
    < td width = "15%" bgcolor = "# F7F7F7" class = "basemodelsub" > < div align = "center" > $486 / year < / div > < table >
    < td width = "15%" bgcolor = "# F7F7F7" class = "basemodelsub" > < div align = "center" > $ 1,444 / year < / div > < table >
    < td width = "15%" bgcolor = "# F7F7F7" class = "basemodelsub" > < div align = "center" > $ 1,444 / 3 yr < / div > < table >
    < /tr > < / cfoutput > < / cfif > < / cfloop >
    < /table >

    What I'm doing here is pretty basic. I'm running a query with a number of configs in it... and then by creating a loop for their output.  Ultimately, I want only the configurations that did not present 0 in the form on the previous page.  Each of the configs in query configuration has a variable of dynamic form on the previous page with a quantity associated with it.  I am trying to remove all the current amounts that are not 0 (or not to eliminate just not see the)... as you can see on the cfif statement.

    This is where it gets weird.  You will notice that I left #form ['baseconfig #reviewconfigloader.basemodelID #'] #, just for the test, which shows me the amount as it should.  I ran a test and put in a couple of 1 s 0 s, 12 s 6 s, etc. in the form fields on the previous page.  If it worked, it would not show anything for the documents with their value by 0 basemodelID.  Not the case.  It shows all the records.  What's funny is that it displays perfectly in my test #form ['baseconfig #reviewconfigloader.basemodelID #'] #, showing good numbers in the previous form, 1, 0, etc., related to each record.  But for some reason, the cfif code isn't catching.

    What's even weirder... I replaced the cfif ("form.baseconfig #reviewconfigloader.basemodelID # ') NEQ 0 with GT 12 (12 has been the largest number I put in shape) and he always showed all the records.  Then I put in as LT 12 and it revealed nothing.  I decided to go one step further and put in to GT 1231243242343 (massive random number), which he always showed all the records.  So, somehow, CFIF statement think that ("form.baseconfig #reviewconfigloader.basemodelID # ') is an incredibly large number, although when I exit in the line below, it is the number, it should be.

    I'm puzzled.  Any ideas?  Thanks in advance!

    Hi Alexander, thank you to try out it... but this errors with error # because just the # emerged from the parenthasis.  So he just bombs.  Let me know if you can imagine than anything else!

    Sorry about that, Jeculture. Christmas factor.

    I unrolled without checking. What he should have said is:

    or

  • problem with dynamic text and input box area

    wtf.dib

    I'm doing a login to a game screen.  I imported the background image added 5 text boxes and 2 buttons

    the top one is dynamic and is supposed to show the message.   The user name or password is incorrect, as shown in the trace, but it's what appears instead.

    the two boxes on the left are static and seem to work well.

    2 boxes on the right are the input boxes for the user to enter their user name and password, but the alpha only characters that they allow a d e m n o p r s u w.

    all other characters alpha get ignored. and you n p are always in the capital.

    I realize that the only letters that seem to be allowed are letters in the username and password, but I have no idea why this is happening.

    Here is the code for the connection.

    Stop();

    import flash.events.MouseEvent;

    import flash.ui.Mouse;

    import flash.display.MovieClip;

    import flash.events.Event;

    import flash.display.Stage;

    loginbtn.addEventListener (MouseEvent.CLICK, connection);

    function login(event:MouseEvent)

    {

    If (usernametxt.text == "u" & & passwordtxt.text == "p")

    {

    gotoAndPlay (2);

    }

    on the other

    {

    messagetxt. Text is a String ("the user name or password is incorrect");.

    trace (messagetxt. (Text)

    }

    }

    any help would be greatly appreciated.

    Embed fonts for dynamic/input textfields.

  • Weird problem with the google search on Safari 9.0.2

    Hi all

    I had a weird problem with Google on Safari recently. After that the search for something from the Google home page and search page is loaded, I can't be able to change or enter anything in the more the google search bar. I have to reload the page every time google to search something else. Google search worked fine on Firefox though.

    I use the latest version of Safari (9.0.2) and I tried clears all history data, and Web site, but nothing has worked so far. My Mac is running on OS X Yosemite so what counts.

    Can someone understand what is the problem?

    Thank you.

    If you have problems to open Web pages, take a look at these techniques proposed by Apple of troubleshooting.

    https://support.Apple.com/en-us/HT204098

    Go to the Safari menu (at the top right of your screen next to the Apple icon), choose 'Quit Safari'

    Press the "Shift" key and while holding this button on your unique keyboard, click the icon of Safari on your Dock.

    Open Safari - Preferences - Privacy - data to remove any Web site.

    Open the menu to go with the Option (Alt) key - library - key locate Safari folder and place it on your desktop. Restart your Mac, open Safari and delete the file from your desktop.

    In addition, a restart may help.

  • Photoshop: problem with the text tool

    Hi there, problems with my text in Photoshop tool. When I try to write, using vertical text is written just a line, a straight line instead of any text. This only started happening in the last hours. I tried to change the texts and closing and start Photoshop again, all without success, please help?

    Please reset the text tool

  • Problem with the text is pixelated

    Problem with the text is pixelated on iPad retina. You have a solution?

    Digital Publishing Suite 101: keep the text accurate in a Raster slideshow

  • Weird problem with enums

    Hi all

    I have a weird problem with the implementation of controls and access their values. It seems that EI is pulling the wrong values for me.


    As follows:

    I have

    enum { }

    SKELETON_INPUT = 0,

    SKELETON_GAIN,

    SKELETON_COLOR,

    SKELETON_DELAY,

    SKELETON_POSITION_X,

    SKELETON_POSITION_Y,

    SKELETON_NUM_PARAMS

    };

    and

    enum { }

    GAIN_DISK_ID = 1,

    COLOR_DISK_ID,

    DELAY_DISK_ID,

    POSITION_X_DISK_ID,

    POSITION_Y_DISK_ID,

    };

    And I create my fine controls like sliders and they appear

    However, in my method of rendering, the values that AE comes out is wrong.

    Suites. ANSICallbacksSuite1 ()->sprintf(out_data->return_msg, "X = %1.2f Y =%1.2f ',)

    params [SKELETON_POSITION_X]->u. fs_d. value,

    params [SKELETON_POSITION_Y]->u. fs_d. value );


    Instead of getting the values of Position X and Y in the effect control, I'm SKELETON_GAIN for X and NAN values for Y.


    Is that all that I forgot to put? AE not to complaint of the any mismatch of parameter.

    DOH

    This is one of those who come to you once you have posted.

    So the order of creation is too important.

    Initially, I wanted to put my POSITION_X controls and Y in the first place and thought he would keep the enum attributed honest.

    But apparently I need my order of creation is the same as the enum values.

  • having a weird problem with my assignment after incorporation of java

    Hello

    I have a weird problem with my assign activity, I use a Java Embedding wherin I access a variable and assign it some data, further in the next step when I try to assign data to the same variable affecting the activity I get an error message as below.


    com.oracle.bpel.client.BPELFault: faultName: parts of {{http://schemas.xmlsoap.org/ws/2003/03/business-process/} selectionFailure}: {{summary = not valid for the type of part.}} When you perform the operation of the entitlement, the node THIS, IS, TEST is invalid. The node named in the error message was either null, or a node-set is empty, and it was not an instance of org.w3c.Element. Check the value of the node to the line number 795 is not null and is an instance of org.w3c.Element. } .

    I am using soa 11.1.1.5

    Can someone please help?

    -Thank you
    Shirish

    Shirish,

    This is a bug and you will need to apply a patch for it.
    You can find explanations in Oracle Support Id ID 1194228.1.

    Arik

  • I have problems with the text... Help

    Hey

    I have problems with the text box in indesign cs4...

    When I do a text frame and write a short text and want to make a new line and press ENTER, my cursor goes to the next page and the small red cross in the corner of my document apears.

    someone knows what to do here?

    I realle need your help

    Thank you

    This has been covered a lot. A BIOS update may be an option to solve the problem of keyboard mapping, you can change your keyboard shortcuts to reassign the digital keypad input to be a paragraph return or you can try simply by changing the State of the numlock - if it is on, turn it off and vice versa. Withthis problem most of the systems that seems to change the function of the two keys back and forth between the enter alpha and entry number.

  • problems with the text and rounded rectangles

    So I have some rounding of the rectangles in fireworks, then export as fxg, and import it into flash catalyst - but they lose the roundness of rectangles square become. Also have problems with the text as half displaying or doesn't appear do not at all.

    feature request

    -would be really cool to be able to change the paths in flash catalyst

    -Edit the code in code view

    see you soon

    brand

    Hi, the absence of a property of corner radius is a limitation of the FXG export command in Fireworks CS4. We work closely with the Fireworks team to improve interoperability FXG in CS5.

    Thank you for your comments and suggestions.

    -brian

    Team Flash Catalyst

  • problems of dynamic text

    Flash IV not used for a while so am just conversion of AS2 AS3 and have problems with some simple actionscript code

    I have a textbox dynamic created through actionscript inside a movieclip and im trying to change the content of the present, but save the previous value.
    IV taken the previous value and stored in a variable (a string) called oldTxt (witch works when I use the trace instructions to check)
    and by assigning the new text with theTextField.text = "new text"; (new works)
    the problem is when I try to re-re-branded the old value stored in oldTxt, nothing happens.
    the use of code im is theTextField.text = oldTxt; but its just remove all the text.
    any suggestions?

    IM such an idot.
    Employee ID (myformat); theTextField.setTextFormat on the rest of the file and he missed out of the function.

    Sorry for wasting your time but thanks for your help clbeech!

  • Newb needs help with dynamic text

    Hello world

    I'm not a newb - but that's how...

    I am trying to create a multi-page form that allows uses to register the products.
    The first page asks you name etc., and on the second page, I want to say "Welcome"+ username "!" -This kind of thing...
    The problem is that I can't seem to keep the values of dynamic text through the pages.

    I can get it to repeat the entry on the first page with this code:

    _root.firstname_txt. OnChanged = function() {}
    _root.firstname_repeat. Text = "Hello"+ _root.firstname_txt.text; "
    };

    However when I call on the second page it is not defined:

    second_repeat. Text = "Hello"+ _root.firstnamt_txt.text; "
    trace (_root.second_repeat.text);

    I'm sure it's something simple and I am just a dunce of programming...
    Any help is appreciated.

    your

    If your textfield (_root.firstname_repeat) does not exist on the 2nd frame, its text property will be indefinite.

    to remedy, or extend the existence of your textfield in frameworks or use a variable to store its text property (in your manager onChanged) and use this variable to retrieve the value you need.

  • Filled with dynamic text by key STROKE

    I've implemented the the user clicks a button and gives me the result of what they clicked, however how I put in a dynamic text field. I have problems with the AS3 code for it. Here's what I have so far. Any help would be appreciated. Thank you.

    package LIKE {}
    import flash.display.MovieClip;
    import flash.display.DisplayObject;
    import flash.events. *;
    import flash.ui.Keyboard;

    SerializableAttribute public class KeyboardExample extends MovieClip {}

    public void KeyboardExample() {}
    stage.addEventListener (KeyboardEvent.KEY_DOWN, keyDownHandler);
    stage.addEventListener (KeyboardEvent.KEY_UP, keyUpHandler);

    }

    private void keyDownHandler(event:KeyboardEvent):void {}
    trace ("keyDownHandler:" + event.keyCode);
    trace ("key pressed:" + string.fromCharCode(0)) (event.charCode));
    stage.texttest.Text = string.fromCharCode(0)) (event.charCode);

    }

    private void keyUpHandler(event:KeyboardEvent):void {}
    trace ("keyUpHandler:" + event.keyCode);
    }


    }
    }

    that seems fine except for one thing - you are referring to an instance on the stage through the stage class. (I understand the confusion!)

    must be:

Maybe you are looking for

  • Re: Yoga 2 issue of pro sound

    Hi Amy. We have a Yoga 2 Pro with the problem of helmet. It is a second computer so that we can live without it for a time to the cause. The sound only plays through the headphones, when get out us them, nothing. We used a Bluetooth speaker as a work

  • HP pavilion 1305au g4: upgradation of ram

    I have hp pavilion 1305au g4.Currently it's ram is 2 GBI can upgrade of ram on this system. ?How to upgrade ram is it?

  • update windows to spot

    Fix the siger, update er leading forkert

  • Problem with CD/DVD player...

    I have a Dell Studio with Windows Vista installed as the operating system.  The problem I've had since graduating from the computer, is that it will not read a single DVD and only a handful of CD.  I tried every DVD I can get my hands on so I know th

  • stop auto print fax

    How to stop the "automatic fax log printing" after I have send a fax from my officejet pro 8600 / more?