Display of the results of calculation of data provided by the user in the dynamic text field

Hi people,

I am trampled on this one... Sorry...

So, I'm working on a calculator, hitting a button, will display results based on the user data. I can get all the math to work OK, and he retraces perfectly.

Now, the question becomes it to display on the fla itself.

(The strange thing is, I had to keep all the data in the function. If I took it out, I would get all kinds of errors NaN and others. "But keep it within the service does the job very well.)

What I'm missing here? I tried to do a total.set_Text = refundAmt; - but no luck. (The name of the instance to the box in the FLA file is 'total')

Here is my code:

------

trace_btn.addEventListener (MouseEvent.CLICK, showStuff);

function showStuff (evtObj:MouseEvent): void {}

var theSalary:Number = parseFloat (this ["inputSalary"] .text);

var theDaysYouWorked:Number = parseFloat (this ["inputDaysYouWorked"] .text);

var theEligibleDays:Number = parseFloat (this ["inputEligibleDays"] .text);

var refundAmt:Number = theSalary * 0.005 / theDaysYouWorked * theEligibleDays;

var lawyerFee20:Number = refundAmt * 0.80;

var lawyerFee25:Number = refundAmt * 0.75;

var lawyerFee30:Number = refundAmt * 0,70;

var lawyerFee35:Number = refundAmt * 0.65;

trace (refundAmt, "$" refundAmt.toFixed (2), "$" + lawyerFee20.toFixed (2), "$" + lawyerFee25.toFixed (2), "$" + lawyerFee30.toFixed (2), "$" + lawyerFee35.toFixed (2));

}

-------

If I try to start another function, the results are not part of the scope, so I can't access it.

Thoughts? Thanks in advance!

N

large.

Please mark this thread as answered, if you can.

Tags: Adobe Animate

