Storing user input into a variable

Hello,
i dont know why but flash is being a pain!!
what i am doing should work as i have done pretty much as it
says from the official actionscript mx 2004 book.
Basically i am using the following code:
enter_btn.onRelease = function() {
gotoAndPlay(2);
forename = forename_txt.text;
surname = surname_txt.text;
gQuestionNum = 1;
this script is written so that when i press the enter button
the values entered into the forename_txt and surname_txt fields
should be stored in their respective variables (forename and
surname).
however when i use the following code on the next frame:
name_txt.text = forename + " " + surname;
to display the forename variable and the surname variable
into the name_txt field, it says UNDEFINED!!
what am i doiong wrong??
i know this is probably a simple thing to do but its normally
the simple thing which makes you wanna chuck your computer out the
window!!
please help if you can,
thank you and all replies will be much appreciated.
thanks again
lee

>>i dont know why but flash is being a pain!!
Because your code is wrong. You send the playhead to frame 2
before the vars are defined!!! Keep reading

Similar Messages

  • How to save User input into DB using webdynpro abap

    Hi,
    Im trying to create an application using webdynpro abap.
    I want to know how to save the data input by user, into a database table.
    In my UI, I have a table control which is editable and user inputs data into this. I need to know how i can transfer this data to a DB table.

    hello,
    u can do it by reading ur context node.
    we bind our UI elements to context attributes of appropriate type .
    we read their values using the code wizard or by pressing control+F7, click on radio button read node/attribute
    here for ur specific case , u must have binded ur table control with the context attribute , now u need to simply read this attribute
    eg suppose u have created a context node " cn_table"
      reading context node cn_table
       DATA : lo_nd_cn_table TYPE REF TO if_wd_context_node ,
             lo_el_cn_table TYPE REF TO if_wd_context_element ,
             ls_cn_table    TYPE wd_this->element_cn_table.
    *   navigate from <CONTEXT> to <CN_TABLE> via lead selection
      lo_nd_cn_table = wd_context->get_child_node(
                       name = wd_this->wdctx_cn_table ).
    **    get element via lead selection
      lo_el_cn_table = lo_nd_cn_table->get_lead_selection(  ).
      lo_el_cn_table->get_static_attributes( IMPORTING
                 static_attributes = wa_table ).
    here wa_table is the work area of structure type . u need to create a structure first with the same variables as there are the context attributes in ur node cn_table
    in ur
    now ur wa_tablecontains value
    u can nw use appropriate FM to update , delete and modify the DB table using the value
    u cn directly use SQL statements as well in the method of ur view , but direct SQL statements are nt recommende
    rgds,
    amit

  • Help With Homework Reading user input into an Array

    This program is to read questions from a file and retrieve user input as answers.
    This program is no where near complete, but I am stuck. (I dont know why, maybe its too late at night)
    I have a total of three classes. I am currently stuck in my main class. See Comments ("What the hell am I printing/ Will this work?"). In this next line of code, i need to read the question from the file to the user, and then accept their input.
    Main Class:
        public static void main(String[] args) {
            try {
            Scanner in = new Scanner(new FileReader("quiz.txt"));
                catch (Exception e) {
                System.out.println(e);
            ArrayList <Questions> Questions = new ArrayList<Questions>();
            ArrayList<String> answers = new ArrayList<String>();
                  for (Questions qu : Questions)
             System.out.println(); //What the hell am I printing.
             String answer = in.nextLine(); //Will this work?
             answers.add(answer); //This should work
          }Questions Class:
    public class Questions {
        String Questions = "";
        public String getQuestions() {
            return Questions;
        public void setQuestions(String Questions) {
            this.Questions = Questions;
        public Questions(String Questions)
            this.Questions = Questions;
    }answers class:
    package QuizRunner;
    * @author Fern
    public class answers {
        String answers = "";
        public String addAnswers() {
            return answers;
        public answers(String answers) {
            this.answers = answers;
        }

    doremifasollatido wrote:
    According to standard Java coding conventions, class names should start with a capital letter (so, your "answers" should be "Answers"). And, variable and method names should start with a lowercase letter (so, your "Questions" should be "questions").
    And classnames should (almost) never be plural words. So it should probably be an 'Answer' and something else containing a collection of those objects called 'answers'.
    Also, *your variable name should not be the same (case-sensitive match) as your class name.* Although it will compile if done syntactically correctly, it is highly confusing! I first wrote this because you did this for both "Questions" and "answers" classes in their class definition, but you also used "Questions" as your variable name in 'main'. (Note that applying the standard capitalization conventions will prevent you from using the same name for your class name as for your variable name, since they should start with different cases.)
    Of course having an 'Answer' called 'answer' is often fine.
    Your Questions class should probably be called "Question", anyway--it looks like it should hold a single question. And, your "answers" class should probably be called "Answer"--it looks like it should hold a single answer. You aren't using your "answers" class anywhere right now, anyway.Correct. There might be room for a class containing a collection of Question objects, but it's unlikely such a class would contain just that and nothing else.

  • Storing Page Count into a Variable

    Hi,
    In an RTF template, how can I write an expression to store the total number of pages (<fo:page-number-citation ref-id='xdofo:lastpage-joinseq'>) into a variable.
    TIA,
    Jonathan

    You cant have the value stored in a variable. This information will be available only when the page is rendered, and not at the translation stage.
    You can brief your requirement here so that we can check if it can be achieved with alternates.

  • How to cast a String input into Date variable?

    I am using JOptionPane.showInputDialog to ask user for a date input. This will be read in as a String. I need to pass it to a variable call date. And when I print date using JOptionPane, it should be shown as whatever the user keyed in in this format: 25/2/09. How do I do it?

    By the way, that's not casting. Casting is when you have a variable whose type is at a particular level of detail, and you assign it a different level of detail -- say, casting an int to a long, or a List to an ArrayList.
    What you want to do is convert one type to a completely different one. In particular, you're going to do that by using SimpleDateFormat to parse the String -- that is, SimpleDateFormat will read the string, pick out the individual parts that express the date, and create a Date object that corresponds to it.

  • Storing user information into session best practice.

    I am developing an web application where user first have to login to be able to enter.
    When user correctly logged in an UserAccount object with all user data (except loginName and Password) is being stored into session. An Filter is checking session for UserAccount object and if user correctly logged in forwards the request to the next filter in the application.
    When user logged out, the session object is being destroyed. �Session invalidate()�
    I would like to know if there are better solutions for this.
    Thank you in advance.
    --Nermin B.

    You may want to also re-evaluate your "application" as a whole.
    In most cases - yours may be the exception - session objects are used to well, associate a particular web browser with a particular user. There usually is little need to retain additional information about that person, unless that information is frequently accessed. I think Shok used a poor example; a person's address, phone number, credit card number and so on is usually accessed once per visit, whereas the contents of that person's shopping cart is generally accessed every time the user changes web pages.
    The key concept here is you want to balance memory consumption verses database hits (or file i/o). Authorization info should be in the object, whereas general background info can be in the data source and accessed when needed.
    If on the other hand, you don't have a data source, you don't really have much of a choice and a session object (or similarly, a JavaBean) should just go ahead and contain all of the information about the user.
    To change the subject, session objects and JavaBeans are server side. As long as you keep a careful eye on the interfaces to those objects, you should be fine security wise. For example, if a person passes a parameter to your web page, make sure the parameter is anticipated and correct before you save it in the object. In other words, don't write a generic function that blindly accepts parameter names and values and sets them accordingly within the session object. The only place you should be able to set the password attribute is from the change-your-password JSP page.
    Cookies on the other hand are definitely stored on the client's machine, and yes, you want to be really paranoid and make sure that the cookie you are retrieving is the cookie you are expecting. I think the source of confusion is that session ids corresponding to session objects can be stored within a cookie - so you if can change the id, the server thinks you are someone else and uses that person's session object.

  • [C] piping user input into system() call (or similar)

    Hey guys,
    I'm working on creating a C program I think will be really neat to use with linux and scp but I have run in to a roadblock.
    I need to pass a statement to the system from my C program but with user defined variables, allow me to explain with an example:
    #include <stdio.h>
    int main()
    gets (port);
    gets (cypher);
    system("scp", "-P" port, "-c" cypher);
    return(0);
    Now obviously (and sadly!) this doesn't work. Can anyone help me achieve this goal?
    Regards,
    Mike.
    Last edited by DrMikeDuke (2009-10-12 23:01:18)

    Fork and exec is probably the more common way of doing it, but from your example you probably want something like this (can't guarantee this will work but it should help):
    #include <stdio.h>
    int main()
    char temp[256], port[32], cypher[32];
    gets(port);
    gets(cypher);
    // This line uses formatted printing to insert variables into a string
    sprintf(temp, "scp -P %i -c %s", atoi(port), cypher); // %i = int %s = string/char array
    system(temp);
    return 0;
    the "atoi" part isn't actually necessary at all but is something to take a note of for future usage. It converts a string into an integer.
    Last edited by HashBox (2009-10-13 04:56:41)

  • History of user Input values in variable entry screen

    Hi Experts,
    I have a small issue. I have a variable entry screen where I select values from the list. I can always see the history of variable values I input earlier when I click on the dropdown box. For example the country code displays all my previous inputs.
    Similar to the web browsers history.
    Not the same case with Fiscal Year/Period. I do the same type of selection  from the combo box for example 12.2006. I give different values again like 1.2007, 2.2007 etc and run the report several times. But it doesn't show up the history of my previous entries unlike the country code.
    Kindly help, points assured.
    Thanks,
    Raj.

    What we've done isn't pretty, and I'm hoping for a better solution.
    We've developed 3 ODSs that we've exported a full list of all attributes and their values to.  Each ODS is identical.
    We've then created an InfoSet to link the Product Cube to each of the 3 ODSs.  We can then add 3 variables to the query representing each ODSs.  Since the ODS holds over half a million attributes, we limited it to 3 since it takes 30 minutes to run.
    It's not elegant, it's not pretty, and I'm sure it's not optimal.  I'm hoping someone can describe a better solution.

  • Best practice: storing user input as application wide config

    example: a webmail application is deployed as a war-file to a server. the fresh deployed app now needs to read info from the user (mail-host, username, password, etc.).
    what is the best way to store this information permanently on the serverside for as long as the app is not undeployed (i.e. persistent even after server reboot)?
    thx

    and what if i wanted an installer (setup script) that stores database connect info from a submitted html form?
    basically i need a standard way of storing data without unpacking the war and editing a .xml file. kind of chicken and egg issue.

  • Transferring User Input Into an Array

    I want the user to input whats inside the matrix so I tell them "Enter Row 1 of Matrix 1: " Say for example they entered the length of the square matrix as 3, I would then want them to enter something like "1 2 3" as Row 1. With my current code I get:
    3 3 3
    3 3 3
    3 3 3
    I cant figure out what I should change so that its:
    1 2 3
    1 2 3
    1 2 3
    Thanks so much for any help. Heres the code so far:
    import java.util.Scanner;
    public class MatrixAddPro
      public static void main (String[] args)
         int row1, col1;
         Scanner scan = new Scanner(System.in);
         System.out.println("Enter the length of the square matrix: ");
         col1 = scan.nextInt(); 
         int[][] a = new int[col1][col1];
         System.out.println("Enter Row 1 of Matrix1: ");
         while(scan.hasNext())
         a[1][1] = scan.nextInt();
         //for (int row = 0; row < a.length; row++)
            //for (int col = 0; col < a[row].length; col++)
               //a[col1][col1] = scan.nextInt();
         for (int row = 0; row < a.length; row++)
            for (int col = 0; col < a[row].length; col++)     
               System.out.print(a[1][1] + "\t");
            System.out.println();  
    }

    import java.util.Scanner;
    public class MatrixAddPro
      public static void main (String[] args)
         int input, row, col;
         Scanner scan = new Scanner(System.in);
         System.out.println("Enter the length of the square matrix: ");
         col = scan.nextInt(); 
         row = col;
         int[][] a = new int[row][col];
         for (int x = 0; x < row; x++)
            for (int y = 0; y < col; y++)
               {System.out.println("Enter Row"+(x+1)+" Col"+ (y+1));
               input = scan.nextInt();
               a[x][y] = input;
         for (int x = 0; x < row; x++)
            for (int y = 0; y < col; y++)     
               {System.out.print(a[x][y] + "\t");
               System.out.println();      
    }OUTPUT:
    Enter the length of the square matrix:
    3
    Enter Row1 Col1
    1
    Enter Row1 Col2
    2
    Enter Row1 Col3
    3
    Enter Row2 Col1
    1
    Enter Row2 Col2
    2
    Enter Row2 Col3
    3
    Enter Row3 Col1
    1
    Enter Row3 Col2
    2
    Enter Row3 Col3
    3
    1
    2
    3
    1
    2
    3
    1
    2
    3
    Alright so now its not printing in rows...
    Thanks for your patience/help guys.

  • Dividing User Input Into Separate Line Items

    The user will input the following information:
    (1) Start date
    (2) Number of weeks
    (3) Weekly Benefit
    Example:
    03/14/08 start date
    4 weeks
    $200.00 per week
    We want to break down the key information as shown below.
    Week 1 of 4 3/14/08 $200.00
    Week 2 of 4 3/21/08 $200.00
    Week 3 of 4 3/28/08 $200.00
    Week 4 of 4 4/04/08 $200.00
    Total $800.00
    Each line will be a separate entry to the database. This would allow the user to easily change/delete a week's benefit.
    Your help is greatly appreciated!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    If there is an easier way to do this, please let me know..........
    Thanks Very Very Very VERY VERY MUCH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    We did indeed, this should fix it:
    with criteria as (select to_date('03/14/08', 'mm/dd/rr')  as start_date,
                             4 as periods,
                             'Week' as period,
                             200 per_period from dual),
    periods as (select 'Week' period, 7 days, 0 months from dual
      union all select 'BiWeek', 14, 0 from dual
      union all select 'Month', 0, 1 from dual
      union all select 'ByMonth', 0, 2 from dual
      union all select 'Quarter', 0, 3 from dual
      union all select 'Year', 0 , 12 from dual
    t1 as (
    select add_months(start_date,months*(level-1))+days*(level-1) start_date,
           per_period,
           c.period||' '||level||' of '||c.periods period
      from criteria c join periods p on c.period = p.period
    connect by level <= periods)
    select case grouping(start_date)
                when 1 then 'Total'
                else to_char(start_date)
           end start_date,
           sum(per_period) per_period,
           period
    from t1
    group by rollup ((start_date, period))
    START_DATE                 PER_PERIOD             PERIOD                                            
    14-MAR-2008 00:00          200                    Week 1 of 4                                       
    21-MAR-2008 00:00          200                    Week 2 of 4                                       
    28-MAR-2008 00:00          200                    Week 3 of 4                                       
    04-APR-2008 00:00          200                    Week 4 of 4                                       
    Total                      800                                                                      
    5 rows selectedOf course I figured that you wanted to use the query to populate another table in which case you would get the summary information from the table populated with this data, since you wanted to be able change and/or delete entries at a later point in time. Adding the summarized data now makes this query less useful as the data source of an insert statement.
    Message was edited by:
    Sentinel

  • Question Pertaining to User Input

    I'm have trouble figuring out how to prompt for user input and then use that user input as part of my code. For instance, I want to declare two variables that will hold complex numbers. Then, I want the user to input two complex numbers. After this, I want to place those two newly inputted into the variables that I created. Then I want to determine which of those two has a greater norm/modulus. Finally, I want to print those results out.
    Here is my code so far:
    Normalizable m1 = new Complex();
    Normalizable m2 = new Complex();
             System.out.println("Enter the real and imaginary parts of a complex number: ");
             BufferedReader br = new BufferedReader(new InputStreamReader(System.in));Please point me in the right direction.

    I was making two points at once - and in doing so I might have made it sound more daunting than it really is.
    The first point was a direct answer to your question: use readLine() to get the user input, String methods to break it up and parseDouble() to obtain numerical values to create your Normalizable/Complex.
    I really don't think there's a more straight foward way of approaching things. Try it and see if you can sucessfully read in a single complex number and display it.
    {noformat}
    Enter the real and imaginary parts of a complex number>12 -5
    You entered 12.000 - 5.000i
    {noformat}You will need the API docs for the relevant classes and have read them. Post what you've come up with for this first part of the problem if you get stuck. (I doubt if anyone here will actually write the code for you, since that would take all the fun out of it.)
    Regarding the second point, you're right: by suggesting an auxillary method to read and parse the input I was adding some complexity. Feel free to ignore that suggestion. Personally I prefer a little complexity if it reduces complicated code to managable pieces. Complications will grow into a tangled mess (and are a place for bugs to live in); complexity can always be dealt with one small well documented chunk at a time.

  • Email notification User Input property

      I have query results from service request as part of user input into Service Request and processing them in Orchestrator.
      As a part of email notification, I would like to display the same query results as part of body of email notification.
      Query results are displayed as part of User Input in Service Request
      In email notification I am able to display all fields of service requests except User Input maybe because its inturn a XML value.
      Any suggestion to come across this ?
    Shahid Roofi

    I am assuming that you are sending the email notification as HTML, in that case the "User Input" will be filtered as it starts with < and ends with > (HTML notification will filter the context between <...>)
    You have to use a PS script in Orchestrator to get the query results only from the "User Input" without all the junk info between <...> then return that using Published Data tab so you will be able to use it in the runbook activities such
    as the email activity.
    Do you have a working example of how to do what you describe?  I am trying to accomplish the same thing and having alot of difficulty coming up with a proper solution.  Any help is appreciated!

  • MVC 5 Database Help (calculations and input based on user input)

    Hello all! I am learning MVC 5 database interactions. I would like to fill in certain database columns based on a calculation done on columns the user inputs. I am not having trouble getting user inputs into the database. I am wondering
    about how to take 2 user input database values, make a calculation using them, and put the resulting number in its own column in the database.
    So: after the user inputs price and lot price, I want the application to figure out the margin (price / lot price) and then input margin into the database. Here is what I have, but the calculation doesn't seem to input the result into my database.
    Where am I going wrong? (margin is already a column in the database)
    Thanks in advance!
    publicActionResultCreate([Bind(Include
    = "ID,Name,Price,Location,Color,LotPrice")]
    Automobile automobile)
    if(ModelState.IsValid)
                    db.Automobile.Add(automobile);          
    automobile.Margin = automobile.Price / automobile.LotPrice;
                    db.SaveChanges();        
    returnRedirectToAction("Index");
    returnView(automobile);

    Hi Ruben,
    Please post your question to the MVC forum below for a better assistance on your issue:
    http://forums.asp.net/1146.aspx
    Regards,
    Fouad Roumieh

  • User input from pl/sql

    How could I get user input from a pl/sql block?
    Hope that somebody can help me.
    thanx
    Amelio.

    There is a package DBMS_LOCK that has a SLEEP routine, which suspends the session for a given period of time (in seconds).
    However, you can only pause the procedure and not accept user input into the procedure during the pause.
    syntax: DBMS_LOCK.SLEEP(1) ;
    I need only to run an 'pause' or something like that within a pl/sql block. Do you know if it's possible? Thanks.

Maybe you are looking for

  • Help with resultset and looping thru a sql filed

    Hi, I have a SQL statement which connects two tables with accounting number, the table2 have multiple rows for one accounting number in table1. So I did if else condition in accounting number in resultset as following: List<AccRecord> retval = new Ar

  • Receiver File adapter Append Mode

    Hi I have scenario where i am sending multiple idocs to file ...when i putting the file construction mode to append i can put multiple idoc in to file but i wanna do it on daily basis Means i wanna send the newly crated or changed Idoc on a daily bas

  • "An error occured when trying to run iTunes.exe"

    The problem I have occures when opening iTunes or when it has been open for approximately one minute. There's this error message poping up and tells me that iTunes ran into a problem and has to be closed. This also appears when trying to add music to

  • Adpatch fails for patch#6526775

    Failing Command =============== /oracle/finpatch/finprodappl/fnd/11.5.0/bin/FNDLOAD &ui_apps 0 Y UPLOAD @AZ:patch/115/import/azselset.lct @AZ:patch/115/import/US/azgssfinou.ldt Log filename : /oracle/finpatch/finprodappl/admin/finpatch/log/l601831.re

  • Reverse Stock Items

    Dear experts, Could you please give your advice on the below issue, We have some items GR into stock , I have perfomed bothe GR/IR and the vendor invoices were paid too , Now I relaised these should not be a sockable items , How can these items can b