PUT key at a particular location in LinkedHashMap

Hi,
Can a key be inserted at a particular index of LinkedHashMap. As LinkedHashMap is a doubly linked list I think there it a way out to add a key at particular index.
Thanks,
Rhea

Actually Kathy, I string representation is a MUST for me.You are really, really irritating me.
1) The same data exists at multiple places in your system.
It comes in as characters (bytes in the byte stream, actually).
Then gets parsed into String. And becomes chars again when you System.out.println().
So the data already exists in multiple formats during your program.
For example, if you want to save your data in an Oracle database,
why would you care whether Oracle saves your String as chars/bytes/codepoint/whatever?
Just because your INPUT is String, and your OUTPUT is String,
doesn't mean you cannot store them INTERMEDIATELY as integer.
2) Unless, of course, this is an homework assignment. And that you have
wasted a huge chunk of my time by being vague.

Similar Messages

  • How to get keys of a particular type

    Following are my objects:
    DepartmentKey - primary key is departmentName, a String
    Department
    EmployeeKey - primary key is employeeId, an integer
    Employee
    I have 5 DepartmentKey-Department key-value entries in a cache and 2000 EmployeeKey-Employee key-value entries in the same cache.
    How do I get all the DepartmentKeys from the cache? In general, how to get keys of a particular type (class name)?
    Thanks
    Ghanshyam

    I guess I am deeply off track regarding the general approach towards storing items in the cache.
    Following is my problem domain:
    A Merchant is any establishment that accepts credit cards. (It could be the local Subway down the street or Macy's, etc.). A Transaction is a credit card transaction.
    public class Merchant implements Serializable{
    private String merchantId; // primary key
    private double averageTxnAmount;
    private double totalTxnAmount;
    private long totalTxnCount;
    public class Transaction implements Serializable{
    private String merchantId; // merchant that originated the txn
    private double amount;
    private Timestamp txnTime;
    private String txnType; // sale, return, etc.
    public class MerchantKey implements Serializable, KeyAssociation{
    private String merchantId;
    public Object getAssociatedKey{
    return merchantId;
    public class TransactionKey implements Serializable, KeyAssociation{
    private String merchantId;
    private Timestamp txnTime;
    private double amount;
    public Object getAssociatedKey{
    return merchantId;
    I want to update a merchant's average txn amount as transactions come in.
    Let's say I have a million merchants in a partitioned cache cluster spread across some machines.
    Transactions come into the cluster quite rapidly, say tens in a second. The process that inserts the transaction into the cluster must also update the merchant to which the transaction belongs, as follows:
    Transaction t = ...
    cache.put(tKey, t); // store the transaction into the cache
    MerchantKey mKey = new MerchantKey(txn.getMerchantId());
    Merchant m = (Merchant)cache.get(mKey);
    // update the merchant's avg txn amt
    m.setAverageTxnAmount((txn.getAmount() + m.getTotalTxnAmount())/m.getTotalTxnCount() + 1);
    m.setTotalCount(m.getTotalCount() + 1);
    // store the updated merchant back into cache
    cache.put(mKey, m);
    OR
    Transaction t = ...
    cache.put(tKey, t); // store the transaction into the cache
    MerchantKey mKey = new MerchantKey(txn.getMerchantId());
    Merchant m = (Merchant)cache.get(mKey);
    MerchantUpdater agent = new MerchantUpdater(t);
    cache.invoke(mKey, agent);
    public class MerchantUpdater implements AbstractProcessor{
    public Object process(Entry entry){
    Merchant m = (Merchant)entry.getValue();
    // update m's avg txn amt, total count using t
    entry.setValue(m);
    The basic idea is to store all merchants and all transactions (which could be tens of millions in a day) for a day in memory and to update the merchant objects as transactions come in throughout the day. The above example shows updating just the merchant's average txn amount, but in reality, it could be updating a number of things about the merchant.
    Am I using the api in the right spirit or is my approach seriously whacked? Can you please comment?
    Thanks
    Ghanshyam

  • When I download firefox, using recommended setting, or my own, all the sub files/folders like plugins, modules, updater end up on the desktop as well as in the file location. And when I try to put them into the file location, they don't. And when I delete

    When I download firefox, using recommended setting, or my own, all the sub files/folders like plugins, modules, updater end up on the desktop as well as in the file location. And when I try to put them into the file location, they don't. And when I delete them, FireFox won't open. I tried deleting FireFox and reinstalling it multiple times, and a message pops up sometimes that says FireFox may not have installed correctly, so I follow the steps, but all the extra icons on my desktop don't go away. This has happened every time I have downloaded FireFox. The browser itself works, but I need to know how to get rid of these icons, but still be able to use FireFox. This is on a new computer, with Windows 7.
    == I downloaded FireFox. ==
    == User Agent ==
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6

    Managed to solve this myself. Just went to properties > hidden.

  • Uploading a file, renaming it and placing it in a particular location on server

    A user submits a file from a front end HTML form which has fields like Division, Department name, department number,
    section number, year, email, phone etc. The file being submitted might have a user given name. But, when it is 
    uploaded I want it to be named as Departmentname_departmentnumber_sectionnumber. So, if department is Accounting, 
    dept number is 123 and section is 1, name of file will be Accounting_123_1.doc The extension will be whatever type 
    of file(text, MS-Word's .doc or .docx, PDF or RTF) was submitted and the user can upload attachments of files with 
    extension .txt, .doc, .docx, pdf, rtf only.
    Also, I want it to be stored on a particular location on server. So, if Division is Corporate Finance and year is 
    2011-2012 it should be stored on server at "E:\Files Submitted\2011-2012\Corporate Finance\". The "E:\Files
    Submitted\" part remains same in the directory name.
    <cfset submittedfileName =
    #form.departmentname#&"_"&#form.departmentnumber#&"_"&#form.section_number_1#&"."&#cffile. ClientFileExt#>
    <cfset filedirectoryYear = "E:\Files Submitted\"&#form.current_year#&"\"&#form.division#&"\">
    <!--- ensure that the user uploads attachments of type with extension .txt, .doc, .docx, pdf, rtf only--->
    <cfif FORM.attachment_1 neq "">
           <cffile action="upload"
                   accept="text/plain,application/msword,application/pdf,application/rtf"          
                     filefield="attachment_1"
                     destination="E:\temp\uploads"
                     nameconflict="Makeunique"
            >
    <!--- rename the file and move it to permanent destination --->        
            <cffile
      action="rename"
      source="E:\temp\uploads\#cffile.serverFileName#"
      destination=#filedirectoryYear#&#submittedfileName#&#cffile.ClientFileExt#
      >
    <!---   now create a temporary variable for the attachment so that it can be emailed later on --->
    <cfset attachment_local_file_1 = #filedirectoryYear#&#submittedfileName#&#cffile.ClientFileExt#>
    </cfif>
    I used the cffile.ClientFileExt because the files were getting uploaded without the extension but am receiving an
    error at   destination=#filedirectoryYear#&#submittedfileName#&#cffile.ClientFileExt# as "multiple items at this
    position: Missing Token > or /> .
    I am using Coldfusion 8. Any suggestions would be appreciated on where I am erring and how I can fix it.

    Thanks Dan,
    The space between 'l' and 'e' was a formatting error while I was pasting text to this forum.
    Currently, I have
    <cfset filedirectoryYear = "E:\Files Submitted\"&#form.current_year#&"\"&#form.division#&"\">
    <cfif FORM.attachment_1 neq "">
           <cffile action="upload"
                   accept="text/plain,application/msword,application/pdf,application/rtf "          
                     filefield="attachment_1"
                     destination="E:\temp\uploads"
                     nameconflict="Makeunique"
            >
    <!--- rename the file and move it to permanent destination --->        
    <cfset submittedfileName =
    #form.departmentname#&"_"&#form.departmentnumber#&"_"&#form.section_number_1#&"."&#cffile. ClientFileExt#>
    <cfset presentfileName = #cffile.serverFileName#&"."&#cffile.ClientFileExt#>
            <cffile
      action="rename"
      source="E:\temp\uploads\#presentfileName#"
      destination=#filedirectoryYear##submittedfileName#
      >
    <!---   now create a temporary variable for the attachment so that it can be emailed later on --->
    <cfset attachment_local_file_1 = #filedirectoryYear#&#submittedfileName#&#cffile.ClientFileExt#>
    </cfif>
    <cfset attachment_local_file_1 = #filedirectoryYear#&#submittedfileName#>
    When I submit, I get the error message
    "Attribute validation error for tag CFFILE.
    The value of the attribute source, which is currently c:\Course Syllabi\uploads\Web Based System Two Page HandOut.pdf, is invalid and the line below is referred.
    destination="#filedirectoryYear##submittedfileName#"
    The filedirectoryYear path exists i.e. I have E:\Files Submitted\2011-2012\Finance. What could be the issue?
    P.S. I got it working, The filedirectoryYear path value was not the actual directory path\name in the filesystem. Once I had the
    correct name in the filesystem, the application worked fine.

  • Inserting strings in a RandomAccessFile at a particular location

    I wrote a java program to read and display the contents of RAF. It is working. Actually,I need to read a file and search for a string in it and if the string equals certain value, then i need to insert a line in the file at that location.
    My problem is I am not able to insert any string in the RandomAccessFile(RAF) at a particular location, it always overwrites the already present string.
    I have a file called SOE_Arrays2.js which needs to be read and its content has to be modified. I am searching for a string like "os = [" in it and inserting another line like "["64w","64-bit Windows"]," at that location.
    the file looks like this:
    os1 = [
    ["win","Windows"],
    ["unx","UNIX"],
    ["mvs","MVS"]
    os2 = [
    ["alp","Alpha VMS"],
    ["lnx","Linux"]
    var letter = [
    ["new","New"],
    ["addon","Add-on"],
    ["lsf","LSF"],
    ["renew","Renewal"]
    The java program i wrote is here:
    import java.io.*;
    public class RAFtest
         public void writeTo()
              try
         String f = "C:\\webapps\\oncall\\soe\\SOE_Arrays2.js";
         File arrayfile = new File(f);
         RandomAccessFile raf = new RandomAccessFile(arrayfile, "rw");
         String s="",ss="";
         int i,j = 0,len;
         long fp;
    while((s = raf.readLine()) != null)
              //System.out.println(s);
              int ptr = 0;
              ptr = s.indexOf("os2 = [");
              if(ptr != -1)
                   System.out.println(s);
                   System.out.println("The OS array is here:");
                   ss = s;
                   raf.writeBytes("\r\t");
                   fp = raf.getFilePointer();
                   raf.seek(fp-4);
              raf.writeBytes("[\"64w\",\"64-bit Windows\"],\r");
                   break;
         raf.close();     
         catch(Exception e){e.printStackTrace(System.out);}      
         public static void main(String args[])
              RAFtest e = new RAFtest();
              e.writeTo();
    After executing the code SOE_Arrays2.js looks like this:
    os1 = [
    ["win","Windows"],
    ["unx","UNIX"],
    ["mvs","MVS"]
    os2 = [["64w","64-bit Windows"],
    lnx","Linux"]
    var letter = [
    ["new","New"],
    ["addon","Add-on"],
    ["lsf","LSF"],
    ["renew","Renewal"]
    you can see that RAF overwrites to the file at that particular location( after the line "os2 = [ ". What i need is to insert the text at a particular location, Is there a way to do this?
    I tried to insert carriage return, etc and move the file ptr back a little and write, whatever it is, RAF overwrites it, is there a way to insert instead of overwrite?
    Basically I want to get some string from the user from a web page and insert that string in my SOE_Arrays2.js file at a particular location depending on certain conditions.
    Is there another way of doing this instead of RAF?
    Please let me know how to do this.
    Thanks,
    Priyha.

    Hi DrClap,
    Thanks for the clarification. Everything works except the renameTo() . I am trying to rename the arrayfile2 to arrayfile1 , but the rename always return false. I am not sure why rename is not successful.
    I checked for the permissions of the file, full permission is there. I closed the files before renaming.
    Here's the code.
    import java.io.*;
    public class RAFtest
    public void writeTo()
    try
    String f1 = "C:\\JAVA\\SOE_Arrays2.js";
    String f2 = "C:\\JAVA\\SOE_Arrays3.js";
    File arrayfile1 = new File(f1);
    File arrayfile2 = new File(f2);
    RandomAccessFile raf1 = new RandomAccessFile(arrayfile1, "rw");
    RandomAccessFile raf2 = new RandomAccessFile(arrayfile2, "rw");
    long fp1=0,fp2=0; // file pointers
    String s="",ss="";
    int i,j = 0,len;
    boolean b= false;
    raf2.seek(0);
    while((s = raf1.readLine()) != null)
    int ptr = 0;
    raf2.writeBytes(s);
    ptr = s.indexOf("var OS9.1_sol = [");
         if(ptr != -1)
              System.out.println(s);
              System.out.println("The OS array is here:");
              ss = s;
              fp1 = raf1.getFilePointer();
              raf2.writeBytes("[\"64w\",\"64-bit Windows\"],");
              fp2 = raf2.getFilePointer();
              break;
    raf1.seek(fp1);
    while((s = raf1.readLine()) != null)
         raf2.writeBytes(s);               
    raf1.close();
    raf2.close();
    if(arrayfile2.exists()) System.out.println("file2 exists!");
    try{
    b = arrayfile2.renameTo(arrayfile1); //rename the file, why does it return false?
    }catch(SecurityException se){se.printStackTrace(System.out);}
    catch(NullPointerException ne){ne.printStackTrace(System.out);}
    System.out.println("b: "+b);
    catch(Exception e){e.printStackTrace(System.out);}
    public static void main(String args[])
    RAFtest e = new RAFtest();
    e.writeTo();
    here is the SOE_Arrays2.js
    var OS9.1 = [
    ["win","Windows"],
    ["unx","UNIX"],
    ["mvs","MVS"]
    var OS9.1_sol = [
    ["alp","Alpha VMS"],
    ["lnx","Linux"]
    var letter = [
    ["new","New"],
    ["addon","Add-on"],
    ["lsf","LSF"],
    ["renew","Renewal"]
    Please let me know whats wrong with the above code. I have no clue why renameTo returns false.
    Thanks,
    Priyha

  • Saving the file to a particular location!!!

    Hi,
          I have to upload a file and the file uploaded should be saved to aparticular location. For Example if i upload a file named 'eg.jpeg.' , how can i save this file to a particular location in the system?
    Regards,
    Shiny

    Hi,
    If you just want to display it within the same BSP application, try this:
    <htmlb:image src="eg.jpg" />
    If you want to retrieve the image from a non BSP application, I think you should look at logical files and paths (transaction AL11).
    Regards,
    Tanguy

  • Uploading File to a particular location

    Hi,
    I need to upload a file to a particular location using the Struts framework.
    I have been reading about the html:file tag.
    But I did not come across any information as to where the file gets uploaded to. I need the file to be uploaded to a location in my project.
    How do I do it?
    Could anyone post a code sample for this?
    Thanks in advance.

    http://www.google.com/search?q=struts+file+upload
    I see lots of useful examples tho.
    Saving the retrieved file to a particular location has nothing to do with Struts. Just handle it in your Javabean. Check the java.io API.

  • How do you place a video clip at a particular location in imovie

    how do I place a video clip at a particular location in imovie?

    You'll probably have better luck with an iMovie question if you ask in the iMovie forum.
    Regards

  • Automate saving a generated PDF at a particular location ?

    Hi,
    I am generating a PDF out of a simple form. I have to save this generated PDF at a particular location  (intranet). Can anybody give me the steps?
    Thanks
    Srinivas

    Hi,
    If you want to upload the pdf files from desktop to the server, then you can upload them in portal KM repository.
    Regards
    Srini

  • Help with placing the JComponents at a particular location in JPanel

    Hello All,
    I think it is simple in placing JLabel with an icon or just just text at a particular location in the JPanel. But it is notworking. I know it is very simple but i think i am missing something. Here is code please help with this code.
    Thanks
    Smithaimport java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.FlowLayout;
    import java.awt.LayoutManager;
    import javax.swing.*;
    public class DocumentGraphicalRepresentation {
         public void buildDocumentation() {
              JFrame frame = new JFrame("Graphical Representation");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setBounds(0, 0, 475, 265);
              JPanel panel = new JPanel();          
              panel.setBounds(0, 0, 475, 265);
              panel.setBackground(Color.lightGray);
              //panel.setLayout(new BorderLayout());          
              JLabel label0 = new JLabel(new ImageIcon("c:/arrow.gif"));
              label0.setLocation(61, 68);
              label0.setOpaque(false);
              panel.add(label0);
              JLabel label1 = new JLabel(new ImageIcon("c:/bulb.gif"));
              label1.setLocation(338, 139);
              label1.setOpaque(false);
              panel.add(label1);
              frame.getContentPane().add(panel);
              frame.setVisible(true);          
         public static void main(String args[]) {
              DocumentGraphicalRepresentation document = new DocumentGraphicalRepresentation();
              document.buildDocumentation();
    }

    When adding components to a null layout you must set both a location and size for them to show up.
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.FlowLayout;
    import java.awt.LayoutManager;
    import javax.swing.*;
    public class DGR {
         public void buildDocumentation() {
              JFrame frame = new JFrame("Graphical Representation");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setBounds(0, 0, 475, 265);
              JPanel panel = new JPanel();          
              panel.setBounds(0, 0, 475, 265);
              panel.setBackground(Color.lightGray);
              //panel.setLayout(new BorderLayout());          
              JLabel label0 = new JLabel(new ImageIcon(//"c:/arrow.gif"));
                                         "images/geek/geek-----.gif"));
                    Dimension d = label0.getPreferredSize();
                    label0.setSize(d);
              label0.setLocation(61, 68);
    //          label0.setOpaque(false);
              panel.add(label0);
              JLabel label1 = new JLabel(new ImageIcon(//"c:/bulb.gif"));
                                         "images/hawk.jpg"));
                    d = label1.getPreferredSize();
                    label1.setBounds(338,139,d.width,d.height);
    //          label1.setLocation(338, 139);
              System.out.println("label1.isOpaque = " + label1.isOpaque());
    //          label1.setOpaque(false);
              panel.add(label1);
              frame.getContentPane().add(new JScrollPane(panel));
              frame.setVisible(true);          
         public static void main(String args[]) {
              new DGR().buildDocumentation();
    }

  • Saving PDF From in particular location

    Hi all,
    I am having one query i have a requirement that the form that is initiated should be stored in particular location.
    eg: i have initiated the form with input ABC in one filed and my requirement is that after final approval the file should create a folder ABC and PDF should stored  in that folder like abc.pdf
    C:\\ABC\ABC.pdf
    please let me know how can i do in the work flow.
    thanks in advance
    Sekhar

    The following operation will do that.
    Service Name: File Utilities
    Operation Name: Write Document
    Note: The file cannot be written on the client PC.
    Nith

  • Just got a used airport base station. Set it up and getting wif signal. when I try to hook up on a computer it asks for a security key. where can I locate key?

    just got a used airport base station. Set it up and getting wif signal. when I try to hook up on a computer it asks for a security key. where can I locate key?

    If you mean the hexidecimal equivalent of the alphanumeric password, then you can find this via the AirPort Utility, as follows:
    AirPort Utility > Select the AirPort > Manual Setup
    On the AirPort Utility's menubar select Base Station > Equivalent Network Password

  • PUT KEY command with returned SW 6982

    There would be some other threads dealing with PUT KEY command however, my put key command failed with SW6982.
    Firstly, I have done it successfully in Java and now I migrate this solution to C#.Net, I have an PCSC class which helps me communicate with the SCreader. I refered to this thread
    [PUT KEY APDU|https://forums.oracle.com/forums/thread.jspa?threadID=1551395]
    I implement exactly the same as I have done in Java (based on source code provided in the thread mentioned above) but failed. Here's a log file for the communication
    Card Manager Selection --> Success!
    INITIALIZE UPDATE Command sent --> Success
    Data from Card: 00 00 00 93 02 90 97 95 20 93 01 02 00 0A FB 59 58 D6 62 71 BE 71 F2 E6 1C 37 D8 7D
    Diversification data: 00 00 00 93 02 90 97 95 20 93
    Static key set Calculation --> Success
    S-ENC: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
    S-MAC: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
    S-DEK: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
    Session key set Calculation --> Success
    Session ENC: 33 9F 1D 7F 5D 58 41 EB 03 4F 5C E2 34 55 78 94
    Session C-MAC: C6 71 3F 31 B8 DC 1F 89 05 DF EC B4 06 5C B8 1E
    Session R-MAC: 3C AE E5 A2 73 1A D0 52 69 0B C8 B5 A1 0F 34 01
    Session DEK: 33 9F 1D 7F 5D 58 41 EB 03 4F 5C E2 34 55 78 94
    Card cryptogram: BE 71 F2 E6 1C 37 D8 7D
    Host cryptogram: 4B 48 C8 62 AB E4 E5 8C
    EXTERNAL AUTHENTICATE C-MAC: CB 83 EE 48 91 BE 1D 0C
    EXTERNAL AUTHENTICATE command: 84 82 00 00 10 4B 48 C8 62 AB E4 E5 8C CB 83 EE 48 91 BE 1D 0C
    Data to calculate MAC: 84 D8 01 81 4B 01 80 10 5C 8F 22 35 FF 24 F6 4E 20 92 4D BC 24 44 34 F7 03 8B AF 47 80 10 5C 8F 22 35 FF 24 F6 4E 20 92 4D BC 24 44 34 F7 03 8B AF 47 80 10 5C 8F 22 35 FF 24 F6 4E 20 92 4D BC 24 44 34 F7 03 8B AF 47
    PUT KEY apdu C-MAC: C7 16 78 CE F3 48 EE A7
    PUT KEY sent: 84 D8 01 81 4B 01 80 10 5C 8F 22 35 FF 24 F6 4E 20 92 4D BC 24 44 34 F7 03 8B AF 47 80 10 5C 8F 22 35 FF 24 F6 4E 20 92 4D BC 24 44 34 F7 03 8B AF 47 80 10 5C 8F 22 35 FF 24 F6 4E 20 92 4D BC 24 44 34 F7 03 8B AF 47 C7 16 78 CE F3 48 EE A7What I try to do is that: I try to replace the old key set (40...4F) by itself (no derivation rule is applied)
    I have replaced the values of this scripts to the java code and it produces the same values as in C# code. I really don't know why? The External Authenticate command executed successfully and I use its C-MAC to calculate to C-MAC of PUT KEY command (as detailed in EMV CPS v1.1, page 79/103).
    One more thing: in the source in the thread mentioned above, I saw that in the PUT KEY apdu command, he added the value "00" after the C-MAC of PUT KEY. I don't know why?
    Is there anybody experienced the same problem as mine and has resolved it? It would be very kind of you to spend a little time on my problem and advice me what to do, I'm really stuck now.
    Best regards,
    JDL

    bug found, question answer

  • Add node at particular location in XML file

    I'd like to add an item to a particular location in an XML file.  Location of parent node is given by string variable "itemtoaddto" and the XML file is given by "myXML":
    function TraverseXMLfile(itemtoaddto,myXML): void {
        var AttributeList:XMLList = myXML.attributes() + myXML.*.attributes() + myXML.*.*.attributes();
         for each (var labelname:XML in AttributeList) {
          if(labelname == itemtoaddto){
            trace (labelname + "match found!!!!!");
            myXML.*.labelname.appendChild(<SON name="Will" bday="01/15" />);
    In the above code, the parent item is being found in fact it's printing the "match found!!!!!" message.  However, the line
           myXML.*.labelname.appendChild(<SON name="Will" bday="01/15" />);
    is giving the following error:
         TypeError: Error #1086: The appendChild method only works on lists containing one item.
    Can someone help please? thanks.

    var myXML:XML = <product>
                                <subAssembly label="Sub1">&#8232;           
                                    <part label="Part1_1"/>&#8232;           
                                    <part label="Part1_2"/>&#8232;           
                                    <part label="Part1_3"/>&#8232;           
                                    <part label="Part1_4"/>&#8232;       
                                </subAssembly>&#8232;       
                                <subAssembly label="Sub2">&#8232;           
                                    <part label="Part2_1">&#8232;               
                                        <feature label="Feature2_1_1"/>&#8232;               
                                        <feature label="Feature2_1_2"/>&#8232;           
                                    </part>&#8232;           
                                    <part label="Part2_2">&#8232;               
                                        <feature label="Feature2_2_1"/>&#8232;               
                                        <feature label="Feature2_2_2"/>&#8232;           
                                    </part>&#8232;       
                                </subAssembly>&#8232;       
                                <subAssembly label="Sub3"> &#8232;           
                                    <part label="Part3_1">&#8232;               
                                        <feature label="Feature3_1_1"/>&#8232;               
                                        <feature label="Feature3_1_2"/>&#8232;           
                                    </part>&#8232;       
                                </subAssembly>&#8232;
                            </product>;
    myXML.subAssembly.(@label == "Sub1")[0].insertChildAfter(myXML.subAssembly.(@label == "Sub1")[0].part[myXML.subAssembly.(@label == "Sub1").part.length() - 1], <part label="Part1_5"/>);
    trace(myXML);
    This traces:
    <product>       
      <subAssembly label="Sub1">          
        <part label="Part1_1"/>      
        <part label="Part1_2"/>
        <part label="Part1_3"/> 
        <part label="Part1_4"/>
        <part label="Part1_5"/>
      </subAssembly>
      <subAssembly label="Sub2">
        <part label="Part2_1">        
          <feature label="Feature2_1_1"/>      
          <feature label="Feature2_1_2"/>    
        </part>  
        <part label="Part2_2">      
          <feature label="Feature2_2_1"/>      
          <feature label="Feature2_2_2"/>   
        </part>
      </subAssembly>
      <subAssembly label="Sub3">
        <part label="Part3_1">       
          <feature label="Feature3_1_1"/>     
          <feature label="Feature3_1_2"/>
        </part>
      </subAssembly>
    </product>

  • Seek to a particular location for MONO sounds not working in AS3

    Hi Guys,
    I am facing an issue seeking to a particular location for
    MONO sounds with sample rate 22KHz. Another thing I observed was
    that there is a problem seeking to positions greater than half the
    total length of the actual sound, otherwise it is working fine. I
    have been trying to test this in a browser.
    Any ideas or thoughts will really help me.
    Cheers,
    TarXXXXX

    I am not streaming the sound from FMS, it is normal
    progressive download with audios placed local alongside my swf
    file. It works fine for 44 KHz sounds.

Maybe you are looking for