Similar Questions

  • Disable the scroll bar when no overflow in the dynamic text field

    I use the UIScrollBar on a dynamic text field. I would like to make the scroll bar is not visible or turn it off if there are no more rows to display when initially displayed. Are there variables in a pile of data L0 I can check to see if the scroll bar can be disabled; 'lines of total in the text field' and 'lines per page' either, something that accomplishes the same thing?

    You can use the textfields maxscroll property to determine if a textfield can display all its text without scrolling.

  • link to the function in the dynamic text field

    so I have a dynamic text field that needs to display something like...

    You have been identified as Syd Barrett. If it is incorrect, click here

    the dynamic part is the name of Syd Barrett in this example, which is introduced by a variable. now how the word 'here' to become a link to an ActionScript function and a different color?

    I was wondering how to do this also. There is a global function called asfunction, described in language AS as Reference: a special protocol for URLS in HTML text fields that allows an HREF link call an ActionScript function.
    The code below is what you're after. Your use does not need the setting but I included it for info. The parameter must be a single string, so if you want to pass multiple values, you need to analyze the in your function.

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

  • fat / itallic in the dynamic text field

    I can't work in a load dynamically the "BOLD" text field text - try foie gras < b > < /b > and < strong > strong < facilities > formatting tags...

    Use Flash 8.0

    I want to use the font is Bradley Hand ITC, which I have incorporated.

    Thank you

    Thank you - that would make sense - I don't have it get it...
    Thanks again.
    M

  • Scroll bar with the dynamic text field?

    I have a dynamic text field, multi-line. I have attached a scrollbar to it using drag component / move.

    It is empty, but gets text thrown in through the appendText() method when the user clicks a button.

    It works, but if there are more lines which fits in the text field, the scroll bar does not "activate" and allow the user to scroll to see it all.

    I'm sure I'm missing something simple here, can someone please help. Thank you.

    Use the scroll bar update() method after text is added.

  • How to get the name of the instance of button to display in the dynamic text box

    first of all, thank God for you people. Laughing out loud.

    Here is my scenario, I am the designer of consumate and learning coding by leaps and bounds, today its been a lot of stumbling blocks however.

    I have a site I designed that contains buttons that navigate the user at various points on the timeline using image tags. When they arrive at the appropriate image tag, they are presented with a movieclip containing two layers. The bottom layer is a card, and the top layer is a collection of buttons printer having a component tooltip on them showing you the information on detailed mouse printer on and takes you to the Remote UI printer on release. each button has a name of unique queue for the printer appropriate under its name of the instance (e.g. itm100_btn). Here's the jist... I want to be able to place a dynamic text box near the printer and using action script button it display printer queue name automatically simply based on the button, targeting, or even place the dynamic txt area inside the printer button mc. See, on some pages, there are like 24 printers... I'm AFRAID to have to put all these names in manually because there are total 150 printers! OUCH...

    Oh it is AS2.0 with Flash cs4

    In short... God bless you people... for the love of God someone help me? Laughing out loud.

    Thank you so much peoples!

    "I make things look purdy, but do not know why the sky is blue".

    to create a movieclip button:

    create a (insert/new symbol/movieclip) movieclip and attach a stop() to its first image and etiquette 'up '.  create any graphic you want for the up state button movieclip.  create a 'more' and, if necessary, a "low" setting

    When you place this button movieclip on stage give an instance name (for example, printer1) and use:

    {Printer1.onRollOver = Function ()}

    this.gotoAndStop ("over");

    }

    {Printer1.onRollOut = Printer1.onDragOut = Function ()}

    this.gotoAndStop ("up");

    }

    {Printer1.onPress = Function ()}

    this.gotoAndStop ("down");

    }

    and add your onRelease to do all that.

    If you also wanted to add a textfield that displays the instance name of the button when the button is postponed, place a textfield on the framework of the "over" and give it a name instance (say tf) and associated to the MovieClip "over" frame that uses:

    TF. Text = This._name;

  • Board for the dynamic text field problem

    I'm generating three text fields using an array of text data. The only text that appears is the content of the last element of the array. I have attached my code. Any ideas why three text fields are not created with the text inside elem table?

    Thank you!
    -Aaron

    These depths are not going to change, so each textfield replaces its predecessor. and then they all overlap because you do not change the ownership of the FLF to your textfields. (and your textformat object is not something useful, yet).

  • How to create a counter with timer and the dynamic text field?...

    I am creating a 'meter' item that uses a dynamic text box formatted for decompter.1 in increments of 3 times per second, from a specified value (so the viewer would see 3.1, 3.2 then... etc.)

    Here's the code so far:

    var counter:Number;
    counter = 3.0
    
    counterText.text=(String(counter));
    
    var timer:Timer = new Timer(300);
    timer.addEventListener(TimerEvent.TIMER, onTimer);
    timer.start();
    
    function onTimer(event:TimerEvent):void
    {
        ???
    }
    
    

    What I can't understand, is what should go in the box function for ajouter.1 seconds whenever the clock cycles. Any help would be appreciated!

    use:

    var counter:Number = 3.0;var increment:Number = .1;var upperlimit:Number = 12;
    
    counterText.text=(String(counter));
    
    var timer:Timer = new Timer(333);timer.addEventListener(TimerEvent.TIMER, onTimer);timer.start();
    
    function onTimer(event:TimerEvent):void
    {counter += increment; counterText.text = counter.toString();if(counter>=upperlimit){timer.stop();}}
    
    
    
  • Variable in the dynamic text field

    Hello

    I'm building a custom flash keyboard to display the text in the interface.  So far all that I tried failed, can someone point me to a simple script or tutorial that would help out me.

    Thank you

    Yann

    I know he can't answer your particular question, but I've posted a quick tutorial that simulates the QWERTY keyboard:

    http://AS3-blog.NET/snippets/keyboard.html

    This is an example of work and timing and class-based code.

  • How could I add together the numerical values in the dynamic text boxes?

    I do an application and I currently have sections such as travel, rent, etc., where you can press one of two buttons to increase or decrease the total number (fresh) for this article. All totals are displayed in the dynamic text boxes - here is an example of the code for a section-

    var FoodAndDrink:Number = 0;

    button1_btn.addEventListener (MouseEvent.MOUSE_DOWN, Add);

    function Add(e:MouseEvent):void {}

    Repasetboissons += 1;

    trace (FoodAndDrink);

    FoodAndDrink_txt.text = "£" + FoodAndDrink;

    }

    button2_btn.addEventListener (MouseEvent.MOUSE_DOWN, subtraction);

    function Subtract(e:MouseEvent):void {}

    Repasetboissons-= 1;

    If (repasetboissons < 0) {}

    Repasetboissons = 0;

    }

    trace (FoodAndDrink);

    FoodAndDrink_txt.text = "£" + FoodAndDrink;

    Does anyone know how I would go all add up all the sections so that the total is in a box and changes based on the total entered in each section?

    Thank you

    then use:

    import flash.events.MouseEvent;

    var FoodAndDrink:Number = 0;

    button1_btn.addEventListener (MouseEvent.MOUSE_DOWN, Add);

    function Add(e:MouseEvent):void {}

    Repasetboissons += 1;

    trace (FoodAndDrink);

    FoodAndDrink_txt.text = "£" + FoodAndDrink;

    addAllF();

    }

    button2_btn.addEventListener (MouseEvent.MOUSE_DOWN, subtraction);

    function Subtract(e:MouseEvent):void {}

    Repasetboissons-= 1;

    If (repasetboissons< 0)="">

    Repasetboissons = 0;

    }

    trace (FoodAndDrink);

    FoodAndDrink_txt.text = "£" + FoodAndDrink;

    addAllF();

    }

    var/entertainment: Number = 0;

    button3_btn.addEventListener (MouseEvent.MOUSE_DOWN, Add1);

    function Add1(e:MouseEvent):void {}

    Entertainment += 1;

    trace (Entertainment);

    Entertainment_txt. Text = "£" + Entertainment;

    addAllF();

    }

    button4_btn.addEventListener (MouseEvent.MOUSE_DOWN, Subtract1);

    function Subtract1(e:MouseEvent):void {}

    Entertainment-= 1;

    If (Entertainment< 0)="">

    Entertainment = 0;

    }

    trace (Entertainment);

    Entertainment_txt. Text = "£" + Entertainment;

    addAllF();

    }

    Hotels var: Number = 0;

    button5_btn.addEventListener (MouseEvent.MOUSE_DOWN, Add2);

    function Add2(e:MouseEvent):void {}

    Accommodation += 1;

    trace (Accommodation);

    Accommodation_txt. Text = "£" + accommodation;

    addAllF();

    }

    button6_btn.addEventListener (MouseEvent.MOUSE_DOWN, Subtract2);

    function Subtract2(e:MouseEvent):void {}

    Accommodation-= 1;

    If (accommodation< 0)="">

    Accommodation = 0;

    }

    trace (Accommodation);

    Accommodation_txt. Text = "£" + accommodation;

    addAllF();

    }

    var travel: Number = 0;

    button7_btn.addEventListener (MouseEvent.MOUSE_DOWN, Add3);

    function Add3(e:MouseEvent):void {}

    Travel += 1;

    trace (Travel);

    Travel_txt. Text = "£" + Travel;

    addAllF();

    }

    button8_btn.addEventListener (MouseEvent.MOUSE_DOWN, Subtract3);

    function Subtract3(e:MouseEvent):void {}

    Travel-= 1;

    If (trip< 0)="">

    Travel = 0;

    }

    trace (Travel);

    Travel_txt. Text = "£" + Travel;

    addAllF();

    }

    var bills: Number = 0;

    button9_btn.addEventListener (MouseEvent.MOUSE_DOWN, Add4);

    function Add4(e:MouseEvent):void {}

    Draft law += 1;

    trace (Bills);

    Bills_txt. Text = "£" + Bills.

    addAllF();

    }

    button10_btn.addEventListener (MouseEvent.MOUSE_DOWN, Subtract4);

    function Subtract4(e:MouseEvent):void {}

    Projects of law-= 1;

    If (bills< 0)="">

    Projects of law = 0;

    }

    trace (Bills);

    Bills_txt. Text = "£" + Bills.

    addAllF();

    }

    function addAllF (): void {}

    total_txt. Text = 'pound sign' +(FoodAndDrink+Bills+Travel+Accommodation+Entertainment);

    }

  • Load the Image of the URL entered in the dynamic text box

    I have an area of dynamic text (image_in) to receive a URL entry of an image to be loaded into a clip (peak) when you press a button (b_load).

    I can't make it work, the code seems pretty simple:

    var image_url:String = image_in.text;

    b_load.addEventListener (MouseEvent.CLICK, Load_URL);

    function Load_URL(event:MouseEvent):void

    {

    var i = new Loader();

    i.Load (new URLRequest (image_url));

    pic.addChild (i)

    }

    This code gives me: #2044 Error: Unhandled IOErrorEvent:. Text = Error #2035: URL not found.

    This code works when I declare the var as a URL:

    var image_url:String = " " http://website.com/image.jpg ";


    What is the difference if I go http://website.com/image.jpg in the dynamic text field? What's wrong?

    Any help would be appreciated, thanks!


    You declare the image_url variable after the dynamic text? If this isn't the case, then the value of this variable will be an empty string. Set the variable inside the function declaration, and it should work as expected.

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

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

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

