SharedObject AS3 displaying not dynamic text

Hello:
I use AS3 on the timeline. I'm trying to figure out how to save text input using dynamic text boxes.
I have two input boxes (box1 and box2) where user types and last name. Two dynamic text (box3 and Box 4) that will save the user name and last name boxes.

PROBLEM:

I can draw full name, but not able to display the dynamic text and save the text in the entry fields.

Please help me to fix my code.


Here is my code:

var so: SharedObject = SharedObject.getLocal ("sampleCode");


Box1.text = so.data.firstName;
Box2.text = so. Data.LastName;

If (!) YOU Data.FirstName)
{
Box1.text = Box3.Text;
Box2.text = box4. Text;
}

saveBtn.addEventListener (MouseEvent.CLICK, saveData);

function saveData(evt:MouseEvent)

{
Switch (evt.currentTarget.Name)
{
case 'saveBtn ':
{

so.data.firstName = box3.text;
so.data.lastName = box4.text;
so. Flush();
break;
}

trace (SO. Data.FirstName);
trace (SO. Data.LastName);

Thank you;

German

If your trace() functions reveal you're setting if properly, but you're not well, use of recovery:

var so: SharedObject = SharedObject.getLocal("sampleCode","/");

Tags: Adobe Animate

Similar Questions

  • Dynamic text does not arise under a mask

    Hi all

    If like many people, I discovered the joy that you cannot display the dynamic text boxes they are hidden.

    After browsing the internet, I found a few things to try, first to incorporate police, what I did, and that has not worked.

    The alternative is to set the mask to a display object, what I did, sort of.

    I have create a Sprite() in code (I use Flex develop and never the code on the time line), then use the Sprite.graphics to draw the mask, then set the .mask movieClip of my main stage to equal this layer.

    That no longer works.

    Is there a third option?

    Thanks in advance,

    Tom

    Remove your mask.  the text?  If so, your policy is not properly embedded.  If not, look for other problems (and they are many):

    1. can you see your textfield?  If so, is the font color is background color textfield.  If not, fix it.

    2. do you have a problem assigning text?  You can control another property of your TextField (such as its rotation)?  If so, you have a reference right textfield.  If not, you have not.

  • How to load dynamic text inside a clip?

    Hello all - I have a main scene on the first picture where my 'home' film clip shows. I did it by drag and drop, and then I put a stop action. everything works very well.

    inside this clip of family movie on the main stage, there are links to other video clips. for example, to access my faq page - you click on this button, then it takes you to box 4 on my main stage, where the video clip of my faq (followed by stop action) was dragged/dropped and displays properly.

    in the video clip of the faq, this process is repeated, with buttons taking you different pages (different images to different video clips play - everything works fine).

    so now, I want to add a dynamic text field in the video clip of my faq. I've read many tutorials where I created the text file, but I was not able to view successfully within my video clip of FAQ.

    Here is a code that tells my tutorial dvd place me on the main stage that I practice how it works:

    var myMCL:MovieClipLoader = new MovieClipLoader ();
    var myListener:Object = new Object();

    myMCL.addListener (myListener);


    var myLV:LoadVars = new LoadVars();

    myLV.onLoad = function (success: Boolean) {}
    If (success) {}
    _level5.loadedInfo.htmlText = myLV.info;
    } else {}
    _level5.loadedInfo.text = 'there was an error loading the requested information. Please contact the site administrator. « ;
    }
    }

    and here's some code that I place on the FAQ button in my main video which brings back me to the main stage and plays faq movie clip all passed:

    on (release) {}

    GotoAndPlay MovieClip behavior
    _root.gotoAndPlay("4");
    End behavior

    }

    and finally, here is that some code that I put in my clip from movie FAQ in an attempt to display my dynamic text in the FAQ clip - so far without success:

    _level0.myLV.load("VARs/FAQs.txt");

    NOTE:
    I published this see - does not.
    I have my text FAQ starting as info = file
    I eliminated white spaces in my text file
    I use flash 8 pro

    can anyone offer some suggestions? Thank you!

    Hey clBeech - I GOT it! YAHOOO!

    Man - I've been racking my brain and took off a few days of this problem - it turns out that your second post was the answer - he just took clearing me my head to look at once again - I solved all of this as an hour ago - is the code - set 4 main Timeline frame that has worked:

    [
    Stop();
    var myLV:LoadVars = new LoadVars();

    myLV.onLoad = function (success: Boolean) {}
    If (success) {}
    _level0.mainfaqs.loadedInfo.text = myLV.info;
    } else {}
    _level0.mainfaqs.loadedInfo.text = 'there was an error loading the requested information. Please contact the site administrator. « ;
    }
    }

    myLV.load("vars/faqs.txt");

    ]

    I can't thank you enough - although this was not a BIG problem of programming, I couldn't proceed without him, and it was big for me. Thank you for taking the time to following up with me - seriously!

    now, I continue with my project - the scroll for my dynamic text buttons - everything seems to work.

    have a great weekend my friend!

  • Is it possible to display the dynamic value in the ToolTip? I tried: this.assist.toolTip.value = this.rawValue; for a text field 'property MouseEnter', but it does not display the current raw value. It displays a previous raw value of the field... Guilty

    Is it possible to display the dynamic value in the ToolTip?

    I tried:

    this.assist.toolTip.value = this.rawValue; for a text field on 'ownership' MouseEnter

    but it does not display the current raw value. It displays a previous raw value of the field...

    I wrote 'YYYY', but is not displaying on the first mouseEnter event

    Capture_1.JPG

    When I show event mouseEnter for the 2nd time it gives good value.

    Capture_2.JPG

    Now, I changed the "BBBB" value but the first mouseEnter event it displays the value previous i.e. "YYYY."

    Capture_3.JPG

    I found the solution. I wrote the script ("this.assist.toolTip.value = this.rawValue ;") on 'property MouseEnter' but the need to write the script to the "Output" of the field event. ")

    Thank you.

  • AS3 SharedObject of dynamic text field entry into other frameworks...

    Hello I have the script:

    var gTeams:Array = new Array (teamName1, teamName2, teamName3);

    var so:SharedObject = SharedObject.getLocal ("dataSO");

    var shared_data:String;

    for (var i: int = 0; i < gTeams.length; i ++) {}

    If (["team_name_" + i] so.data) {}

    gTeams [i] .text = so.data ["team_name_" + i];

    }

    }

    function saveTextF (): void {}

    for (i = 0; i < gTeams.length; i ++) {}

    so. Data ["team_name_" + i] = gTeams [i]. Text;

    }

    so. Flush();

    }

    In other settings, I have dynamic text fields:

    tName1, tName2, tName3.

    But I can't get the text in the text entry fields.

    How can I do?


    Thanks for your help

    Use instead of TextEvent.TEXT_INPUT Event.CHANGE:

    teamName1.addEventListener (Event.CHANGE, tName1F);

    function tName1F(e:Event):void {}

    .

    .

    .

    Note that the response number 8 is the right answer to your question.

  • Dynamic text not displayed if not incorporated

    In flash8, level other _root dynamic text not are displayed when the police is not incorporated sometimes.
    This problem is only for text, not for images.

    When we create dynamic textfield that troubles me a lot.

    Someone help me quickly

    a little, you can tell a textfiled to use embed fonts using actionscript, but you need to export the fonts when you compile the swf file in the Flash IDE, otherwise you can not assign it to the TextField. See the flash manual to see how to export a font.

  • load dynamic text field text, font is not displayed correctly

    I have a flash movie 8, in which there is a dynamic text field, load data from the server. Data loading beautifully and appears in a text field as html.

    This text as html field uses a style sheet and that works fine for everything except the font. With the help of Flash, I've specified a font of DIN-Medium for the dynamic text on my stage box and still the text that appears when I publish to my Web host seems to be Times New Roman. WTF?

    My style sheet specifies no any font family.

    Can anyone tell me how I could get the dynamic text box to display the text using the font DIN? Do I need to export the police in the library of my animation flash or something?

    I have it working now. The question was how I chose to incorporate fonts. I changed some incorporate settings and it seems to work now.

  • Can not do a numeric value displayed in a dynamic text box

    I'm attached to some appear in a dynamic text box. I have a dynamic textfield on the stage with an instance name called count_txt. The code I use is shown below. The two States of tace indicate a value of 100, but nothing appears in the window of dynamic text. What I am doing wrong?

    var count_txt:Number;

    var n: Number;

    n = 100;

    trace (n);

    count_txt = n;

    trace (count_txt);

    Stop();

    Text fields have a text property that you use to define the text in the field. And when you want to paste a number into the field, you first need to convert it to a string:

    count_txt. Text = string(n);

    trace (count_txt. (Text);

  • Display number in the area of dynamic text without rounding

    Hello

    I use AS3 and try to place the extracted value of an OC in 2 dynamic text boxes. I use a couple of numbers of test (2.25 and 1.25). Strangely when I run the following script, I have trouble getting my test numbers in areas of 2 text (T1, T2). (Before the numbers stopped show altogether, they have been rounded up and that he seemed to be 10 x greater than they actually are, without my something like that.) Note: The script also displays the text (T3, T4, T5, and T6) boxes with messages like "above average" based on the scores don't know if these screens are correct, since I can't show 2 numbers inspired by the poster.

    Here's the code. I have to do something wrong:

    Btn1.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);
    function mouseDownHandler(event:MouseEvent):void {}
    var so: SharedObject = SharedObject.getLocal ("G1", "/"); using ' / ' as a local path should work to pick up the SO created by the SWF quiz
    var read1:Number = so.data.value1
    var read2:Number = so.data.value2
    var read3:Number = so.data.value3
    var read4:Number = so.data.value4
    T1. Text = String (read1);
    T2. Text = String Read (2);
    T3. Visible = false
    T4. Visible = false
    T5. Visible = false
    T6. Visible = false
    male
    If ((read1 > = 1,95) & &(read1<2.65))
    {
    T3. Visible = true
    T4. Visible = false
    T5. Visible = false
    T6. Visible = false
    }
    ElseIf (read1 > = 2.65)
    {
    T5. Visible = true
    }
    otherwise if ((read1 < 1.95) & & (read1 > = 1.25))
    {
    T4. Visible = true
    }
    ElseIf (read1 < 1.25)
    {
    T6. Visible = true
    }
    }

    Any help appreciated.

    Try just the text assignment clear ole to the textfields.

    T1. Text = "ole plain text."

    If you're not yet see anything, my inclination is first ask you to check if the font for the textfield color could match the background.  If this isn't the case, then are hide you, rotation, or animate these textfields - in which case you should join the police for them.

  • Value display trace in the dynamic text box

    Hey just work on an exercise and I can't understand the code to display the value of the trace in a dynamic text box.

    The following code generates exactly where I am at this time.

    Import 12345678910111213import;

    import flash.text.TextField;

    Basic color picker (based pixel)

    var myColourBitmapData:BitmapData = new BitmapData (500 400, false, 0xFFFFFF * Math.random ());

    var myColourBitmapImage:Bitmap = new Bitmap (myColourBitmapData);

    Add to list

    addChild (myColourBitmapImage); Add to the scene

    Get colors

    var pixelValue:uint = myColourBitmapData.getPixel (85,62); color of the pixel at X, Y

    displayed in the output window

    trace (pixelValue.toString (16)); toString (16) converts uint in a number of Hexadecimel format

    Here are a few screens, I want the values of trace output to appear next to the text in the dynamic text box

    Picture 4.png

    Picture 6.png

    I'm not sure of how to call the pixelValue to my text box, any help would be appreciated!

    Before or after the line that begins with «trace...» ' set dynamicTextFieldInstanceName.text = pixelValue.toString (16); Replace dynamicTextFieldInstanceName with the actual name that you gave to the dynamic textfield.

    There is an error in your output window. It seems that you have not integrated a font in the dynamic textField.

  • Dynamic text field will not wrap text

    I have a dynamic text field in my clip. This text field has built-in fonts and behavior is set to Multiline.  When I add text to it, it will not display text that wraps past the first line.

    var textField:TextField = tip_txt; text inside my video field

    trace() "before textField.numLines =" ( + textField.numLines); "."

    textField.text = "test a verrrrry looooooooong striiiinnnnnnnnnnnggggggg";

    trace () "after textField.numLines =" ( + textField.numLines); "."

    Track orders show that the number of lines is increasing, but Flash does not display the text beyond the first line.  Anyone have any idea whats going on?

    Thank you!

    textField.autoSize = TextFieldAutoSize.LEFT;

    This fixes the issue :))

  • Dynamic text not working not not in CS5

    Hello world

    I wonder if anyone knows anything that I'm not on this subject:

    I have a percentage counter in my preloader that still works perfectly fine in CS3. Now I downloaded CS5 preloader displays static text "LOADING" but not the dynamic text with the charge percentage.  I have re-embedded fonts, don't get no error when I publish, and the preloader doesn't actually seem to work. Why dynamic text would not show upward? I use classic text fields.

    Any help, greatly appreciated.

    Debbie

    When you move the slider to the frame that contains your preloader code, do you think that any text in myTextField?  If so, remove it.

    in particular, "LOADING" should not be seen in myTextField.

    If this doesn't solve your problem, you probably haven't a textfield named myTextField.  Use the trace() function to confirm.

  • Display of the current year in a dynamic text field

    I have a project where I have to click a button and and the current year to display in the form YYYY in a dynamic text field.  My current code was written as:

    var myDate:Date = new Date();

    function whatYear(e:MouseEvent):void {}
    display_txt. Text = myDate.getFullYear ();
    }

    date_btn.addEventListener (MouseEvent.CLICK, whatYear);

    I get an Error 1067: Implicit coercion of a value of number type to a type unrelated to String.

    I also have to create one for the current date.

    Any sugessetions? I have tried everything I can thing of, but I'm new to AS3.

    Thank you!

    Try:

    display_txt. Text = myDate.getFullYear (m:System.NET.SocketAddress.ToString ());

    or

    display_txt. Text = String (myDate.getFullYear ());

    or

    display_txt. Text = "" + myDate.getFullYear ();

  • How to load xml data to dynamic text under a button (AS3)

    Hi all

    I created a button and put some dynamic text in it. But I can not dynamically load text from an xml file.
    See the code below:

    var xmlLoader9:URLLoader = new URLLoader();
    xmlLoader9.addEventListener (Event.COMPLETE, showXML99);
    xmlLoader9.load (new URLRequest ("mempops.xml"));

    function loadXML99(e:Event):void
    {
    XML.ignoreWhitespace = true;
    var tree: XML = new XML (e.target.data);
    var i: Number;
    for (i = 0; i < fir.mylist.length (); i ++)
    {
    mybuton1. Box1.dyntext1.AppendText (FIR.memberz [i] .mname. Text());
    myButton1 = button
    Box1 = movie clip
    dyntext1 = dynamic text box
    }
    };

    and the error message:
    1119: access of property may be undefined box1 through a reference with static type flash.display:SimpleButton.

    Thanks for the help

    SimpleButtons have very limited property, so you can't really add content in them that code can talk.  Your best bet will be to create the button as a movieclip.  MovieClip objects can have code addressable bjects placed in them and can also have properties assigned dynamically.

  • Dynamic text box to show the current image not workng

    Please could someone help me. I wish that my area of dynamic text to display the current image of roots. I triedthis with no luck

    frameNumberText_txt.text = currentFrame;

    I'm pretty sure that the problem is because the field requires a string value. I'm not sure how to do that heh

    Try...

    frameNumberText_txt.text = String (this.currentFrame);

    This assumes that the textfield object lives on the root timeline.  If that's not solve it, and you get an error message, include the error message in your ad.

