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!

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

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

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

  • problems of dynamic text field

    I work with my .fla file and an external .as file. I have some things to work the way I want and now I am trying to add a dynamic text field to my .fla file. I added the text dynamic on stage manually (not using the action script code) field and when I publish my file I get the following error message.

    1046: type was not found or is not a constant of compilation: TextField.

    Do I need to add an 'import' to the front of my .as file? I currently have these import statements...

    import flash.display.MovieClip;
    Import 12345678910111213import;
    import flash.display.Loader;
    import flash.events. *;
    flash.net import. *;

    Thanks in advance for any help you can give me.

    Dave

    You need import flash.text.TextField

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

  • Dynamic text field not updated to actionscript in the 2nd Frame

    I have a clip with two frames. In the 2nd frame there is a clip that has a text field.

    My goal is to some events that I will be proposing to the frame that has the clip with the text field.

    I'm trying to update the text field with a code something like: -.

    public void updateTxtFld(e:Event)

    {

    My goal is to certain events show the clip with the text field

    questBG.gotoAndStop ("glow");

    arrowText.text = "of the text." arrowTextt has been awarded with the correct text field

    }

    After some time I again back to the framework that has no movie clip masking so the clip

    public void masquer()

    {

    questBG.gotoAndStop ("idle");

    }

    The text field not updated since the actionscript code even if trace (arrowText.text) shows the updated value.

    Now, if I remove the clip of frames & change the updateTxtFld() as

    public void updateTxtFld(e:Event)

    {

    (questBG.getChildByName ('arrowBG') as Sprite) .visible = true;

    arrowText.text = "of the text." arrowTextt has been awarded with the correct text field

    }

    Then it works very well with the updated text in the text field. It seems that there seems to be a problem in dynamic text field update in frames.

    I also checked that the incorporation of text is fine in both cases

    I created the FLAS using CS Professional 5.5 & I am trying to change the text field using actionscript running in Flex Builder 4.7.   Let me know if I need to send the fla (working and non-working version).

    you are the assignment of text to arrowText before the timeline then moves to "shine".

    Use the render event to assign the text:

    public void updateTxtFld(e:Event)

    {

    My goal is to certain events show the clip with the text field

    questBG.gotoAndStop ("glow");

    internship. Invalidate();

    this.addEventListener (Event.RENDER, assignTextF);

    }

    function assignTextF(e:Event):void {}
    arrowText.text = "of the text." arrowTextt has been awarded with the correct text field
    }

  • changing flex inf flash dynamic text field?

    Hello

    I am developing a game in flex builder and I had a problem with dynamic text that I imported from flash. I want to insert a dashboard in my application and to do this, I use a dynamic text in flash. I create a dynamic text in flash, then an import to Flash Builder in a clip, and I called the dynamic text "Score." Now, I tried to use the variable 'Score' to change the value of the dynamic text box UN my flash builder application, but it doesn't change anything.

    I read somewhere that I learned to use the value of score.text to change the number of my points, but that does not work because Flash Builder tells me that this kind of variable contains the value .text.

    Thanks for trying to help me.

    Download the source of TinkSpark to http://code.google.com/p/tink/source/checkout and add the package to your project:

    Then write the following code:

    Import ws.tink.core.Library;
    Import ws.tink.events.LibraryEvent;
    Import ws.tink.managers.LibraryManager;

    private void loadLibrary (): void

    {

    Library: library of var = LibraryManager.libraryManager.createLibrary ("assetsLibrary");
    library.addEventListener (LibraryEvent.LOAD_COMPLETE, onAssetsLibraryLoadCompleteHandler, false, 0, true);
    library.loadSWF ("board.swf"); Specify the path to board.swf, pls, note board.swf is then exported as AS3.0
    }

    private function onAssetsLibraryLoadCompleteHandler (event: LibraryEvent): void
    {
    EventDispatcher (event.currentTarget) .removeEventListener (event.type, arguments.callee);
    Library: library of var = LibraryManager.libraryManager.getLibrary ("assetsLibrary");

    var AssetScore: Class = library.getDefinition ("Score");
    var Note: * = new AssetScore() as Sprite;
    score.scoreDisplay.text = "100";
    addChild (score);
    }

    Best regards

    Etienne Das

    http://deepanjandas.WordPress.com/

  • Someone has problems with the visible property of the fields of dynamic text in html5 canvas?

    Hi, I have problems with text fields dynamic that I placed the Framework 1. I wanted to have a visible property false until after the click of a button. So, I placed a line of code on the layer actions of frame 1 as:

    This.Sum.Visible = false; sum is the dynamic text field

    Even with 5 other text fields.

    Some of the fields appear when I test the movie and others not, but no suppose to appear. The console.log shows no error, and when I investigated console.log as: 'console.log (this.sum.visible)', I get 'false '.

    Any ideas?

    Thank you for your time.

    Yes, the link displays multiple textfields whose visible property works without problems in an animated project of html5.

  • Problem of passing a variable to a field of dynamic text in php (Flash 8)

    I am currently working on a flash file, where a person enters
    their score in a box of text entry with an instance name of score, then it
    It converts a percentage and ranks.
    The swf file displays the rank and the percentage in two dynamic text boxes
    with the name of the instances of percent and score.
    This part is for me no problem.
    The main goal is to pass the percent and the partition to a php file called
    grade.php and save the two variables in MySQL.

    After you download the files to a server, I run the swf file and
    It seems that everything works.  But when
    I check the MySQL file, I noticed that a row has been inserted, but no score or
    grade entered.   I can't know
    What is the problem.  If anyone can help
    me with that?

    Here the Actionscript 2.0 code and the php file:

    function findPercent() {}

    percent. Text = (score.text * 100) / 100;

    If (percent.text > = 90) {}

    rank. Text = "A";

    } ElseIf (percent.text < 90 & & percent.text > = 80) {}

    rank. Text = "B";

    other
    If (percent.text < 80 & & percent.text > = 70) {}

    grade.text = 'C ';

    } ElseIf (percent.text < 70 & & percent.text > = 60) {}

    rank. Text = "D";

    } ElseIf (percent.text < 60) {}

    rank. Text = 'F';

    }

    }

    submit_button.onRelease = function() {}

    submitURL = "grade.php";

    Create an instance of the LoadVars object and fill it.

    send_lv = new LoadVars();

    send_lv.score = "percent.text";    (Note: when I used the text of entry as. score.text box, it displays in MySQL)

    send_lv.grade = "grade.text";

    send_lv. Send (submitURL, "POST");

    };

    (grade.php)

    < html >

    < head >

    < title > Grades: add your rank and Score < /title >

    < / head >

    < body >

    Grade display < h2 > < / h2 >

    <? PHP

    require_once ('connectvars.php');

    Connect to the database

    $dbc = mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);

    Enter the data in the partition of the POST

    $score = $_POST ['mark'];

    $grade = $_POST ['category'];

    Write the data to the database

    $query = "INSERT INTO transcription (score, rank) VALUES ('$score', '$grade');

    mysqli_query ($DBC, $Query);

    mysqli_close ($DBC);

    ? >

    < hr / >

    < / body >

    < / html >

    If you use such track suggested in the message 4 instructions and the instructions of tracing corresponding to your expectations, the problem will be in your php file.

    I have a problem with your php code, but there is no way (in this forum) to check if your db columns are score and rank and that they have the correct data type.

    p.s. I don't download and fix the files unless I'm hired.  free help I offer only via the adobe forums.

  • Dynamic text from the text file problem

    Go step by step to get my data from MYSQL/php... for now, I'm stuck and cannt even get it from a text file I do worng!

    This is the code I use:

    var myLoader:URLLoader = new URLLoader()

    myLoader.dataFormat = pouvez

    myLoader.load (new URLRequest ("trees.txt"))

    myLoader.addEventListener (Event.COMPLETE, onDataLoad)

    function onDataLoad(evt:Event) {}

    for (var i: uint = 0; i < evt.target.data.cant; i ++) {}

    This ["tcname_" + i] .text = evt.target.data ["tcname_" + i]

    }

    }

    My trees.txt file contains the following:

    Plum = tcname_0 & tcname_1 = olive

    I made this as well:

    & tcname_0 = Asian plum & tcname_1 = Amazon lily &

    I have already created a few instances of dynamic text from tcname_0 up to tcname_5

    I tried with having the text in dynamic text or leave it empt anyway... nothing is read from the text file, what I am doing wrong?

    In your trees.text file, you neglected to include the variable of cant, so the loop has an undefined value to life...

    Plum = tcname_0 & tcname_1 = olive & cant = 2

  • Problems with the formatting of the dynamic text box

    I'm under the questions with the help of HTML formatting for a dynamic text field. I know these are weird and I can't understand how to get the formatting right.

    I have on my scene a dynamic text called «content_txt' inside a movie clip instance «content_mc» box When he enters the frame, I just broke down the "content_mc" of the alpha of 0 to 100 with a scenario animation. So that this works, I have to incorporate the police in my text field 'content_txt '. However, the only way I get get the HTML formatting to work is if I do not embed fonts.

    The dynamic text field is configured to render as HTML. In my layer actions, I put the text:

    this.content_mc.content_txt.htmlText = "<b>Hello world,</b> it is me again."

    In summary:

    1. If I do not embed fonts, the alpha fade does not work but HTML formatting doesn't.

    2. If I incorporate police, the alpha fade works but HTML formatting does not work.

    How to solve this? It's driving me crazy!

    then you're not g-d instructions.

    You should have two textfields.  the one on the boards that you started with and that incorporates your normal font (not bold).  and a slide that takes the same family of fonts with license "BOLD".  Repeat the test.

  • problem by turning the dynamic text field

    Hi all

    In an application, I created a dynamic text field and then try to shoot with the _rotation method but it became invisible. Please respond if anyone knows something about this.

    If you do not see your text, you're not embed fonts.

    When you use actionscript to embed a font, you must have the fonts in your library with a connection id, create a textformat instance and assign the property and finally give the textformat to your textfield.  for example

    _root.createTextField ("txt", _root.getNextHighestDepth (), 50,50,50, 50);
    _root.txt.embedFonts = true;
    _root.txt.text = "Hello";
    _root.txt._rotation = 20;

    var tfor:TextFormat = new TextFormat();

    Tfor.font = "yourfontslinkageid";   // <- linkage="" id="" of="" font="" in="" your="">

    _root.txt.setTextFormat (Tfor);

  • XML in dynamic text problem

    only to learn XML in flash and I can't understand
    Why use this code it returns this:
    What & apos; SUP?
    a simple file XML in a dynamic text instead box:
    What's new?

    var x: XML = new XML();
    x.ignoreWhite = true;
    var cap: Array = new Array();
    x.onLoad = function() {}
    var tickers: Array = this.firstChild.childNodes;
    for (i = 0; i < tickers.length; i ++) {}
    Cap.push (tickers, , Sublst.ChildNodes(1).ChildNodes(0));
    }
    Box.Text = heading;
    };
    x.Load ("ticker.xml");

    Alex

    ' is the HTML for an apostrophe ('), so the text appears to be encoded as html. You can use this cipher text easily in an active html textfield, this shows the actual letters instead html codes. I think you need to set the text property to "htmlText" TextField, rather than the "text" property

    HTH,
    blemmo

  • Click on the button - send text dynamic text control HTML5

    Hello

    I want to click a button on my Html5 canvas that sends the text specified in a dynamic text box.

    It does not work... That's what I have on frame 1 of the scenario

    this.myBtn.addEventListener ("click", fl_MouseClickHandler_3.bind (this));

    function fl_MouseClickHandler_3()

    {

    Start your custom code

    This code example displays the words 'mouse clicked' in the output panel.

    Alert ('mouse clicked');

    sym. $("myText") .html ("my dynamic text here");

    Complete your custom code

    }

    The red line is my problem... I don't know how to get the right code for the TextBox on the Web.

    I want finally to be able to add a few basic etc. PHP functions.

    Thanks in advance

    Figured it out...

    this.myBtn.addEventListener ("click", fl_MouseClickHandler_3.bind (this));

    function fl_MouseClickHandler_3() {}

    this.myText.text = ' My dynamic text here ';

    }

Maybe you are looking for