Maybe you are looking for

  • Microsoft Update Error 8000FFFF

    I can't download or check the updates of windows.  I get error code 8000FFFF. There was a previous response to that proposed to solve the problems.  I tried this but it didn't work.  I looked up from my newspaper, and when it said fatal it is the mes

  • 9401 on cDAQ9178 acquisition of 2 coders

    Hello I have a problem to pour two acquisitions buffered on a NI9401 card mounted in a cDAQ9178. If I try to do a task (in MAX) with ctr0 and ctr1 Escalin 9401, I got a message telling me that I can't have just a meter by task. If I spot two do, exec

  • I run XP Professional, SP3 currently 32-bit mode. I can't change to 64 bit and how?

    I installed a new motherboard and processor that is capable of 64-bit.  The present operating system on my hard drive is 32-bit, Windows XP Professional "SP3.  Can I change to XP Professional 64 bit and if so, how? JimmyD1941

  • G56 graphics driver

    Hello I managed to install a dual boot XP/7 on my laptop G56 106SA by slipstreaming SATA drivers, but I still have a problem with the graphics drivers.  I have an ATi Radeon HD 4250 and HP or AMD provide a XP driver. I'm stuck someone can help?

  • How to activate WIndows calendar

    original title: have inadvertently disabled the windows calendar and therefore cannot make any changes or do any information - how to re - activate? JulieN Am new user and you have inadvertently disabled the windows calendar (found in the windows mai