2 buttons in stage with 2 differents code = all button execute all code

hello
it realy strange
i have 2div with 2 actions, one per div :
-1 to load an url (touchstart and click)
window.open("myurl", "_blank");
-1 to reload animation (touchstart and click)
sym.play(0);
sym.getSymbol(oscar).play(0);
sym.getSymbol(cliquer).play(0);
sym.getSymbol(bontonjouer).play(0);
http://com3elles.net/animation/com3elles.html
if we click on 1 to load all is ok
if we click on reply button it reply but it load url in new widows ....
why ???
regards

i did a test on iPad2 and again it works normal, and without any problem !!
Zaxist

Similar Messages

  • Dynamically adding multiple instances of a movie clip to the stage with one button

    hello,
    I was wondering if there was a way to add several instances
    of the same movie clip to the stage dynamically utilizing one
    button.
    I can do one with the following code placed on the button...
    on (release) {
    attachMovie ("filledCircle", "filled1", 5);
    filled1._x = 370;
    filled1._y = 225;
    But I want the user to be able to hit the button again and
    get yet another instance of "filledCircle" on the stage.
    I also want the user to be able to drag these instances
    around...
    Any help would be appreciated...
    Thanks,
    Muhl

    Muhl,
    > I was wondering if there was a way to add several
    > instances of the same movie clip to the stage
    > dynamically utilizing one button.
    Sure thing.
    > I can do one with the following code placed on the
    > button...
    >
    > on (release) {
    > attachMovie ("filledCircle", "filled1", 5);
    > filled1._x = 370;
    > filled1._y = 225;
    > }
    Gotcha.
    > But I want the user to be able to hit the button again
    > and get yet another instance of "filledCircle" on the
    > stage.
    You're in luck, because this isn't very hard to do. The main
    thing to
    keep in mind is that each instance must have A) its own
    unique instance name
    and B) its own unique depth. In your example, the instance
    name is filled1
    and the depth is 5. The next clip's instance name should be
    filled2 at a
    depth of 6. Then filled3, depth 7, and so on. You can use a
    single
    variable to handle the incrementation.
    // code in a frame
    var counter:Number = 1;
    // code on your button
    on (release) {
    attachMovie ("filledCircle", "filled" + counter, counter +
    4);
    With me so far? The variable counter contains the numeric
    value 1. The
    second parameter of attachMovie() is provided with a
    concatenation of
    "filled" + 1, which makes "filled1". The third parameter is
    provided with
    the sum of counter plus 4, which makes 5. Obviously, we need
    a bit more.
    The button must, in addition, increment the value of counter.
    The ++
    operator handles this perfectly.
    on (release) {
    attachMovie ("filledCircle", "filled" + counter, counter +
    4);
    counter++;
    Now, it seems you also want to position the attached movie
    clip to (370,
    225). Are they call supposed to go to the same place? If so,
    you may use a
    second variable to hold a reference to the newly attached
    clip. Look up
    MovieClip.attachMovie(), and you'll see that the method
    returns the exact
    reference you need.
    // code in a frame
    var counter:Number = 1;
    var mc:MovieClip;
    // code on your button
    on (release) {
    mc = attachMovie ("filledCircle", "filled" + counter,
    counter + 4);
    counter++;
    mc._x = 370;
    mc._y = 225;
    Make sense?
    > I also want the user to be able to drag these instances
    > around...
    Then you need to handle a few events. You're dealing with
    movie clips
    here, so your best bet is to study up on the MovieClip class,
    which defines
    all movie clips. (Note, also, that the TextField class
    defines all input
    and dynamic text fields; the Sound class defines all sounds,
    etc. This is a
    very handy arrangement of the ActionScript 2.0 Language
    Reference.)
    // code in a frame
    var counter:Number = 1;
    var mc:MovieClip;
    // code on your button
    on (release) {
    mc = attachMovie ("filledCircle", "filled" + counter,
    counter + 4);
    counter++;
    mc._x = 370;
    mc._y = 225;
    mc.onPress = function() {
    this.startDrag();
    mc.onRelease = function() {
    this.stopDrag();
    Easy as that. You're simply assigning a function literal to
    the event
    of each new MovieClip instance as you create it. Take a look
    and you'll see
    each of these class members available to you -- that is, to
    all movie clips.
    MovieClip.onPress, MovieClip.startDrag(), MovieClip._x, etc.
    Wherever it shows the term MovieClip in the Language
    Reference, just
    replace that with the instance name of your clip -- or a
    reference to that
    clip (which even includes the global "this" property).
    David
    stiller (at) quip (dot) net
    Dev essays:
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Loading movie clip to stage with button click AS3

    I'm trying to figure out how to load a movie clip to the stage with a button click and have the movieclip close again using a close button. Does anyone have a step by step on how to do this or links to some tutorials.
    Below is an example of what I'm trying to do.

    Alrighty I changed the publish settings to as3. I'm still getting two errors:
    Scene 1
    1046: Type was not found or was not a compile-time constant: Popup1Btn.
    Scene 1, Layer 'as', Frame 1, Line 3
    1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
    So my setup on my main timeline is I have an actionscript layer with this code now:
    var popup1:Popup1
    Popup1Btn.addEventListener(MouseEvent.CLICK,addF);
    ClosePopup1.addEventListener(MouseEvent.CLICK,closeF);
    function addF(e:MouseEvent):void{
    popup1=new Popup1();
    addChild(popup1);
    function closeF(e:MouseEvent):void{
    removeChild(popup1);
    popup1=null;
    On the stage I have a button with the isntance/AS linkage name Popup1Btn. Inside my Popup1 MC I have a box with text and then a button with the instance/linkage name ClosePopup1 to close the popup.
    What am I missing?

  • Difference between Group A/c and Chart of Account with serval Company Code

    Hi Friends,
    Please explain the term chart of account with serval company code and also group a/c.
    Thanks and regards,
    Dev

    Hi Mahendra
    The Chart of Accounts is a list/directory of the G/L acounts maintained in the company. This COA can be used by one or many company codes.
    For e.g Co code A located in Delhi and Co code B In Mumbai may use the same COA for reporting as well as consolidation purpose.
    Group COA is maintained when there are more than one COA (e.g country-specific and operating COA) being used in the company. In this case the COA maintain alternative account numbers to the same account for automatic updation and consolidation.
    I hope this helps.
    Regards
    Kavitha

  • When i try to back up my iphone 4 it says i cannot back it up with the error code -50

    when i try to back up my iphone 4 it says i cannot back it up with the error code -50? HELP

    If you are running Windows and it stops on the first stage of a sync then my suggestion is to uninstall AppleDeviceSupport version 2.0.1 and re-install 1.5.2.
    There are instruction here to do it on Windows 7 (see the first post):
    https://discussions.apple.com/thread/3280228?tstart=0
    Those instructions are to fix a different problem, but it fixes the problem with syncing devices stopping on the first stage (backing up the device) too. The AppleDeviceSupport 2.0.1 comes with Quicktime 7.7 and, I believe, the latest Safari version.
    I'm running XP, so used the Everything search program (http://www.voidtools.com/download.php) to find the directories with the AppleDeviceSupport installers (they have the extension .msi and the version in the directory name) and right-mouse-buttoned them to do the uninstall and install. Note you need a reboot afterwards. (Actually I just sorted out the service in the Service Manager, but that's a longer explaination and a reboot works fine).
    Hope that helps,
    John

  • Two deductions for invoice with same reason code posted as one line item

    Hi
    We have a scenario wherein we are taking two or more deductions on the same invoice and are using the same reason code which have a setting of charge off.
    SAP system displays the FI posting with same reason codes with charge off setting as one line item.
    However we want the FI Posting to display separate line items per deduction and not combine amounts of deductions based on same reason code with charge off setting.
    Any comments are appreciated.
    Edited by: Kirti Bhardwaj on Jul 24, 2011 9:46 AM

    Hi,
    you can use different reason codes in distribute differences screen once you have fist selected one reason code for one invoice.

  • Document control failed due to error in [DOCMGR-CANCEL] with a return code

    i am getting this error while calceling the purchase order "Document control failed due to error in [DOCMGR-CANCEL] with a return code of [OTHER]. "
    I am doing the calcel like this
    Nav: buyer work centre --> order
    searche the po and then
    select order --> cancel then click GO button
    i gave the Reason as Cancel
    communication method: email
    Cancel Requisition: Yes
    Please help on this, its urgent.
    Thanks,
    Vijay.

    Hi Vijay,
    Check this MOS note.
    Cancelling A Standard Purchase Order In Buyer Work Center Results In Error [Docmgr-Cancel] With A Return Code [ID 1338826.1]
    Thanks
    -Arif.

  • How to create a stage with tabs?

    I tested this code to create a stage with tabs:
    {code}
    public void GeneralConfiguration()
            Stage configurationStage = new Stage();
            configurationStage.setTitle("General Settings");
            configurationStage.initModality(Modality.WINDOW_MODAL);
            Group grid = new Group();
            TabPane tabPane = new TabPane();
            //Create Tabs
            Tab tabA = new Tab();
            tabA.setText("Main Component");
            tabA.setClosable(false); // da se mahne opciqta da se zatvarq tab
            //Add something in Tab
            StackPane tabA_stack = new StackPane();
            tabA_stack.setAlignment(Pos.CENTER);
            tabA_stack.getChildren().add(new Label("Label@Tab A")); // dobavq se tuka accordion
            tabA.setContent(tabA_stack);
            tabPane.getTabs().add(tabA);
            Tab tabB = new Tab();
            tabB.setText("Second Component");
            tabB.setClosable(false); // da se mahne opciqta da se zatvarq tab
            //Add something in Tab
            StackPane tabB_stack = new StackPane();
            tabB_stack.setAlignment(Pos.CENTER);
            tabB_stack.getChildren().add(new Label("Label@Tab B"));
            tabB.setContent(tabB_stack);
            tabPane.getTabs().add(tabB);
            Tab tabC = new Tab();
            tabC.setText("Last Component");
            tabC.setClosable(false); // da se mahne opciqta da se zatvarq tab
            //Add something in Tab
            StackPane tabC_vBox = new StackPane();
            tabC_vBox.setAlignment(Pos.CENTER);
            tabC_vBox.getChildren().add(new Label("Label@Tab C"));
            tabC.setContent(tabC_vBox);
            tabPane.getTabs().add(tabC);
            //grid.add(tabPane);
            grid.getChildren().add(tabPane);
            // Configure dialog size and background color
            Scene Scene = new Scene(grid, 800, 600, Color.WHITESMOKE);
            configurationStage.setScene(Scene);
            configurationStage.show();
    {code}
    Can you tell me how I can fill the stage with the tabs body. Now I get this result:
    http://i44.tinypic.com/2zppcg4.png

    Use some kind of managed layout pane instead of a group for the root. I like to use a BorderPane or AnchorPane as the root container:
    // Group grid = new Group();
    BorderPane grid = new BorderPane();
    // grid.getChildren().add(tabPane);
    grid.setCenter(tabPane);
    Message was edited by: James_D (Figured out how to post code!)

  • Drawing images gives 2 different results with the same code.

    Im adding my code on here, and its sort of long but ill try to explain it. Most of it you can ignore.
    Anyway i'm making a tree menu with only 1 level of expansion. So you have a TreeMenu object, and this object has some Branch classes. These Branch classes have Leaf classes. That is all. On the menu there is also a little box where you can click to expand and collapse each branch. if a branch is expanded, all of its leaves are shown. if it is collapsed only the branch name is shown.
    So far what I've described above works, there is a small scale compilable working program, that is alright. Theres just a few bugs to fix.
    A little feature of the tree is if a branch or a leaf is selected (has been clicked on in the past) it has a blue background. This sort of works. The branch names seem to work alright, and some of the leaves. However other if you run the example i provided you can click on Leaf 1, and it will be ok, but if you click on Leaf 2 then there blue background is twice as big as it should be. But for the rest, it works ok.
    This is weird to me because the same code handles any of these same situations. So it seems that i get 2 diferent results with the same code. If anyone would like to help heres some stuff you should know:
    You can ignore Leaf class, i dont think theres any errors in there.
    You can ignore just about all of Branch class except the update() method.
    You can ignore all of TreeMenu class except the inner MouseListener class might be useful.
    You can ignore TreeTester. Just the JFrame tester class.
    to run the code:
    javac TreeMenu.java
    java TreeMenu
    http://cs.ucsb.edu/~jsterling/treemenu.zip
    thanks.

    You make a good point Stefan but unfortunately I already checked that.  I have even copied the mapping (right click copy) and pasted it from the working Mapping to the bad Map (Paste) to make sure the context values were all the same.
    I also opened all the queues and compared the values in each.  All values match exactly except for the result(out) queue.
    In both tests I am using the same IDOC XML file. 
    These are the only differences I see.
    1.  The IDOC is exactly the same as far as I can tell but they come from two different source SWCV.  SAP APPL 4.7 and Steelcase_Procurement (ECC 6.0). 
    2.  The working map uses a local UDF.  The bad map calls the UDF from a Function Group.  Is there a Java version difference between the two?
    A better sample of the result queues look like this:
    Correct Result:
    Thickness of Glass: 20
    Height: 10
    Width: 5
    Length: 18
    Thickness of Glass: 10
    Height: 15
    Width: 8
    Length: 14
    Bad Result:
    Thickness of Glass: 20
    <null>
    <null>
    <null>
    Width: 5
    <null>
    <null>
    <null>
    I took this chance to redesign my Variant Config output to separate the characteristics/values, but I'm still bothered that I was unable to determine what would cause the differing values.
    Any ideas?
    Thanks,
    Matt

  • My iPad with this security code and forgot it,how can I get him ?  Is that 4 digit code

    my iPad with this security code and forgot it,how can I get him ?  Is that 4 digit code.

    Recovery Mode
    1. Disconnect the USB cable from the device, but leave the other end of the cable connected to your computer's USB port.
    2. Turn off the device: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for the device to turn off.
    3.While pressing and holding the Home button, reconnect the USB cable to the device. The device should turn on.
    4. Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears, release the Home button. iTunes should alert you that it has detected a device in recovery mode. Click OK, and then click Restore to restore the device.
    Note: Data will be lost. You may have to repeat the above many times.

  • Would like help with treeset ,the codes that using for sorting, please ?

    hi every body. i faced a problem while writing this program, everything worked properly except this one. The program is related to Jframe and it asks the user to add three labels , three text field , one text area and three Jbuttons which are add sort and exit. i could deal with add and exit but sort, i couldn't do it properly because i don't know the codes that should be added in actionperfomed?
    These codes are :
    package gui;
    import javax.swing.SwingUtilities;
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import java.awt.Rectangle;
    import java.util.ArrayList;
    import javax.swing.JButton;
    import javax.swing.JTextField;
    import javax.swing.JTextArea;
    import sun.misc.Sort;
    import domain.Student;
    public class StudentFrame extends JFrame {
          * This method initializes btnAdd     
          * @return javax.swing.JButton     
         private JButton getBtnAdd() {
              if (btnAdd == null) {
                   btnAdd = new JButton();
                   btnAdd.setBounds(new Rectangle(13, 135, 59, 27));
                   btnAdd.setText("Add");
                   btnAdd.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                        btnAddClicked(); // TODO Auto-generated Event stub actionPerformed()
              return btnAdd;
         protected void btnAddClicked() {
              // TODO Auto-generated method stub
         String name = txtName.getText();
         String id = txtID.getText();
         String age = txtAge.getText();
         Student s = new Student(name , id , age);
         txtArea.setText(String.valueOf(s ));
          * This method initializes btnSort     
          * @return javax.swing.JButton     
         private JButton getBtnSort() {
              if (btnSort == null) {
                   btnSort = new JButton();
                   btnSort.setBounds(new Rectangle(95, 136, 62, 25));
                   btnSort.setText("Sort");
                   btnSort.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             btnSortClicked(); // TODO Auto-generated Event stub actionPerformed()
              return btnSort;
         protected void btnSortClicked() {
              // TODO Auto-generated method stub
          * This method initializes btnExit     
          * @return javax.swing.JButton     
         private JButton getBtnExit() {
              if (btnExit == null) {
                   btnExit = new JButton();
                   btnExit.setBounds(new Rectangle(173, 134, 61, 23));
                   btnExit.setText("Exit");
                   btnExit.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             System.exit(0); // TODO Auto-generated Event stub actionPerformed()
              return btnExit;
          * This method initializes txtName     
          * @return javax.swing.JTextField     
         private JTextField getTxtName() {
              if (txtName == null) {
                   txtName = new JTextField();
                   txtName.setBounds(new Rectangle(79, 11, 60, 23));
              return txtName;
          * This method initializes txtID     
          * @return javax.swing.JTextField     
         private JTextField getTxtID() {
              if (txtID == null) {
                   txtID = new JTextField();
                   txtID.setBounds(new Rectangle(73, 55, 65, 26));
              return txtID;
          * This method initializes txtAge     
          * @return javax.swing.JTextField     
         private JTextField getTxtAge() {
              if (txtAge == null) {
                   txtAge = new JTextField();
                   txtAge.setBounds(new Rectangle(74, 96, 61, 24));
              return txtAge;
          * This method initializes txtArea     
          * @return javax.swing.JTextArea     
         private JTextArea getTxtArea() {
              if (txtArea == null) {
                   txtArea = new JTextArea();
                   txtArea.setBounds(new Rectangle(138, 5, 154, 128));
              return txtArea;
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        StudentFrame thisClass = new StudentFrame();
                        thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        thisClass.setVisible(true);
          * This is the default constructor
         public StudentFrame() {
              super();
              initialize();
          * This method initializes this
          * @return void
         private void initialize() {
              this.setSize(300, 200);
              this.setContentPane(getJContentPane());
              this.setTitle("JFrame");
              return jContentPane;
    }Edited by: hypocrisy on Apr 26, 2009 6:51 PM

    There are three actionPerformed in that program.One for add Jbutton , Sort , and Exit
    the codes that i have added for add button after action performed are
    String name = txtName.getText();
    String id = txtID.getText();
    String age = txtAge.getText();
    Student s = new Student ( name , id , age);
    System.out.println(s);
    the codes for Exit button to make it works properly was :
    System.out.println(0);
    But when i came to Sort Button and i tried to enter many codes but it didn't sort properly so would you like to help me with the right codes :)

  • Controlling Labview with C#: error code -2147352571

    Hi,    
      I need to call LabVIEW and pass parameters to LabVIEW from C# so that I can use labview as a sort of "driver" to control my signal generator from C#.
    I found this tutorial for controlling LabVIEW from C#: http://zone.ni.com/devzone/cda/epd/p/id/3838
    It contains a C# project that calls a vi which acts as a calculator, parsing a string and computing an answer.
         I am trying to use this file as a base to work from by changing a few lines to make C# code that calls a different vi (the one that controlls my signal generator).
    I have attached both the Signal_Generator_Controller_For_Sentry_Testing.vi and the CallLV project that I modified and the origional from NI.
    I get this error when I click "Run vi" from the C# gui:   Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
    If I click "view detail" from the "COMException was unhandled", I find that the error code is -2147352571. The error occurs at this line in the C# code:
    //Call the VI
    vi.Call(ref param1,ref param2);
         Here are the experiments I performed (that didn't solve the problem):
    Since the demo vi that NI made is contained in a llb file, I built a project that contained this vi, added an llb file to the project, and put Signal_Generator_Controller_For_Sentry_Testing.vi in the llb file.
    My vi is all inputs (the only output is the signal generator, which is not on the front pannel, obviously). I have tried changing the connector pane so that one of the connectors was an output.
    I have tried googling the error messages: there isn't anything specific enough to this problem (C# communicating with labview), the error message occurs in situations in multiple programming languages.
    I have tried passing the parameters "by val" rather than "by ref", but a different error occurs.
         Here is what I am able to deduce/ what I have noticed:
    The vi that NI created to demo communicating with C# "seems to be unable to leave run mode". When you call Labview from C#, the front pannel comes up and you cannot select the "stop button": it is grey. The Pause button doesn't stop exectution either. This makes me think that the vi was compiled in a different manner. I am more inclined to believe that teh vi is formated incorrectly rather than the C# code working improperly.
    The types of the two parameters, param1 and param2, going into the call statement  are "string" and "object" respectively. This is the same as with the NI code, which works fine. It is not an error with an incorrectly sized array parameter; that gives a different error message and I have fixed that problem. So, even though the error message says "type mismatch, I don't think that the input parameters to the Call function are incorrect.
       To Reproduce this error:
    I have Microsoft Visual C# Express 2008 Edition
    I am using Labview version 8.6
    In my version of the C# code, in this line: string vipath = @"C:\Program Files\National Instruments\LabVIEW 8.6\builds\Sentry_Test\Sentry.llb\Signal_Generator_Controller_For_Sentry_Testing.vi";
    You will have to change the directory to wherever you store the vi.
    You will need the "Labview" Library so that the C# line "using Labview" will work. I think it is downloaded by default either by labview or visual studio.
    In the C# file that NI created, you must add a fourth parameter '3' in  the line vi= lv.GetVIReference(vipath,"",true) as the last parameter. You get a compiler error otherwise. That was a mistake NI made.
    Thank you for the help.
    --Zach
    Attachments:
    CallLV_Zachs _Version.zip ‏126 KB
    callLV_NI_Version.zip ‏48 KB
    Signal_Generator_Controller_For_Sentry_Testing.vi ‏12 KB

    Zach,
    Unfortunately, I do have more of a knowledge
    of how to control objects using ActiveX in LabVIEW and not the other way
    around.  What ActiveX properties and methods are you using in your code and what are the input parameters that you are trying to pass?  You mentioned that you only have two input parameters, but the VI you posted has 3 inputs.  My guess would be that if you are indeed seeing a type mismatch, it is trying to pass an data type LabVIEW does not know what to do with.  This has been seen when trying to pass strings as Task data types (like the VISA Session).  
    ColeR
    Field Engineer

  • Linking Mc on stage with class Mc

    Hello
    I am trying to tell mc on stage to react to another one that is called by addchild and has a class name. I am doing this from the main timeline. How can I achieve this?
         if
         (this.currentFrame == 3) //Mc with class name that is on stage with addchild method. Called Mcl1//
         Mcl2.gotoAndPlay(1)   //Mc physically on stage with instance name//
    Do I have to add enterframe events listener on the main timeline. (There is already one inside Mcl1 class code).
    Any help is appreciated. Thanks.

    if you want to do something when the current timeline reaches frame 3, yes you need to use a loop (like enterframe or a timer loop) to repeatedly check when the current frame is = 3.

  • Problem with my exe code

    Hello,
    I have a small problem regarding to my code. I have attached the source code. There isn't any problem with the vi code. But when I convert the vi to exe, and double click the exe file in order to open it , the program is trying to start, I mean it is acting like I clicked the run button. I said it is not a problem, because all the values (test duration, delay duration, high limit, low limit) are zero. Therefore it is attempting to run, but only very small portion of the pressure reading occurs. What do you think about the cause of this problem? Thanks for your help.
    Ahmet
    Attachments:
    front panel1.jpg ‏47 KB
    Oksijen_Atolyesi.vi ‏45 KB

    Hi Ahmet,
    when duration and delay are zero, the your DAQ loop will (probably) run only once, thus giving you only small amount of data...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    Oksijen_Atolyesi.vi ‏35 KB

  • Opening a file with Scanner FUNNY CODE

    public class ScanXan {
    public static void main(String[] args) throws IOException {
    Scanner s = null;
    Scanner t = null;
    try {
    s = new Scanner(new BufferedReader(new FileReader("cd79.txt")));
    t = new Scanner(new BufferedReader(new FileReader("local41.txt")));
    while (s.hasNext()) {
    String tempS = s.next();
    while (t.hasNext()){
    if (tempS.equals(t.nextLine())) {
    System.out.println("Repeated: " + t.next());
    catch (IOException e) {
    e.printStackTrace();
    finally {
    if (s != null) {
    s.close();
    ANYTHING WRONG WITH THIS? I'M TRYING TO COMPARE THE FIRST LINE OF A TXT FILE WITH ALL THE lines from the other file. HOWEVER, When i run it, t.hasNext() STARTS READING FROM THE 4TH LINE OF THE FILE.
    I can't figure it out. help please
    thanks
    Edited by: lsn67a02j3 on Mar 21, 2009 7:35 PM
    Edited by: lsn67a02j3 on Mar 21, 2009 7:38 PM

    (When you post code, use the "code" tags. Either highlight your code and click the button with the label "CODE" or put {code} at the start of your code and the same thing again at the end. This makes the code readable.)
    When i run it, t.hasNext() STARTS READING FROM THE 4TH LINE OF THE FILEHow do you know this? It is often a good idea to lard your code with System.out.println() statements (or use a debugger) so that you can tell, objectively, what is happening. It may help, too, to make sure your two input files are chosen so that they have readily identifiable lines.
    while (s.hasNext()) {
        String tempS = s.next();
        while (t.hasNext()){This looks odd. You want to compare the line returned by s with all of the lines returned by t. But think about what will happen the second time around the loop: t.hasNext() is going to be false right from the start. It would be better to create a new Scanner each time around the outer loop.
    if (tempS.equals(t.nextLine())) {
        System.out.println("Repeated: " + t.next());
    }In the event of a match this results in two scanner "next" calls. Is this what you mean to do?

Maybe you are looking for

  • How to display custom error message in Job log for batch processing

    Hi All, I am rexecuting one R/3 report in batch mode and i want to display all the custom error i have handled in job log when its executed from SM36,SM37. The custom error are like 'Delovery/Shipmet doe not exits' or others which we can display in o

  • Comments in OLAP Query

    I have tried unsuccessfully to use the traditional comment indicators (--, // or /../) in the MII OLAP Query Template.  Can any one offer any insight ?  We are running xMII 11.5 Thanks Edited by: Gary Wilson on Mar 18, 2010 4:17 PM

  • Problem with free trials

    i cannot start my free photoshop trial. what do i have to do?

  • Open PDF Adobe form from workitem in UWL

    Hi, We have a requirement in which a workitem is gettng generated from workflows, And it comes in UWL, So when we execute that workitem it should open a adobe form for notificaton so that approver can reject or approve that notificaton in PDF, But it

  • TV-to-PC Tuner Compatible with FMLE?

    I just got a Hauppauge WinTV-HVR-950Q receiver that plays my cable TV on my PC.  I want to encode and stream this cable TV feed using FMLE.  FMLE recognizes the device, but I get an error when I select the Hauppauge as the device (when the Hauppauge