Maybe you are looking for

  • How to open. ANM files?

    I get the files that were on my Ducati ScanDisk and deletend. I use Scandisk recovery software and now have the files ending in. ANM. I replaced. MNA with. GPL But do not know how to open these files? Thanks for the help! Harry

  • Sober question o Sync

    Olha hoje criei um novo usuario no pc, no synchronization pra meu dados e nevagasao como EU EU esquesi tudoooo pego catch had fled

  • HP Envy: Deskjet 3520 OXCO260000 TRTHREADSTOP C error Code

    My deskjet 3520 printer all in one is indicating an error OXCO260000 TRTHREADSTOP C on the display of the printer code. I was not able to find a solution for this.

  • Remote access? 'other' user appears in the Excel file

    My husband uses Excel 2008 for Mac on his mini. Today, it has created a new Excel file, and when he went to save him, he did not allow him to do so. After I told him to try to "Get Info", he saw that there was another user listed as having access to

  • Envy 15-j101ex: HP Envy 15-j101ex - Windows Pro 10 x 64 - HyperV - startup freeze

    I have a laptop HP Envy 15-j101ex.  It is running 64 bit Windows 10 Pro.  There the last HP BIOS: Insyde F.65 I need to turn on Hyper-V (hypervisor hyper-V).  I added the Windows features (enabled in the Control Panel Add Windows features): platform