Creating Add button and array

Hello,
     I am sure this has been brought up before but I am still not clear on the procedure as I am still new to this. In my coldfusion application I need to create a Button with 'ADD' function.
When the button is clicked a new text field with a checkbox is created, however, these will need to have a unique names because they will be submitted into MySQL Database table. Of course, unless a dynamic variable can be created and submitted.
I think I need to get an array function in javascript/ajax?
I appreciate any help.

Yes thank you.
I  know some about the element function in java, but what I worry about is when sending the data into the MySQL and it may be multiple inputs anywhere from 1-500, so I need to create multiple elements. As far as I understand it.
When I ran my test, the database only inpuy the original text but nothing from the elements I've created using javascript.
Here is my script:
<td colspan="3"> Item 1 <cfinput type="checkbox" name="Item" value=" Item1"> </td></tr>
<tr>    
<td align="left">Text: </td>
<td>     
<!--- textfield --->   
<cfinput  type="text" name="Text1" size="30">    
</td> </tr>
<tr>
<td align="left">Comments:</td> <td>      <!--- textarea --->
<textarea name="Comments" cols="30" rows="5"></textarea> <br>
<input type='button'  value='MORE' onclick='addbox()'>
</td>
<td>
<div id = "Input1"></div>
<div id = "Input2"></div>
<div id = "Input3"></div>
<div id = "Input4"></div>
<scripttype = "javascript">
var i = 1;
function addbox() {
if (i <= 4) {  // max number of inputs
document.getElementById('Input'+[i]).innerHTML =  "<input type='text' name='text1' value='Enter Text Here' size = '15' /><br> Comments:<textarea name='Comments' cols='30' rows='5'></textarea> <input type='button' value='MORE' onclick='addbox()'>";
i++;}else {
alert ("No more inputs are possible")
</script>
</td>
Of course, once the this step is complete, the form is being submitted as a whole
The following page is contains SQL Commands of:
<cfquery datasource="test">
INSERT INTO ProcessTBL (Item, text1, comments)
VALUES ('#Trim(Form.Item)#', '#Trim(form.Text1)#', '#Trim(form.comments)#')
</cfquery>
All functions as it should, but the problem I am running into is that only CFINPUT text is being inserted into the database and none of the javascript inputs, unless, of course I am missing a variable. Another concern I have is that, once again, the input may be up to 500 variables.
Once again, I appreciate your help.

Similar Messages

  • Creating radio button and make it ennable

    Hello All ,
    Please help me out in creating radio button and make it ennable in web dynpro in java application .
    If Possible please send the sample code as well.
    Thanks
    jyothi.

    Hi Venkat,
    The default value needs to be set manually as John has suggested. To be more precise, if the context node is "RadioButtonValues" and the context attribute is 'RadioBtnVal', then in wdDoInit() method, include the following:
    wdContext.currentRadioButtonValuesElement.setRadioBtnVal("Male");
    Regards,
    Pavithra

  • Creating Logout button and invalidating session

    Hello All:
    I'm new to java and I'm trying to figure out how to log a user out of a web servlet. Basically I just have a link that returns the user to the first servlet (my login servlet) called log out. I am wondering if when I click on that link (or do I need to make it a button) that I can tell the servlet to invalidate the session I have created, therefore allowing a new user to login from the login servlet.
    I honestly have no idea how to go about this. The following is my code from another servlet in my group:
    import java.io.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * @author Owner
    * @version
    public class Item1ServletHW2 extends HttpServlet {
    /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
    * @param request servlet request
    * @param response servlet response
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    HttpSession session = request.getSession(true);
    String getuser = (String)session.getAttribute("getuser");
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet Item1ServletHW2</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<form action=>");
    out.println("<table border=1 align=center width=65%>");
    out.println("<tr><td align=center bgcolor=blue colspan=3><font color=white size=3>Welcome to the Music CDs Page </font><font color=red size=3><b>"+getuser+"</b></font></td></tr>");
    out.println("<tr><td width=60% bgcolor=green align=center><font size=2 color=white><b>Item</font></td>");
    out.println("<td width=10% bgcolor=green align=center><font color=white size=2><b>Unit Price</b></font></td>");
    out.println("<td width=40% bgcolor=green align=center></td></tr>");
    out.println("<td bgcolor=green align=left><img src=coldplay.jpg><font color=white size=2>ColdPlay X&Y</font></td>");
    out.println("<td bgcolor=green align=center><font color=white size=2>$19.99</font></td>");
    out.println("<td bgcolor=green align=center><input type=button name=addcart2 value=Add to Cart></td>");
    out.println("</tr>");
    out.println("<td bgcolor=green align=left><img src=oakenfold.jpg><font color=white size=2>Oakenfold - The Club</font></td>");
    out.println("<td bgcolor=green align=center><font color=white size=2>$17.99</font></td>");
    out.println("<td bgcolor=green align=center><input type=button name=addcart1 value=Add to Cart></td>");
    out.println("</tr><tr><td colspan=3 align=center><font size=2 color=white><a href=CatServletHW2>Main Catalog</a> | <a href=ShopCartServletHW2>View Cart</a> | <a href=RegLoginServletHW2>Log Out</a></font></td></tr>");
    out.println("</body>");
    out.println("</html>");
    out.close();
    The Log Out link is the one I want to check when clicked, and if so, invalidate my session before the user is redirected to the RegLogin Servlet. Any help would be greatly appreciated. Thanks so much :).

    I understand how to invalidate the session, but with this example:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class logout extends HttpServlet
              public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
                   res.setContentType("text/html");
                   PrintWriter pw = res.getWriter();
                   HttpSession ses =req.getSession();      
                   ses.removeValue("desi");
                   ses.removeValue("Login");
                   ses.removeValue("password");                    
                   res.sendRedirect("http://localhost:8080/examples/servlets/login.html");                    
    How can I get this to process when clicking a link called "Log Out", or is there a way to create an onClick button that invalidates the session when clicked. Maybe something like this:
    onClick="session.invalidate();response.sendRedirect("somewhere");>
    Thanks for the helps, but I'm still a bit confused :).

  • Add waveform and array

    While looking at this thread, I discovered an undocumented "feature" of LV which can cause severe performace problems with modest sized arrays and waveforms.
    In the original thread an attempt was made to remove the DC component from a waveform by subtracting  an array (rather than a scalar). Both the Y array in the waveform and the array of DC components were the same size with less than 15000 elements. Attempting to run that part of that VI resulted in severe slow down of not only LV but the OS and everything else running on the computer because it was paging data to/from disk.  The only thing wired to the output of Subtract was a graph.
    The result of subtracting an array of numerics from a waveform is an array of waveforms having the same number of elements as the array of numerics. The size of the Y array in the waveform does not seem to matter. The attached VI has the array of numerics and the Y array of the waveform the same size.
    The same thing happens with Add.
    The Detailed Help for Add and Subtract do not mention this combination. The example linked on those help pages also does not show this combination.
    The Profiler gives this data for the attached VI:
    Samples Bytes
    10               15 kB
    100           295 kB
    1000          24 MB
    2000          97 MB
    3000        217 MB
    4000        385 MB
    5000        602 MB
    6000        866 MB
    7000      1178 MB
    8000      1538 MB
    At 7000 samples I start to hear the disk drive while the VI runs and at 8000 the disk is very busy.
    After some thought I decided that this is not a bug, but because of the way the data size explodes, it should be documented.
    Clearly this is not a common use case, but I could see someone trying to do baseline correction on data from an instrument this way, as that is essentially what the thread linked above was trying to do.
    Output configuration is not available after a waveform is wired, probably because of the polymorphic VI used for waveforms. An output configuration option to create a single waveform with element by element addition/subtraction might be useful.
    Lynn
    Attachments:
    Subtract array from waveform.vi ‏20 KB

    Wow, that is kind of weird.  The way I see it, when you subtract a waveform and a numeric array, the subtraction should just be done on the Y component of the waveform.  So you should still just have a single waveform out.  So by subtracting a waveform with an array of numerics, it should act the same as if you extracted the Y, did the subtraction, and put the Y back in.  This could lead to a shortened size of Y, but I see no reason why you should get an array of waveforms out.
    But after running your VI, I guess I can see what LabVIEW is doing.  It is as if you used a FOR loop with just the numeric array autoindexed and then you autoindex the output waveform.
    I can see the intent, but it just doesn't sit right with me.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Creating radio buttons and text box in the screen

    Hi Guys,
    Need help asap. I am writing a report and I have to create text box for user to input GL account numbers for two types of customer. I have to make these fields required and take the data back from the screen and write it in a file. The second thing that I have to do is to make radio buttons for the user to select whether he wants the file written on the application server or the presentation server. and process the report accordingly. Now can somebody please given some code and tell me how I should do this. Both the things have to be done for the same report. Please help.
    Thanks,
    Minal

    Hi,
    TABLES: likp,
            lips.
    TYPES: Begin of ty_likp,
           vbeln like likp-vbeln,
         end of ty_likp.
    TYPES: Begin of ty_lips,
           vbeln like lips-vbeln,
           posnr like lips-posnr,
         end of ty_lips.
    DATA:  i_likp TYPE STANDARD TABLE OF ty_likp,
           i_lips TYPE STANDARD TABLE OF ty_lips,
           w_lips TYPE ty_lips,
           w_likp TYPE ty_likp.
    SELECTION-SCREEN BEGIN OF BLOCK b_0 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:  s_delno FOR likp-vbeln,
                     s_type  FOR likp-lfart,
                     s_ship  FOR likp-vstel,
                     s_date  FOR likp-erdat.
    SELECTION-SCREEN END OF BLOCK b_0.
    SELECT vbeln
             FROM likp INTO TABLE i_likp
             WHERE vbeln IN s_delno
             AND   lfart IN s_type
             AND   vstel IN s_ship
             AND   erdat IN s_date.
      IF sy-subrc <> 0.
        MESSAGE i000 WITH text-002.
        " No valid deliveries for the selection parameters entered.
        STOP.
      ENDIF.
      IF NOT i_likp[] IS INITIAL.
        SELECT vbeln
               posnr
               FROM lips INTO TABLE i_lips
               FOR ALL ENTRIES IN i_likp
               WHERE vbeln = i_likp-vbeln.
      ENDIF.
    format color 1 on intensified on.
      WRITE: /01(46) 'Following are the Hanging Deliveries/Invoices:'.
    format color off intensified off.
    skip.
    format color 1 on.
      WRITE:  SY-ULINE(27).
      WRITE: /1       SY-VLINE,
              3(12)    'Document No.',
              16      SY-VLINE,
              17(8)  'Item No.',
              27      SY-VLINE.
    write:/1 sy-ULINE(27).
    format color off.
      sort i_lips by vbeln posnr.
      LOOP AT i_lips INTO w_lips.
          Read table i_likp into w_likp with key
                            vbeln = w_lips-vbeln
                            posnn = w_lips-posnr.
          if sy-subrc <> 0.
          format color 2 on.
             WRITE: /1   sy-vline,
                    3(12)  w_lips-vbeln,
                    16  sy-vline,
                    17(8)  w_lips-posnr,
                    27  sy-vline.
            write:/1 sy-uline(27).
            format color off.
            clear w_lips.
          endif.
          ENDLOOP.
    Try this one with ur own example.
    Thanks & Regards,
    Judith.

  • Create a Button and run ABAP

    Hi,
    I´m trying to put one button (or link) in my Web Template and call an ABAP code.
    Shailesh comments about service help and I search many discussions about this, but I dont know how can I do this.
    I created a two class:
    ZBUENO (Super Class CL_RSR_WWW_MODIFY_TABLE)
    Z_SERVICE (Super Class CL_RSR_WWW_HELP_WINDOW)
    Putted on my Web Template, break-points was working, but I need to execute one ABAP when the user clique on button, otherwise, every time my ABAP will be executed.
    Tks for any help,
    Bueno

    Dear Frank, please, can you take a look on this code:
    The first part we create a link to try cmd SUBMIT and in my class Z_SERVICE I putted a break-point on PROCESS_CMD method. Is this correct?
    <BODY>
    <P> </P>
    <A href="<SAP_BW_URL cmd="SUBMIT" help_service="Z_SERVICE" item="TABLE_1">">Generate File</A>
    <P><object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="GET_ITEM"/>
             <param name="NAME" value="TABLE_1"/>
             <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_GRID"/>
             <param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>
             <param name="WIDTH" value="651"/>
             <param name="HELP_SERVICE_CLASS" value="Z_SERVICE"/>
             ITEM:            TABLE_1
    </object></P>
    </BODY>
    Very thank you !!

  • Javascript code to enable an ADD button to create duplicate tables and pages for multiple entries

    I am using Adobe XI Pro. I have created a multi-page fillable pdf questionnaire that I want to make interactive to the user. Within each page, I have multiple tables that can have ADD buttons to duplicate the table if the client wants more than one test. I would like this table to insert directly below the previous table and they may be able to add upto 5 of these table.
    I also have a couple pages in the questionnaire that require duplication for multiple samples. Eg. One page per sample, and I may have upto 10 samples. I would like the javascript to have an ADD button and then add each page behind the previous related sheet (Original and duplicates together)
    I am not a javascript coder so I would need some examples and a walk through. I did take some developer courses in engineering but it has been almost two decades
    I have search on several forums and cannot find a good resource so I appreciate the help.
    Sincerely
    Tara

    Some of what you want to do can be done using template features and a bit of JavaScript, but if your users will be using Reader, version 11 will be required. You can dynamically add new pages, but adding new tables to existing pages with reflow of content that comes after is not possible with a form created in Acrobat. If you have access to Adobe's LiveCycle Designer form creation software, you can create what's known as a dynamic XFA form that can do all of what you want. You can ask in the LiveCycle Designer forum for more information: http://forums.adobe.com/community/livecycle/livecycle_modules_and_development_tools/livecy cle_designer_es?view=discussions

  • How do you enable 'Create Content' button on 'Add Content' page?

    How do you enable ‘Create Content’ button on ‘Add Content’ page?
    There is new functionality to a ‘Layout’ type personalization page like ‘Sales Dashboard’.
    Bug 4503123 INCONSISTENT WAY OF ADDING USER-DEFINED REGIONS ON WYSIWYG PAGE:
    There’s no way to add custom content to a configurable page.
    Add a “Create Content” button and let the user create a piece of content that extends to a region he creates.
    It says: Fixed->11.5.10.3CU
    In Oracle® Application Framework Personalization Guide Release 11i Part No. B25439-02 it says:
    p 4-5
    If you personalize a non-configurable page (a page that does not have the necessary metadata to personalize its layout) or when you run your application in Accessibility mode (profile option Self Service Accessibility Features (ICX_ACCESSIBILITY_FEATURES) is set to Standard Accessibility), you will not see the Page Layout Personalization page, as shown below. Instead, you will see the Page Hierarchy Personalization page, page 4-12, where you can perform the same personalization functions, using a descriptive tabular user interface.
    It tried this and can’t get it to display.
    Has anyone run accross this before?

    user587952,
    Can you describe your issue in detail forgetting those references for the time being. What exactly are you trying to do?
    Check this from the dev guide:
    In order to be able to take full advantage of page layout personalization capabilities, it is important when you create your configurable page, to use flexibleLayout and flexibleContent regions at all levels when you create the page hierarchy structure under your page layout region. In Oracle Applications, this is required, as it is the coding standard.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Dynamic buttons and itemlisteners????

    I'm trying to do something that might not be possible. I would like to create some buttons and actions for those buttons on the fly. For example:
    1) read some files from a directory (these file store settings)
    2) Create buttons using the filenames as the button labels
    3) Create associated actionPerformed section related to those buttons
    I want to do this because the amount of files and there names could change all the time. Basically I want to create a button for each file, and essentially launch an application using the settings file as part of a process.
    So far I've read a filename into a string. The first problem, how do I use that filename as the name of a button?
    JButton "string value" = new JButton();
    Then, subsequently, how to you set up the action? See code snipet below.
    Hope that made some sense. Can anything like this be done?
    Thanks,
    James
    //this loads the buttons
    for (int i=0; i < main.size(); i++)
         Vector temp = new Vector();
         temp = (Vector)main.elementAt(i);
         JButton buttonName = new JButton((String)temp.elementAt(0));
         buttonName.addActionListener(this);
         northFlow.add(buttonName);
    //this is in the actionPerformed section
    for (int i=0; i < main.size(); i++)
         Vector temp = new Vector();
         temp = (Vector)main.elementAt(i);
         if (source == (String)temp.elementAt(0))
                loadProgram((String)temp.elementAt(0));

    There is a way to give a button a variable name equal to the file name but it involves extremely advanced Java programming involving creating dynamic class instances. I would strongly discourage this approach because debugging it when it doesn't work, can be a nightmare.
    There is a much easier way to do this however. Create an array of JButtons. Call it, oh say, "MyButtons". Then at the appropriate places, you can do:
    JButton[] MyButtons;
    MyButtons = new JButton[ main.size ];
    for ( int i = 0; i < main.size(); i++ ) {
       Vector temp = new Vector();
       temp = (Vector)main.elementAt(i);
       MyButtons[i] = new JButton( (String)temp.elementAt(0) );
       MyButtons.addAction...
    Incidently, you may also want to re-think your data structure. From what I understand, you have an array where each element is a vector (another array of zero or more elements). This results in code that is difficult to read and write. Consider making your own objects instead of using vectors, then you could write something like...
    for ( int i = 0; i < main.size(); i++ ) {
       if ( source == main.getProgramName() ) {
    loadProgram( main[i].getProgramName() );
    The nice thing about this approach is that you can mix and match objects within the array, or add elements to each object in any particular order and it won't break the rest of your code.
    P.S., use the square brackets to indicate arrays. For some reason, this board is converting them into angle brackets.

  • Add button to SNC screen

    Dear Experts,
    I have a requirement in SNC system.
    Requirement: Add a new button on screen Due List for Purchasing Documents, if we click on the button it has to open a new screen where we should have a file browse filed, browse and upload buttons to upload ASN details from presentation server.
    am using,
    WebDynpro Component: /SCF/UIWD
    WebDynpro Application: /scf/snc_s
    I have used following details to add button and acheived to add button alone, but how can I assing action/event, where can I create the screen, where can I write code and how can I assign this to button action.
    ApplicationID: ICH
    ScreenID: DUELIST
    ComponentID: DLRLTLR1
    Please help me out, almost from 2 weeks am doing R and D on it.
    Thanks in advance
    Pallu

    Thanks for your inputs Sai, but here the screen design is not static as normal webdynpro, normally we add a button and in OnAction property we create new action and we write code for the corresponding method, but in my case (expecially in SNC) everything I need to do with configurations, the transaction for screeen configuraitons is /N/SCF/SCREENCFG, and the BADI which I used for adding button is /SCF/UIMDL_APPCUST, you can find these details only in SNC (Supply Network and Collaboration) system.
    Please try with inputs again.
    Thanks again in advance!
    Pallu!!

  • Add buttons in download region (Report Interactive)

    Hi all,
    Is it possible to add more buttons in download region in Report Interactive, such as PDF 1, PDF 2 .... ?
    I used OC4J and FOP (Print Server) to download PDF for testing, but it is so limited. When I use break column and export it to PDF, instead of to show a break, the PDF file shows an ordinary report.
    Therefore, I think the best idea is create two buttons and link for another page and do whatever I want, as PLPDF.
    :S
    Thank you,
    Eric

    Hi Eric,
    a nice way to do this is use the "IR customs actions menu" plugin (http://apex-plugin.com/oracle-apex-plugins/dynamic-action-plugin/ir-actions-menu-item_171.html) , so you can add extra menu's to the actions menu in your IA report.
    Regards
    Bas

  • IDCS4: Major bug creating interactive buttons

    I have a number of IDCS3 files with interactive buttons which jump to a specific page of the document using bookmarks. These buttons no longer work when the file is opened in IDCS4.
    In CS4, the button has a "Go to text anchor" action applied however the Text Anchor pop-up below is greyed out and says None. All the Bookmarks that I've created are present and correct. It would appear that CS4 is ignoring page bookmarks and will now only work with text anchors.
    This bug is also very easy to recreate with a new document in CS4:
    1. Create a new two page document.
    2. Go to page two and add a bookmark.
    3. Go to page one, create a button and add the "Go to Anchor" action.
    4. The Text Anchor pop-up should show the bookmark that was added it step 2 but it remains greyed-out.
    I've submitted this to Adobe and reverted back to using CS3 for any interactive work.
    Graham.

    Hi Sandee,
    Thanks very much for confirming the bug and for the workaround however this is a lot of work for my existing projects and easier to simple update them using CS3.
    Hmmmm... now, your comment "...bookmarks have never been recognized as part of making buttons." - try telling that to IDCS3, it even indicates that you've linked to a bookmark when you add a "Go to Anchor" behaviour to a button. I found this method more flexible and, to my simple way of thinking, more logical - a Bookmark goes to to a page in a document while a Hyperlink goes to a URL. For new CS4 projects I will now have to use the Hyperlink Destination (Type: Page) option instead. Oh well...
    So the problem isn't insurmountable for new projects but is still a bug in that it "breaks" legacy CS3 files opened in CS4 - and that's the argument I'll focus on when I hear back from Adobe.
    Cheers, Graham.

  • Creating hyperlink button

        It seems that even as a newbie this should be a simple thing to do.
    ( I am using  CS3 on the Mac)
    I create a button and add this action
    on(release) { getURL("http://www.yourwebsite.com"); }
    but get several errors when I go to publish it.
    So searching on google I find this code
    myButton.addEventListener(MouseEvent.CLICK, myButtonFunction); function myButtonFunction(event: MouseEvent) { var request:URLRequest = new URLRequest("http://www.yourwebsite.com"); navigateToURL(request); } 
    which seems rather complicated but works.
    except that I can't see where to change the code so the URL opens in the same browser window as the Flash file. Is there an edit I can make to edit this?
    (Also am I missing something? There is nothing in Flash help (searching under "hyperlink button") that I can find for what seems like a common task. Is there a simple way to create a hyperlink button?)

    The page I linked has the _self in the code in step 3 (maybe you clicked to a different page?)
    Pasting from the link --
    my_btn.addEventListener(MouseEvent.MOUSE_DOWN, myHandler);
    function myHandler(event:MouseEvent):void {
        navigateToURL(new URLRequest("http://www.adobe.com/devnet/flash/"), "_self");

  • Question about Button and TextBox positions

    Hello everybody,
    I just started using Borland Together 6.1 extended with Java and I want to design a UserForm (an Application), especially a Online Bank terminal, where u can input and output different data. My problem is that when I add buttons and textboxes from the toolbox menu, I cannot put then on the place I want, I'm restricted to some positions (center, right, left, west, east and so on). My question is how can I create my elements on the position I want, how can I resize them. Could someone tell me some specific functions, which I should use.
    Thankx

    You should try to find a LayoutManager that suits you. If you can't find one, you can set the Layout to null, then use absolute positioning.
    setLayout(null);
    yourComponent.setLocation(50, 50);
    yourComponent.setSize(40, 20);You need to set both the location and size of components when the layout is null.

  • Having Problems Creating "Replay" button

    Hi, I want to create a "replay" button on the last frame of my movie but it's not working.
    Here's what I did.
    1. I created a layer named "Actions" and in my last frame (frame 900) I created a "Stop" action.
    2. I then created a button and saved it to my Library.
    3. I then created a new layer named "Replay Btn" and created a keyframe in the last frame of the movie (frame 900). I then dragged the button onto the stage so it was in the last keyframe (frame 900) and made it into a button Symbol.
    4. In the Properties Inspector I then typed in an "instance" name of "replay".
    5. Then in the layer named "Replay Btn" I selected the last frame of my movie (frame 900) and added a keyframe in the same layer as my button. I then opened the "Actions" panel and entered this code.
    replay.onRelease = function() {
    gotoAndPlay(1);
    6. I then did a "Publish Preview" of the movie and got this error:
    "Warning 1090: Migration Issue: The onRelease event handler is not triggered automatically by Flash Player at run time in Actionscript 3.0. You must first register this handler for the event using addEventListener ('click', callback_handler)
    In Actionscript 3.0, code cannot be placed directly on objects. Please select a frame or use the code snippets panel to apply code to the current selection on stage."
    I understand that I must select the layer and "right-click" to add an action instead of selecting the object on the stage, but I guess I'm just not sure how to get the "Replay" button to work in CS5. I've watched a couple of tutorials but they weren't done very well and were really hard to understand. Can someone please explain this to me. I just want to create a button to replay the movie.

    Thanks Peter, I selected the "actions" layer and on frame 900 I added the code, but when I previewed it and it got to the last frame it just "looped" and started playing again.
    I have one layer named "Replay Buton" and another layer named "Actions"
    I named the button In the Properties Inspector with an "instance" name of "replay" and then placed this on frame 900 in the layer named "Replay Button".
    Do I need a "stop' action and where would I put it?
    Can you give me a bit more information as to how to set this up?

Maybe you are looking for