Scope question... I think?

I have the following that opens a movieclip that has a class attached to it.
var quiz_1_2:Quiz_1_2 = new Quiz_1_2();
addChild(quiz_1_2);
quiz_1_2.initQuiz(quiz1Answer, quiz1Audio);
Inside that class I am referencing the stage like this:
addEventListener(Event.ADDED_TO_STAGE, mousemoveF);
This works fine if I am adding the child from a function, but if I open it via cue point like the following, it no longer works. It seems that the stage eventlistener no longer gets attached to the stage.
if(infoObject.name == "quiz_1_2")
          var quiz_1_2:Quiz_1_2 = new Quiz_1_2();
          addChild(quiz_1_2);
          quiz_1_2.initQuiz(quiz1Answer, quiz1Audio);
What am I doing wrong here?
Thanks a lot for any advice!!!

yes, the MC gets added and all works great, except the function that is supposed to get called never does.
The trace in mousemoveF never gets called. So I was thinking I might not know where the stage is?
public function initQuiz(corretOne:uint, theAudio:String):void
addEventListener(Event.ADDED_TO_STAGE, mousemoveF);
private function mousemoveF(e:Event){
     trace("mousemoveF was called");

Similar Messages

  • Question: I think I made mistakes using several different id apple. How can I cancel all of them except the one I would like to maintain ?

    Question: I think I made mistakes using several different id apple. How can I cancel all of them except the one I would like to maintain ?

    From Here   http://support.apple.com/kb/HE37
    I have multiple Apple IDs. Is there a way for me to merge them into a single Apple ID?
    Apple IDs cannot be merged. You should use your preferred Apple ID from now on, but you can still access your purchased items such as music, movies, or software using your other Apple IDs.

  • Quick Easy Question- I think...

    If you have 15 expressions, concatenated by Boolean OR's, how many of the expressions must be true for the entire thing to be true? My friend and I are arguing whether the answer is...
    a. at least 1
    b. all of them
    c. cannot be determined
    Thank you so much for your input. We are studying for an exam, trying to finish the practice questions. I appreciate any input and your time!! :-)

    Hi,
    Programming languages are created by humans, and therefore it is usually pretty easy to answer such questions. Think about the human language..
    Do you have a car or a house or a space ship?
    Any one who owns a car or a house would answer yes, even if they didn't own a space ship. That is, the whole expression evaluates to true if one of the statements is true.
    /Kaj

  • New to Java and I guess a scope question.

    Hello and thank you for taking the time to read this. I am not a real programmer, everything I have ever done was a total hack, or written without a full understanding of how I was doing it. One thing about Java is that you might have like 20 classes (or interfaces or whatever), and that code is "all over" (which means to me not on one big page). My comment statements may look odd to others, but the program is for me alone and well, only I need to understand them.
    Through some hacking, I wrote/copied/altered the following code:
    import java.io.*;
    import java.util.*;
    public class readDataTest
         public static void main(String[] args)
              /* get filename from user, will accept and work with drive name
              e.g. c:\java\data.txt, if it is the same drive as the compiler
              does not need the directory. however, it always needs the extension.
              userInput is created by me, File, StringBuffer, BufferReader
              are part of java.io */
              userInput fileinput = new userInput();
              String filename = fileinput.getUserInput("What is the file's name");
              File file = new File(filename);
              StringBuffer contents = new StringBuffer();
              BufferedReader reader = null;
              //try to read the data into reader
              try
                   reader = new BufferedReader(new FileReader(file));
                   String text = null;
                   while((text = reader.readLine()) !=null)
                        //create a really big string, seems inefficient
                        contents.append(text).append(System.getProperty("line.separator"));
                   //close the reader
                   reader.close();
              catch (IOException e)
                   System.out.println(e);
              //take the huge string and parse out all the carriage returns
              String[] stringtext = contents.toString().split("\\r");
              //create mmm to get take the individual string elements of stringtext
              String mmm;
              //create ccc to create the individual parsed array for the ArrayList
              String[] ccc = new String[2];
              //create the arraylist to store the data
              ArrayList<prices> data = new ArrayList<prices>();
              /*go through the carriage returned parsed array and feed the data elements
              into appropriate type into the arraylist, note the parse takes the eof as an
              empty cell*/
              //prices pricestamp = new prices();
              for(int c=0; c < stringtext.length-1; c++)
                   prices pricestamp = new prices();
                   mmm=stringtext[c];
                   /*trims the extra text created by the carriage return, if it is not
                   trimmed, the array thinks its got an element that is "" */
                   mmm=mmm.trim();
                   //whitespace split the array
                   ccc=mmm.split("\\s");
                   pricestamp.time=Integer.parseInt(ccc[0]);
                   pricestamp.price=Double.parseDouble(ccc[1]);
                   //System.out.println(ccc[1]);
                   data.add(pricestamp);
                   //System.out.println(data.get(c).price);
                   //pricestamp.time=0;
                   //pricestamp.price=0;
                   pricestamp=null;
              //pricestamp=null;
              //System.out.println(pricestamp.price);
              System.out.println(data.size());
              double totalprice=0;
              for(int c=0; c<data.size(); c++)
                   //System.out.println(data.get(c).price);
                   totalprice+=data.get(c).price;
              System.out.println("This is the total price: " + totalprice);
    public class prices
         int time;
         double price;
    public class evenOdd
         public int isEven(double number)
              int evenodd;
              double half = number/2;
              int half2 = (int) half;
              if(half == half2)
                   evenodd = 1;
              else
                   evenodd = 0;
              return evenodd;
    So the program works and does what I want it to do. I am very sure there are better ways to parse the data, but thats not my question. (For argument's sake lets assume the data that feeds this is pre-cleaned and is as perfect as baby in its mother's eyes). My question is actually something else. What I originally tried to do was the following:
    prices pricestamp = new prices();
              for(int c=0; c < stringtext.length-1; c++)
                   mmm=stringtext[c];
                   mmm=mmm.trim();
                   ccc=mmm.split("\\s");
                   pricestamp.time=Integer.parseInt(ccc[0]);
                   pricestamp.price=Double.parseDouble(ccc[1]);
                   data.add(pricestamp);
    however, when I did this, this part:
    for(int c=0; c<data.size(); c++)
                   //System.out.println(data.get(c).price);
                   totalprice+=data.get(c).price;
              System.out.println("This is the total price: " + totalprice);
    would only use the last price recorded in data. So each iteration was just the last price added to totalprice. I spent hours trying to figure out why and trying different ways of doing it to get it to work (as you probably can tell from random commented out lines). I am completely dumbfounded why it doesn't work the other way. Seems inefficient to me to keep creating an object (I think thats the right terminology, i equate this to dim in VB) and then clearing it, instead of just opening it once and then just overwriting it). I really would appreciate an explanation of what I am missing.
    Thank you.
    Rich

    prices pricestamp = new prices();
    for(int c=0; c < stringtext.length-1; c+)
    mmm=stringtext[c];
    mmm=mmm.trim();
    ccc=mmm.split("\\s");
    pricestamp.time=Integer.parseInt(ccc[0]);
    pricestamp.price=Double.parseDouble(ccc[1]);
    data.add(pricestamp);
    }This is definitely wrong. You have only created one instance of pricestamp and you just keep overwriting it with new values. You need to put the new inside the loop to create a new instance for each row.
    Also I doubt you really mean .length - 1, that doesn't include the last row.
    Style wise:
    Class names should always start with capital letters, fields and variable always with lower case letters. These conventions aren't imposed by the compiler but are established practice, and make your code a lot easier to follow. Use "camel case" to divide you names into words e.g. priceStamp
    When using single letter names for integer indices people tend to expect i through n. This is a historical thing, dating back to FORTRAN.

  • Dynamic View Object Creation and Scope Question

    I'm trying to come up with a way to load up an SQL statement into a view object, execute it, process the results, then keep looping, populating the view object with a new statement, etc. I also need to handle any bad SQL statement and just keep going. I'm running into a problem that is split between the way java scopes objects and the available methods of a view object. Here's some psuedo code:
    while (more queries)
    ViewObject myView = am.createViewObjectFromQueryStmt("myView",query); //fails if previous query was bad
    myView.executeQuery();
    Row myRow = myView.first();
    int rc = myView.getRowCount();
    int x = 1;
    myView.first();
    outStr = "";
    int cc = 0;
    while (x <= rc) //get query output
    Object[] result = myRow.getAttributeValues();
    while (cc < result.length)
    outStr = outStr+result[cc].toString();
    cc = cc+1;
    x = x+1;
    myView.remove();
    catch (Exception sql)
    sql.printStackTrace(); myView.remove(); //won't compile, out of scope
    finally
    myView.remove(); //won't compile, out of scope
    //do something with query output
    Basically, if the queries are all perfect, everything works fine, but if a query fails, I can't execute a myView.remove in an exception handler. Nor can I clean it up in a finally block. The only other way I can think of to handle this would be to re-use the same view object and just change the SQL being passed to it, but there's no methods to set the SQL directly on the view object, only at creation time as a method call from the application module.
    Can anyone offer any suggestions as to how to deal with this?

    I figured this out. You can pass a null name to the createViewObjectFromQueryStmt method, which apparently creates a unqiue name for you. I got around my variable scoping issue by re-thinking my loop logic.

  • Might go for T400/500- Many questions concerning Think Vantage

    Hi,
    I am deciding on my first IBM, a T400 or T500
    I have a few questions concerning the Think Vantage Function:
    a) Does the recovery DVD set back the hard drive partitions to factory settings?
    b) Does the Think Vantage function set back the hard drive partitions to factory settings?
    This means the original size of the partitions, when they have been changed manually.
    c) Does Think Vantage work with a self buyed Windows Vista?
    d) Does Think Vantage work unter Windows XP
    e) Does Think Vantage need drivers/ anything else to work or is it entirly working on the hardware side, so no software/ windows is needed
    f)Will Think Vantage work under Windows 7 in a T400/500
    g) How was the past situation? Did a under Windows XP working Think Vantage also work on Vista / have there been drivers delivered, when needed, for the new OS
    h) Is it possible to set up a new OS (like Vista Ultimate) and then backup it up on a external hard drive and later recover from this?
    What do I want to achieve?
    I want to recover the factory settings at all times, this means partition size, number of partitions etc. and Windows Vista Business. Then I want to install Vista Ultimate do my settings and backing it up to an external drive or whatever and then recover from that all 3 Months. In the end I should be able to set back factory settings with the earliest/ first backup from Windows Business; Furthermore I might want to install Windows 7 sometimes.
    Thank you for your help! Kind regards
    Message Edited by Schwenker on 11-23-2008 08:23 AM

    Hello,
    I would recommend Acronis to do this job. Here is a link at thinkpad-forum.de.
    You´ll  get Acronis for free if you buy a PCWelt.
    Your answers:
    A. yes
    B: yes
    C: yes
    D: yes
    E: No, windows is needed and if it´s XP than MS NET 2.0 also.
    F: yes, when windows 7 is out, than Thinkvantage will work then, on Server 2008 it seems to work.
    G:Thinkvantage work in Vista and XP environment.
    H: yes, you can backup it on a extern hdd and later recover the R&R Image to the internal disc.
    What do I want to achieve?
    I would recommend Acronis to do this job. Here is a link at thinkpad-forum.de.
    You´ll  get Acronis for free, if you buy a PCWelt.
    here are some interesting benchmark with first versions of Windows 7 and XP.
    Windows 7 unmasked
    Perceptions becomes reality
    Message Edited by Agotthelf on 23-11-2008 10:23 PM
    Follow @LenovoForums on Twitter! Try the forum search, before first posting: Forum Search Option
    Please insert your type, model (not S/N) number and used OS in your posts.
    I´m a volunteer here using New X1 Carbon, ThinkPad Yoga, Yoga 11s, Yoga 13, T430s,T510, X220t, IdeaCentre B540.
    TIP: If your computer runs satisfactorily now, it may not be necessary to update the system.
     English Community       Deutsche Community       Comunidad en Español

  • Page flow scope questions

    Hi guys,
    I'm continuing my investigation of ADF Faces 11 and have a few questions about pageFlowScope:
    1. When are objects removed from pageFlowScope, aside from a session ending? Do they need to be removed manually or are they removed when they are no longer accessed, such as in Orchestra's conversation.access scope?
    2. Managed beans cannot be declared to be of this scope in the core release. Does anybody know of an extension that provides a Spring custom scope based on pageFlowScope, similar to what Orchestra's offering?
    Thanks all!

    Hi,
    +1. When are objects removed from pageFlowScope, aside from a session ending? Do they need to be removed manually or are they removed when they are no longer accessed, such as in Orchestra's conversation.access scope?+
    If you open a dialog within the external dialog framework then this creates a new pageFlowScope. This is cleaned up for you when you exit it. Beside of this the pageFlowScope of the base flow is cleaned up when the session ends.
    +2. Managed beans cannot be declared to be of this scope in the core release. Does anybody know of an extension that provides a Spring custom scope based on pageFlowScope, similar to what Orchestra's offering?+
    The managed bean scope is handled by the JSF RI navigation handler, which you use if not using ADFc. This means that unless you build your own decorator for it there are no additional scopes to put managed beans into. Maybe posting the same question to the Trinidad mailing list on Apache gives you some more inside
    Frank

  • Begginer`s question . i think

    Okey .. so i'm new with java but i need to find out something ..
    i'm using a java application for my mobile, a notepad to be exact.
    For it to store notes it uses a .rms file ( from what i've seen is a db of somekind ).
    I was wondering if there is a application or something to see all the entries of this .rms file from the pc and to edit them.
    Is this possible ?
    Thank you.

    Yes. About that.
    What is the reason that it's phone dependent ?
    I've seen a lot of similarities in .rms files with different records:
    The begging is the same:
    midp-rms   [?     :??wI"?9*{??????   and i think after there some variabiles that are in some connection with the file size and the number of the records
    and the separator from recordings is:
          ?       ( where ^ is variabile )
    So .. i repet my question: What is the reason that rms files are phone dependent ?

  • Scope Question - ratios?

    Hi all,
    A question about the scope when calculating ratios.
    If I have a report and introduce breaks to get sub-totals, when I total the columns, WebI puts sum(column_value) in the totals fields. If I then have a column which computes a percentage of column A to column B, I would normally put a new calculated field in the totals row of sum(column A) / sum(column B) as below
         A                   var1           var2         var1/var2
         A                   var1           var2         var1/var2
         A                   var1           var2         var1/var2
         A                   var1           var2         var1/var2
         Sub-Total A:        sum(var1)      sum(var2)    sum(var1)/sum(var2)
         B                   var1           var2         var1/var2
         B                   var1           var2         var1/var2
         B                   var1           var2         var1/var2
         Sub-Total B:        sum(var1)      sum(var2)    sum(var1)/sum(var2)
         Overall Total:      sum(var1)      sum(var2)    sum(var1)/sum(var2)
    I know this works - but as WebI "knows" the scope of the report, is this necessary?
    Or would it be valid just to use the column values as in
         A                   var1           var2         var1/var2
         A                   var1           var2         var1/var2
         A                   var1           var2         var1/var2
         A                   var1           var2         var1/var2
         Sub-Total A:        var1           var2         var1/var2
         B                   var1           var2         var1/var2
         B                   var1           var2         var1/var2
         B                   var1           var2         var1/var2
         Sub-Total B:        var1           var2         var1/var2
         Overall Total:      var1           var2         var1/var2
    It seems to work - but is this a valid approach I can rely on in all cases?
    (In real life, to allow for dividing by 0, we would create a variable for the ratio column, and this would mean creating another variable to do the same thing for the sub-total and total rows)
    Thanks,
    Malcolm

    Hi Malcolm,
    Break Footer will display the subtotal of the each braked value. where it aggregate the value and display subtotal.
    You can change this calculation as per your requirement.
    For more detail you see the below document.
    http://help.sap.com/businessobject/product_guides/boexir31SP3/en/xi31_sp3_webi_ffc_en.pdf
    Page no 33
    I hope this is what you are looking for.

  • Simple audio question (I think)

    Thanks everyone for answering this question which I think is fairly simple. I have a new TV that I use as the monitor for my computer and connect my Itv to. Currently I have both the cable, my computer and ITV hooked up through HDMI. Whenever I switch between the different HDMI inputs I obviously do not continue getting the sound out from my ITV. The question is I would like to be able to leave my ITV running while it is playing music to my stereo and surf the internet with my computer output on the screen. I know I could obviously play Itunes on my computer however the ITV seems to have much better output quality. Anyone has a solution for this?
    I look forward to your answers. Have a great day and thanks again.
    Message was edited by: mameares

    Welcome to the  Discussion Forums.
    Not without some other device to feed audio through. Your tv will only play from one input at a time, when you switch to the input from your mac/pc, it will always cut off the audio from other inputs.

  • JSP basic questions ( i think )

    Hi, I'm new to JSP.
    I established a database connection using JSP. However, I would prefer a java connection, so I have a program called JDBCBean.java which attempts the connection. However, when I compile this and place it in my classes folder, then try to use it in my jsp file, I get a "class not found" error. This confuses me, since it IS there and I set the classpath to the folder in which it is located....
    The JDBC has : package oracle.jdbc at the top
    and in my JSP file I have, for use bean, class = "oracle.jdbc.JDBCBean".
    I can't figure out what causes my error, or how to fix it, so any help would be greatly appreciated.
    Another thing I can' quite figure is the arguements stuff. Now I can pass parameters using a form...
    For example, I tested with textbox "please enter a name". You enter a name, it then uses that parameter in the URL e.g. www.something.com/something.jsp?name=bob
    But... what I want to do is have some sort of setup where, you have, say 3 types.
    e.g. Type - 1 2 3
    And if you click on 1, the parameter would be an SQL query. e.g. Select * from x where type = '1';
    and then the page displays the results of my query.
    Is this so hard? For the life of me, I can't find such info in my book and I've hunted the net and found nothing useful. All i find is about ASP, which I think is a good bit different.
    Please help. Sample code or links or whatever would be great.
    Thanks a lot.

    Ok, classpath is irrelevant? Understood.
    This is the bean stuff i took from my book. I assume package and the class i have are correct.
    Going by these, JDBCBean.class should be located in /oracle/jdbc/ yes??
    JDBCBean.java
    package oracle.jdbc;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class JDBCBean implements Serializable{
      protected transient String tableName, url;
      protected transient String query, columnNames;
      protected transient String resultTable, condn;
      protected transient String userid, password;
      protected transient Connection conn;
      public JDBCBean(){
        tableName = null;
        resultTable = null;
        condn = null;
        columnNames = null;
        resultTable = null;
        query = null;
        conn = null;
        userid = null;
        password = null;
      public void setTableName(String tableName){
        this.tableName = tableName;
      public String getTableName(){
        return tableName;
      public void setURL(String url){
        this.url = url;
      public String getURL(){
        return url;
      public void setCondn(String condn){
        this.condn = null;
        this.condn = condn;
      public String getCondn(){
        return condn;
      public void setUserid(String userid){
        this.userid = userid;
      public String getUserid(){
        return userid;
      public void setPassword(String password){
        this.password = password;
      public String getPassword(){
        return password;
      public void setColumnNames(String columnNames){
        this.columnNames = columnNames;
      public String getColumnNames(){
        return columnNames;
      public void setResultTable(String resultTable){
        this.resultTable = resultTable;
      public String getResultTable(){
        this.readTable();
        return resultTable;
      public void readTable(){
        int i = 0;
        String condition = "";
        if(columnNames == null){
          columnNames = "*";
        if(condn == null){
          condition = "";
        else{
          condition = " WHERE " + condn;
        query = "SELECT ";
            if (columnNames.charAt(0) == '*') {
              query += "* FROM " + tableName;
            } else {
            query += columnNames + " FROM " + tableName;
        if((!condition.equals(""))){
          query += condition;
        executeQuery(query);
      private void executeQuery(String query){
        if(conn == null){
          initialize();
        try{
          Statement stmt = conn.createStatement();
          ResultSet rset = stmt.executeQuery(query);
          ResultSetMetaData rsmd = rset.getMetaData();
          StringBuffer returnBuffer = new StringBuffer();
                int colNum = rsmd.getColumnCount();
                returnBuffer.append("\n\n<TABLE BORDER=\"1\" " +
                  "CELLSPACING=\"0\" CELLPADDING=\"3\">\n\t<TR>\n");
              for (int i=1; i <= colNum; i++){
                  returnBuffer.append("\t\t<TD>");
                  returnBuffer.append("<B>" +
                    rsmd.getColumnName(i) + "</B></TD>\n");
              returnBuffer.append("\t</TR>\n");
              while (rset.next()){
                returnBuffer.append("\t<TR>\n");
                for (int i=1; i <= colNum; i++)
                  returnBuffer.append("\t\t<TD>" +
                  rset.getString(i) + "</TD>\n");
                  returnBuffer.append("\t</TR>\n");
                returnBuffer.append("</TABLE>");
           resultTable = returnBuffer.toString();
           stmt.close();
           done();
        }catch(SQLException se){se.printStackTrace();}
      private void initialize(){
        try{
          Class.forName("oracle.jdbc.driver.OracleDriver");
          conn =
            DriverManager.getConnection(url, userid, password);
        }catch(SQLException se){se.printStackTrace();}
         catch(ClassNotFoundException cnfe)
                     {cnfe.printStackTrace();}
      public void done(){
        if(conn != null){
          try{
            conn.close();
          }catch(SQLException se){se.printStackTrace();}
    }JDBCBean.jsp
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Final//EN">
    <HTML>
    <BODY BGCOLOR="white">
    <% // Condn and ColumnNames are optional. Default ='*' %>
    <jsp:useBean class="oracle.jdbc.JDBCBean"
           scope="page"
           id="example" >
       <jsp:setProperty name="example"
           property="URL"
           value="jdbc:oracle:thin:@mysite:myport:xxx" />
       <jsp:setProperty name="example"
           property="Userid"
           value="me" />
       <jsp:setProperty name="example"
           property="Password"
           value="mypassword" />
       <jsp:setProperty name="example"
           property="TableName"
           value="system_users" />
       <jsp:setProperty name="example"
           property="ColumnNames"
           value="*" />
       <jsp:setProperty name="example"
           property="Condn"
           value="first_name != 'Bill'" />
       <jsp:getProperty name="example"
           property="ResultTable" />
    </jsp:useBean>
    </BODY>
    </HTML>I haven't really modified the code yet, as I want to establish a working java connection first.
    By the second part, what I meant was :
    You have something like "select a type" and then you have the options - 1, 2 , 3.
    If you choose 1, I want it to execute a query which will then display everything of type 1 on the page. e.g. pass the parameter (select * from table where type = '1';)
    Basically, your page would then be "refreshed" displaying the data your query produces, using another bean I presume.
    Thanks!

  • A CSS question I think

    If you would take a look at this page http://www.gcfa.org/add_data.asp you will see that between the header and the navigation bar a white line is there. I don't won't it there, how can I get rid of it?
    It must be in my CSS I guess, I checked the images and neither one of them the Header nor the Navigation menu have a white border. Here's my code. Thanks in advance for your help.
    My page:
    <%@LANGUAGE="VBSCRIPT"%>
    <!--#include file="Connections/BishopsLogin.asp" -->
    <%
    Dim MM_editAction
    MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
    If (Request.QueryString <> "") Then
      MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
    End If
    ' boolean to abort record edit
    Dim MM_abortEdit
    MM_abortEdit = false
    %>
    <%
    If (CStr(Request("MM_insert")) = "form1") Then
      If (Not MM_abortEdit) Then
        ' execute the insert
        Dim MM_editCmd
        Set MM_editCmd = Server.CreateObject ("ADODB.Command")
        MM_editCmd.ActiveConnection = MM_BishopsLogin_STRING
        MM_editCmd.CommandText = "INSERT INTO dbo.DeptData (Department, SubpageTitle, LinkDescription, URL, DateLastModified, ModifiedBy) VALUES (?, ?, ?, ?, ?, ?)"
        MM_editCmd.Prepared = true
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 201, 1, 30, Request.Form("Department")) ' adLongVarChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 201, 1, 1000, Request.Form("SubpageTitle")) ' adLongVarChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 201, 1, 1000, Request.Form("LinkDescription")) ' adLongVarChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 201, 1, 500, Request.Form("URL")) ' adLongVarChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 201, 1, 10, Request.Form("DateLastModified")) ' adLongVarChar
        MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 201, 1, 50, Request.Form("ModifiedBy")) ' adLongVarChar
        MM_editCmd.Execute
        MM_editCmd.ActiveConnection.Close
        ' append the query string to the redirect URL
        Dim MM_editRedirectUrl
        MM_editRedirectUrl = "adding_data_results.asp"
        If (Request.Form<> "") Then
          If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
            MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.Form
          Else
            MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.Form
          End If
        End If
        Response.Redirect(MM_editRedirectUrl)
      End If
    End If
    %>
    <%
    Dim rs_Add_Data__MMColParam
    rs_Add_Data__MMColParam = "1"
    If (Request.QueryString("RecordID") <> "") Then
      rs_Add_Data__MMColParam = Request.QueryString("RecordID")
    End If
    %>
    <%
    Dim rs_Add_Data
    Dim rs_Add_Data_cmd
    Dim rs_Add_Data_numRows
    Set rs_Add_Data_cmd = Server.CreateObject ("ADODB.Command")
    rs_Add_Data_cmd.ActiveConnection = MM_BishopsLogin_STRING
    rs_Add_Data_cmd.CommandText = "SELECT ID, Department, SubpageTitle, LinkDescription, URL, DateLastModified, ModifiedBy FROM dbo.DeptData WHERE ID = ? ORDER BY ID DESC"
    rs_Add_Data_cmd.Prepared = true
    rs_Add_Data_cmd.Parameters.Append rs_Add_Data_cmd.CreateParameter("param1", 5, 1, -1, rs_Add_Data__MMColParam) ' adDouble
    Set rs_Add_Data = rs_Add_Data_cmd.Execute
    rs_Add_Data_numRows = 0
    %>
    <%
    Dim MM_paramName
    %>
    <%
    ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
    Dim MM_keepNone
    Dim MM_keepURL
    Dim MM_keepForm
    Dim MM_keepBoth
    Dim MM_removeList
    Dim MM_item
    Dim MM_nextItem
    ' create the list of parameters which should not be maintained
    MM_removeList = "&index="
    If (MM_paramName <> "") Then
      MM_removeList = MM_removeList & "&" & MM_paramName & "="
    End If
    MM_keepURL=""
    MM_keepForm=""
    MM_keepBoth=""
    MM_keepNone=""
    ' add the URL parameters to the MM_keepURL string
    For Each MM_item In Request.QueryString
      MM_nextItem = "&" & MM_item & "="
      If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
        MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
      End If
    Next
    ' add the Form variables to the MM_keepForm string
    For Each MM_item In Request.Form
      MM_nextItem = "&" & MM_item & "="
      If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
        MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
      End If
    Next
    ' create the Form + URL string and remove the intial '&' from each of the strings
    MM_keepBoth = MM_keepURL & MM_keepForm
    If (MM_keepBoth <> "") Then
      MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
    End If
    If (MM_keepURL <> "")  Then
      MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
    End If
    If (MM_keepForm <> "") Then
      MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
    End If
    ' a utility function used for adding additional parameters to these strings
    Function MM_joinChar(firstItem)
      If (firstItem <> "") Then
        MM_joinChar = "&"
      Else
        MM_joinChar = ""
      End If
    End Function
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>GCFA: Update Data Files</title>
    <link href="samples/OneColumn.css" rel="stylesheet" type="text/css" />
    <style type="text/css" media="screen">
    @import url("images/nav_bar.css");
    </style>
    <script language="JavaScript1.2" type="text/javascript" src="images/mm_css_menu.js"></script>
    <script type="text/javascript">
    <!--
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    //-->
    </script>
    </head>
    <body class="oneColLiqCtrHdr" onload="MM_preloadImages('images/Slices/nav_bar_r2_c2_f2.gif','images/Slices/nav_bar_r2_c 3_f2.gif','images/Slices/nav_bar_r2_c5_f2.gif')">
    <div id="container">
        <div id="header">   
           <div id="#DataFiles_LOGO"></div>
      </div>
      <div id="mainContent">
        <div id="FWTableContainer1445733177">
          <table border="0" cellpadding="0" cellspacing="0" width="799">
            <!-- fwtable fwsrc="nav_bar_revised.png" fwpage="Page 1" fwbase="nav_bar.gif" fwstyle="Dreamweaver" fwdocid = "1445733177" fwnested="0" -->
            <tr>
              <td><img src="images/Slices/spacer.gif" width="1" height="1" border="0" alt="" /></td>
              <td><img src="images/Slices/spacer.gif" width="221" height="1" border="0" alt="" /></td>
              <td><img src="images/Slices/spacer.gif" width="221" height="1" border="0" alt="" /></td>
              <td><img src="images/Slices/spacer.gif" width="5" height="1" border="0" alt="" /></td>
              <td><img src="images/Slices/spacer.gif" width="221" height="1" border="0" alt="" /></td>
              <td><img src="images/Slices/spacer.gif" width="130" height="1" border="0" alt="" /></td>
              <td><img src="images/Slices/spacer.gif" width="1" height="1" border="0" alt="" /></td>
            </tr>
            <tr>
              <td colspan="6"><img name="nav_bar_r1_c1" src="images/Slices/nav_bar_r1_c1.gif" width="799" height="5" border="0" id="nav_bar_r1_c1" alt="" /></td>
              <td><img src="images/Slices/spacer.gif" width="1" height="5" border="0" alt="" /></td>
            </tr>
            <tr>
              <td rowspan="2"><img name="nav_bar_r2_c1" src="images/Slices/nav_bar_r2_c1.gif" width="1" height="25" border="0" id="nav_bar_r2_c1" alt="" /></td>
              <td><a href="javascript:;" onmouseout="MM_swapImgRestore();MM_menuStartTimeout(1000)" onmouseover="MM_menuShowMenu('MMMenuContainer1015135953_0', 'MMMenu1015135953_0',6,24,'nav_bar_r2_c2');MM_swapImage('nav_bar_r2_c2','','images/Slices /nav_bar_r2_c2_f2.gif',1);"><img name="nav_bar_r2_c2" src="images/Slices/nav_bar_r2_c2.gif" width="221" height="24" border="0" id="nav_bar_r2_c2" alt="" /></a></td>
              <td><a href="http://www.gcfa.org/Department_Data.aspx" target="_top" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_bar_r2_c3','','images/Slices/nav_bar_r2_c3_f2.gif',1);"><i mg name="nav_bar_r2_c3" src="images/Slices/nav_bar_r2_c3.gif" width="221" height="24" border="0" id="nav_bar_r2_c3" alt="Department Data Files" /></a></td>
              <td rowspan="2"><img name="nav_bar_r2_c4" src="images/Slices/nav_bar_r2_c4.gif" width="5" height="25" border="0" id="nav_bar_r2_c4" alt="" /></td>
              <td><a href="http://www.gcfa.org/help_topics.html" target="_top" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_bar_r2_c5','','images/Slices/nav_bar_r2_c5_f2.gif',1);"><i mg name="nav_bar_r2_c5" src="images/Slices/nav_bar_r2_c5.gif" width="221" height="24" border="0" id="nav_bar_r2_c5" alt="Help Topics" /></a></td>
              <td rowspan="2"><img name="nav_bar_r2_c6" src="images/Slices/nav_bar_r2_c6.gif" width="130" height="25" border="0" id="nav_bar_r2_c6" alt="" /></td>
              <td><img src="images/Slices/spacer.gif" width="1" height="24" border="0" alt="" /></td>
            </tr>
            <tr>
              <td colspan="2"><img name="nav_bar_r3_c2" src="images/Slices/nav_bar_r3_c2.gif" width="442" height="1" border="0" id="nav_bar_r3_c2" alt="" /></td>
              <td><img name="nav_bar_r3_c5" src="images/Slices/nav_bar_r3_c5.gif" width="221" height="1" border="0" id="nav_bar_r3_c5" alt="" /></td>
              <td><img src="images/Slices/spacer.gif" width="1" height="1" border="0" alt="" /></td>
            </tr>
          </table>
          <div id="MMMenuContainer1015135953_0">
            <div id="MMMenu1015135953_0" onmouseout="MM_menuStartTimeout(1000);" onmouseover="MM_menuResetTimeout();"> <a href="http://www.gcfa.org/add_data.asp" target="_top" id="MMMenu1015135953_0_Item_0" class="MMMIFVStyleMMMenu1015135953_0" onmouseover="MM_menuOverMenuItem('MMMenu1015135953_0');"> Add Data </a> <a href="http://www.gcfa.org/update_data.asp" target="_top" id="MMMenu1015135953_0_Item_1" class="MMMIVStyleMMMenu1015135953_0" onmouseover="MM_menuOverMenuItem('MMMenu1015135953_0');"> Update Data </a> <a href="http://www.gcfa.org/delete_data.asp" target="_top" id="MMMenu1015135953_0_Item_2" class="MMMIVStyleMMMenu1015135953_0" onmouseover="MM_menuOverMenuItem('MMMenu1015135953_0');"> Delete Data </a> </div>
          </div>
        </div>
        <br />
            <br />
            <br />
            <br />
            <br />
          <strong>Enter the information you are wanting  to add to our database:</strong><br />
      </div>
        <form ACTION="<%=MM_editAction%>" METHOD="POST" name="form1" target="_top" id="form1">
          <table width="689" align="left">
        <tr valign="baseline">
          <td align="left" valign="top" nowrap="nowrap">Department:</td>
          <td><label>
            <input name="Department" type="text" id="Department" size="75" maxlength="500" />
          </label></td>
        </tr>
        <tr valign="baseline">
          <td align="left" valign="top" nowrap="nowrap">Subpage Title:</td>
          <td><label>
            <input name="SubpageTitle" type="text" id="SubpageTitle" size="75" maxlength="1000" />
          </label></td>
        </tr>
        <tr valign="baseline">
          <td align="left" valign="top" nowrap="nowrap">Link Description:</td>
          <td><label>
            <input name="LinkDescription" type="text" id="LinkDescription" size="75" maxlength="1000" />
          </label></td>
        </tr>
        <tr valign="baseline">
          <td align="left" valign="top" nowrap="nowrap">URL:</td>
          <td><input name="URL" type="text" id="URL" size="75" maxlength="500" /></td>
        </tr>
        <tr valign="baseline">
          <td height="24" align="left" valign="top" nowrap="nowrap">Date Modified:</td>
          <td><input name="DateLastModified" type="text" id="DateLastModified" size="75" maxlength="10" /></td>
        </tr>
        <tr valign="baseline">
          <td align="left" valign="top" nowrap="nowrap">Modified By:</td>
          <td><label>
            <input name="ModifiedBy" type="text" id="ModifiedBy" size="75" maxlength="50" />
          </label></td>
        </tr>
        <tr valign="baseline">
          <td height="20" align="left" valign="top" nowrap="nowrap"> </td>
          <td> </td>
        </tr>
        <tr valign="baseline">
          <td align="left" valign="top" nowrap="nowrap"><p> </p></td>
          <td align="left" valign="top" nowrap="nowrap"><label>
            <input type="submit" name="Add_Info" id="Add_Info" value="Add data to database now!" />
          </label></td>
        </tr>
      </table>
      <p> </p>
      <p><br />
          <br />
          <br />
          <br />
          </p>
      <p> </p>
      <p> </p>
      <p> </p>
      <p><br />
          </p>
      <input type="hidden" name="MM_insert" value="form1" />
    </form> </p>
      <p> </p>
      <p> </p>
      <p> </p>
      <p> </p>
      <p> </p>
      <p> </p>
      <p> </p>
      <p> </p>
      <p>  </p>
    </div>
      <div id="footer">
        <p align="center">This site is maintained by the General Council on Finance and Administration <script language="JavaScript">
    var today_date= new Date()
    var year=today_date.getFullYear()
    document.write(year)
    //--> </script>
    &copy;</p>
      <!-- end #footer --></div>
    <!-- end #container --></div>
    </body>
    </html>
    <%
    rs_Add_Data.Close()
    Set rs_Add_Data = Nothing
    %>
    My CSS Pages:
    @charset "utf-8";
    body {
    /*background:#ffffff;*/
    margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
    padding: 0;
    text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
    /*color: #000000;*/
    width: 100%;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: none;
    border-left-style: none;
    background-repeat: no-repeat;
    background-position: right top;
    background-image: url(../images/body_bg.jpg);
    .oneColLiqCtrHdr #container {
    width: 99%; /* the auto margins (in conjunction with a width) center the page */
    /* border: 1px solid #000000;*/
    text-align: left; /* this overrides the text-align: center on the body element. */
    margin-top: 0;
    margin-right: auto;
    margin-bottom: 0;
    margin-left: auto;
    background-color: ;
    background-repeat: no-repeat;
    background-position: right top;
    .oneColLiqCtrHdr #header {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-weight: 700;
    color: #FFFFFF;
    font-size: 18px;
    background-repeat: no-repeat;
    height: 124px;
    width: 100%;
    background-image: url(../images/dept_data_files_logo.jpg);
    padding: 0px;
    /*background-color: #67120D;*/
    .oneColLiqCtrHdr #mainContent {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #3C0D0D;
    font-weight: 700;
    padding-top: 0;
    padding-right: 0px;
    padding-bottom: 0;
    padding-left: 0px;
    margin: 0px;
    width: 760px;
    .oneColLiqCtrHdr #footer {
    padding: 0 10px;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-weight: 700;
    color: #FFFFFF;
    background-color: #000000;
    /*width:780px;*/
    .oneColLiqCtrHdr #footer p {
    margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
    padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
    h1 {
    color:#FFFFFF;
    font-size: 36px;
    h2,h3 {
    10px;
    8px;
    color: #000000;
    #DataFiles_LOGO{
    height:127px;
    width: 740px;
    background-repeat: no-repeat;
    background-image: url(../images/dept_data_files_logo.jpg);
    background-position: left top;
    padding: 0px;
    margin: 0px;
    top: 0px;
    float: left;
    And my Navigation CSS:
    td img {
    /* Another Mozilla/Netscape bug with making sure our images display correctly */
    display: block;
    #FWTableContainer1445733177 {
    /* The master div to make sure that our popup menus get aligned correctly.  Be careful when playing with this one. */
    position:relative;
    margin:0px;
    width:799px;
    height:30px;
    text-align:left;
    #MMMenuContainer1015135953_0 {
    /* This ID is related to the master menu div for menu MMMenuContainer1015135953_0 and contains the important positioning information for the menu as a whole */
    position:absolute;
    left:7px;
    top:29px;
    visibility:hidden;
    z-index:300;
    #MMMenu1015135953_0 {
    /* This class defines things about menu MMMenu1015135953_0's div. */
    position:absolute;
    left:0px;
    top:0px;
    visibility:hidden;
    background-color:#ffffff;
    border:1px solid #000000;
    width:208px;
    height:76px;
    .MMMIFVStyleMMMenu1015135953_0 {
    /* This class determines the general characteristics of the menu items in menu MMMenu1015135953_0 */
    border-top:1px solid #000000;
    border-left:1px solid #000000;
    border-bottom:1px solid #ffffff;
    border-right:1px solid #ffffff;
    width:208px;
    height:26px;
    voice-family: "\"}\"";
    voice-family:inherit;
    width:200px;
    height:18px;
    .MMMIVStyleMMMenu1015135953_0 {
    /* This class determines the general characteristics of the menu items in menu MMMenu1015135953_0 */
    border-top:0px;
    border-left:1px solid #000000;
    border-bottom:1px solid #ffffff;
    border-right:1px solid #ffffff;
    width:208px;
    height:25px;
    voice-family: "\"}\"";
    voice-family:inherit;
    width:200px;
    height:18px;
    #MMMenu1015135953_0_Item_0 {
    /* Unique ID for item 0 of menu MMMenu1015135953_0 so we can set its position */
    left:0px;
    top:0px;
    #MMMenu1015135953_0_Item_1 {
    /* Unique ID for item 1 of menu MMMenu1015135953_0 so we can set its position */
    left:0px;
    top:26px;
    #MMMenu1015135953_0_Item_2 {
    /* Unique ID for item 2 of menu MMMenu1015135953_0 so we can set its position */
    left:0px;
    top:51px;
    #MMMenuContainer1015135953_0 img {
    /* needed for Mozilla/Camino/Netscape */
    border:0px;
    #MMMenuContainer1015135953_0 a {
    /* Controls the general apperance for menu MMMenuContainer1015135953_0's items, including color and font */
    text-decoration:none;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:14px;
    color:#ffcc33;
    text-align:center;
    vertical-align:middle;
    padding:3px;
    background-color:#000000;
    font-weight:bold;
    font-style:normal;
    display:block;
    position:absolute;
    #MMMenuContainer1015135953_0 a:hover {
    /* Controls the mouse over effects for menu MMMenuContainer1015135953_0 */
    color:#ffcc33;
    background-color:#990000;

    Glad you sorted this out.
    You might want to mark this as Answered so folks trying to help answer questions won't have to click on this link now.  Thanks!
    E. Michael Brandt
    www.divahtml.com
    www.divahtml.com/products/scripts_dreamweaver_extensions.php
    Standards-compliant scripts and Dreamweaver Extensions
    www.valleywebdesigns.com/vwd_Vdw.asp
    JustSo PictureWindow
    JustSo PhotoAlbum, et alia

  • A simple Spry Accordion Question (I think)

    Hi all:
    I've searched but can't find, but I think this is a simple one.
    I've created a basic Spry accordion menu with DW/CS3 - Insert/Spry/Spry Accordion. How do I get the first "Content 1" to be hidden/not visible upon page load. Right now, the "Lable 2" must be clicked to hide the "Content 1" which of course shows the "Content 2"? Guessing it's in the JS, but I'm not sure. TIA for any help. HTML and JS Code below.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    <script src="SpryAssets/SpryAccordion.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="Accordion1" class="Accordion" tabindex="0">
      <div class="AccordionPanel">
        <div class="AccordionPanelTab">Label 1</div>
        <div class="AccordionPanelContent">Content 1</div>
      </div>
      <div class="AccordionPanel">
        <div class="AccordionPanelTab">Label 2</div>
        <div class="AccordionPanelContent">Content 2</div>
      </div>
    </div>
    <script type="text/javascript">
    <!--
    var Accordion1 = new Spry.Widget.Accordion("Accordion1");
    //-->
    </script>
    </body>
    </html>
    JAVASCRIPT
    var Spry;
    if (!Spry) Spry = {};
    if (!Spry.Widget) Spry.Widget = {};
    Spry.Widget.Accordion = function(element, opts)
        this.element = this.getElement(element);
        this.defaultPanel = 0;
        this.hoverClass = "AccordionPanelTabHover";
        this.openClass = "AccordionPanelOpen";
        this.closedClass = "AccordionPanelClosed";
        this.focusedClass = "AccordionFocused";
        this.enableAnimation = true;
        this.enableKeyboardNavigation = true;
        this.currentPanel = null;
        this.animator = null;
        this.hasFocus = null;
        this.duration = 500;
        this.previousPanelKeyCode = Spry.Widget.Accordion.KEY_UP;
        this.nextPanelKeyCode = Spry.Widget.Accordion.KEY_DOWN;
        this.useFixedPanelHeights = true;
        this.fixedPanelHeight = 0;
        Spry.Widget.Accordion.setOptions(this, opts, true);
        // Unfortunately in some browsers like Safari, the Stylesheets our
        // page depends on may not have been loaded at the time we are called.
        // This means we have to defer attaching our behaviors until after the
        // onload event fires, since some of our behaviors rely on dimensions
        // specified in the CSS.
        if (Spry.Widget.Accordion.onloadDidFire)
            this.attachBehaviors();
        else
            Spry.Widget.Accordion.loadQueue.push(this);
    Spry.Widget.Accordion.onloadDidFire = false;
    Spry.Widget.Accordion.loadQueue = [];
    Spry.Widget.Accordion.addLoadListener = function(handler)
        if (typeof window.addEventListener != 'undefined')
            window.addEventListener('load', handler, false);
        else if (typeof document.addEventListener != 'undefined')
            document.addEventListener('load', handler, false);
        else if (typeof window.attachEvent != 'undefined')
            window.attachEvent('onload', handler);
    Spry.Widget.Accordion.processLoadQueue = function(handler)
        Spry.Widget.Accordion.onloadDidFire = true;
        var q = Spry.Widget.Accordion.loadQueue;
        var qlen = q.length;
        for (var i = 0; i < qlen; i++)
            q[i].attachBehaviors();
    Spry.Widget.Accordion.addLoadListener(Spry.Widget.Accordion.processLoadQueue);
    Spry.Widget.Accordion.prototype.getElement = function(ele)
        if (ele && typeof ele == "string")
            return document.getElementById(ele);
        return ele;
    Spry.Widget.Accordion.prototype.addClassName = function(ele, className)
        if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) != -1))
            return;
        ele.className += (ele.className ? " " : "") + className;
    Spry.Widget.Accordion.prototype.removeClassName = function(ele, className)
        if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) == -1))
            return;
        ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
    Spry.Widget.Accordion.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
        if (!optionsObj)
            return;
        for (var optionName in optionsObj)
            if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
                continue;
            obj[optionName] = optionsObj[optionName];
    Spry.Widget.Accordion.prototype.onPanelTabMouseOver = function(panel)
        if (panel)
            this.addClassName(this.getPanelTab(panel), this.hoverClass);
    Spry.Widget.Accordion.prototype.onPanelTabMouseOut = function(panel)
        if (panel)
            this.removeClassName(this.getPanelTab(panel), this.hoverClass);
    Spry.Widget.Accordion.prototype.openPanel = function(panel)
        var panelA = this.currentPanel;
        var panelB = panel;
        if (!panelB || panelA == panelB)   
            return;
        var contentA;
        if( panelA )
            contentA = this.getPanelContent(panelA);
        var contentB = this.getPanelContent(panelB);
        if (! contentB)
            return;
        if (this.useFixedPanelHeights && !this.fixedPanelHeight)
            this.fixedPanelHeight = (contentA.offsetHeight) ? contentA.offsetHeight : contentA.scrollHeight;
        if (this.enableAnimation)
            if (this.animator)
                this.animator.stop();
            this.animator = new Spry.Widget.Accordion.PanelAnimator(this, panelB, { duration: this.duration });
            this.animator.start();
        else
            if(contentA)
                contentA.style.height = "0px";
            contentB.style.height = (this.useFixedPanelHeights ? this.fixedPanelHeight : contentB.scrollHeight) + "px";
        if(panelA)
            this.removeClassName(panelA, this.openClass);
            this.addClassName(panelA, this.closedClass);
        this.removeClassName(panelB, this.closedClass);
        this.addClassName(panelB, this.openClass);
        this.currentPanel = panelB;
    Spry.Widget.Accordion.prototype.openNextPanel = function()
        var panels = this.getPanels();
        var curPanelIndex = this.getCurrentPanelIndex();
        if( panels && curPanelIndex >= 0 && (curPanelIndex+1) < panels.length )
            this.openPanel(panels[curPanelIndex+1]);
    Spry.Widget.Accordion.prototype.openPreviousPanel = function()
        var panels = this.getPanels();
        var curPanelIndex = this.getCurrentPanelIndex();
        if( panels && curPanelIndex > 0 && curPanelIndex < panels.length )
            this.openPanel(panels[curPanelIndex-1]);
    Spry.Widget.Accordion.prototype.openFirstPanel = function()
        var panels = this.getPanels();
        if( panels )
            this.openPanel(panels[0]);
    Spry.Widget.Accordion.prototype.openLastPanel = function()
        var panels = this.getPanels();
        if( panels )
            this.openPanel(panels[panels.length-1]);
    Spry.Widget.Accordion.prototype.onPanelClick = function(panel)
        // if (this.enableKeyboardNavigation)
        //     this.element.focus();
        if (panel != this.currentPanel)
            this.openPanel(panel);
        this.focus();
    Spry.Widget.Accordion.prototype.onFocus = function(e)
        // this.element.focus();
        this.hasFocus = true;
        this.addClassName(this.element, this.focusedClass);
    Spry.Widget.Accordion.prototype.onBlur = function(e)
        // this.element.blur();
        this.hasFocus = false;
        this.removeClassName(this.element, this.focusedClass);
    Spry.Widget.Accordion.KEY_UP = 38;
    Spry.Widget.Accordion.KEY_DOWN = 40;
    Spry.Widget.Accordion.prototype.onKeyDown = function(e)
        var key = e.keyCode;
        if (!this.hasFocus || (key != this.previousPanelKeyCode && key != this.nextPanelKeyCode))
            return true;
        var panels = this.getPanels();
        if (!panels || panels.length < 1)
            return false;
        var currentPanel = this.currentPanel ? this.currentPanel : panels[0];
        var nextPanel = (key == this.nextPanelKeyCode) ? currentPanel.nextSibling : currentPanel.previousSibling;
        while (nextPanel)
            if (nextPanel.nodeType == 1 /* Node.ELEMENT_NODE */)
                break;
            nextPanel = (key == this.nextPanelKeyCode) ? nextPanel.nextSibling : nextPanel.previousSibling;
        if (nextPanel && currentPanel != nextPanel)
            this.openPanel(nextPanel);
        if (e.stopPropagation)
            e.stopPropagation();
        if (e.preventDefault)
            e.preventDefault();
        return false;
    Spry.Widget.Accordion.prototype.attachPanelHandlers = function(panel)
        if (!panel)
            return;
        var tab = this.getPanelTab(panel);
        if (tab)
            var self = this;
            Spry.Widget.Accordion.addEventListener(tab, "click", function(e) { return self.onPanelClick(panel); }, false);
            Spry.Widget.Accordion.addEventListener(tab, "mouseover", function(e) { return self.onPanelTabMouseOver(panel); }, false);
            Spry.Widget.Accordion.addEventListener(tab, "mouseout", function(e) { return self.onPanelTabMouseOut(panel); }, false);
    Spry.Widget.Accordion.addEventListener = function(element, eventType, handler, capture)
        try
            if (element.addEventListener)
                element.addEventListener(eventType, handler, capture);
            else if (element.attachEvent)
                element.attachEvent("on" + eventType, handler);
        catch (e) {}
    Spry.Widget.Accordion.prototype.initPanel = function(panel, isDefault)
        var content = this.getPanelContent(panel);
        if (isDefault)
            this.currentPanel = panel;
            this.removeClassName(panel, this.closedClass);
            this.addClassName(panel, this.openClass);
        else
            this.removeClassName(panel, this.openClass);
            this.addClassName(panel, this.closedClass);
            content.style.height = "0px";
        this.attachPanelHandlers(panel);
    Spry.Widget.Accordion.prototype.attachBehaviors = function()
        var panels = this.getPanels();
        for (var i = 0; i < panels.length; i++)
            this.initPanel(panels[i], i == this.defaultPanel);
        if (this.enableKeyboardNavigation)
            // XXX: IE doesn't allow the setting of tabindex dynamically. This means we can't
            // rely on adding the tabindex attribute if it is missing to enable keyboard navigation
            // by default.
            var tabIndexAttr = this.element.attributes.getNamedItem("tabindex");
            // if (!tabIndexAttr) this.element.tabindex = 0;
            if (tabIndexAttr)
                var self = this;
                Spry.Widget.Accordion.addEventListener(this.element, "focus", function(e) { return self.onFocus(e); }, false);
                Spry.Widget.Accordion.addEventListener(this.element, "blur", function(e) { return self.onBlur(e); }, false);
                Spry.Widget.Accordion.addEventListener(this.element, "keydown", function(e) { return self.onKeyDown(e); }, false);
    Spry.Widget.Accordion.prototype.getPanels = function()
        return this.getElementChildren(this.element);
    Spry.Widget.Accordion.prototype.getCurrentPanel = function()
        return this.currentPanel;
    Spry.Widget.Accordion.prototype.getCurrentPanelIndex = function()
        var panels = this.getPanels();
        for( var i = 0 ; i < panels.length; i++ )
            if( this.currentPanel == panels[i] )
                return i;
        return 0;
    Spry.Widget.Accordion.prototype.getPanelTab = function(panel)
        if (!panel)
            return null;
        return this.getElementChildren(panel)[0];
    Spry.Widget.Accordion.prototype.getPanelContent = function(panel)
        if (!panel)
            return null;
        return this.getElementChildren(panel)[1];
    Spry.Widget.Accordion.prototype.getElementChildren = function(element)
        var children = [];
        var child = element.firstChild;
        while (child)
            if (child.nodeType == 1 /* Node.ELEMENT_NODE */)
                children.push(child);
            child = child.nextSibling;
        return children;
    Spry.Widget.Accordion.prototype.focus = function()
        if (this.element && this.element.focus)
            this.element.focus();
    Spry.Widget.Accordion.PanelAnimator = function(accordion, panel, opts)
        this.timer = null;
        this.interval = 0;
        this.stepCount = 0;
        this.fps = 0;
        this.steps = 10;
        this.duration = 500;
        this.onComplete = null;
        this.panel = panel;
        this.panelToOpen = accordion.getElement(panel);
        this.panelData = [];
        Spry.Widget.Accordion.setOptions(this, opts, true);
        // If caller specified speed in terms of frames per second,
        // convert them into steps.
        if (this.fps > 0)
            this.interval = Math.floor(1000 / this.fps);
            this.steps = parseInt((this.duration + (this.interval - 1)) / this.interval);
        else if (this.steps > 0)
            this.interval = this.duration / this.steps;
        // Set up the array of panels we want to animate.
        var panels = accordion.getPanels();
        for (var i = 0; i < panels.length; i++)
            var p = panels[i];
            var c = accordion.getPanelContent(p);
            if (c)
                var h = c.offsetHeight;
                if (h == undefined)
                    h = 0;
                if (p == panel || h > 0)
                    var obj = new Object;
                    obj.panel = p;
                    obj.content = c;
                    obj.fromHeight = h;
                    obj.toHeight = (p == panel) ? (accordion.useFixedPanelHeights ? accordion.fixedPanelHeight : c.scrollHeight) : 0;
                    obj.increment = (obj.toHeight - obj.fromHeight) / this.steps;
                    obj.overflow = c.style.overflow;
                    this.panelData.push(obj);
                    c.style.overflow = "hidden";
                    c.style.height = h + "px";
    Spry.Widget.Accordion.PanelAnimator.prototype.start = function()
        var self = this;
        this.timer = setTimeout(function() { self.stepAnimation(); }, this.interval);
    Spry.Widget.Accordion.PanelAnimator.prototype.stop = function()
        if (this.timer)
            clearTimeout(this.timer);
            // If we're killing the timer, restore the overflow
            // properties on the panels we were animating!
            if (this.stepCount < this.steps)
                for (i = 0; i < this.panelData.length; i++)
                    obj = this.panelData[i];
                    obj.content.style.overflow = obj.overflow;
        this.timer = null;
    Spry.Widget.Accordion.PanelAnimator.prototype.stepAnimation = function()
        ++this.stepCount;
        this.animate();
        if (this.stepCount < this.steps)
            this.start();
        else if (this.onComplete)
            this.onComplete();
    Spry.Widget.Accordion.PanelAnimator.prototype.animate = function()
        var i, obj;
        if (this.stepCount >= this.steps)
            for (i = 0; i < this.panelData.length; i++)
                obj = this.panelData[i];
                if (obj.panel != this.panel)
                    obj.content.style.height = "0px";
                obj.content.style.overflow = obj.overflow;
                obj.content.style.height = obj.toHeight + "px";
        else
            for (i = 0; i < this.panelData.length; i++)
                obj = this.panelData[i];
                obj.fromHeight += obj.increment;
                obj.content.style.height = obj.fromHeight + "px";

    On the bottom of yourpage you have this:
    var Accordion1 = new Spry.Widget.Accordion("Accordion1");
    Change it to this:
    var Accordion1 = new Spry.Widget.Accordion("Accordion1", { useFixedPanelHeights: false, defaultPanel: -1 });
    Ken Ford

  • Java loop question - I think!

    Hello,
    I currently have the below code which opens a file, reads all the contents and prints it. I would like to modify it such that it the searches the file for a particular word e.g. "from" and when it reaches it, it inserts something after it e.g. "me". I think I need to put a nested loop somewhere in my while loop. Can some advise me please?
    Many thanks,
    Aisling.
    void modifyFile (String username)
    String record = null;
    int recCount = 0;
    try {
    FileReader fr = new FileReader("/tmp/Scripts/Script.xml");
    BufferedReader br = new BufferedReader(fr);
    record = new String();
    while ( (record = br.readLine()) != null) {
    recCount++;
    System.out.println(recCount + ": " + record);
    catch (IOException e) {
    // catch possible io errors from readLine()
    System.out.println("Uh oh, got an IOException error!");
    e.printStackTrace();
    }

    I tried the replaceall suggestion but it still does not work. I have included my effort below -
    Any ideas why it wont work?
    My understanding is that the below code reads a file line by line. As long as the line isnt null(i.e. end of file), the contents of the file should be printed and any instances of "from" should be replaced with the variable username. This is then written back to the file. Correct?
    Thanks again,
    Aisling.
    void modifyFile (String username)
    String record = null;
    int recCount = 0;
    try {
    FileReader fr = new FileReader("/tmp/Scripts/Script.xml");
    BufferedReader br = new BufferedReader(fr);
    record = new String();
    while ( (record = br.readLine()) != null) {
    recCount++;
    record.replaceAll("from", username);
    System.out.println(recCount + ": " + record);
    FileWriter fw = new FileWriter ("/tmp/Scripts/Script.xml");
    fw.write(record);
    catch (IOException e) {
    // catch possible io errors from readLine()
    System.out.println("Uh oh, got an IOException error!");
    e.printStackTrace();
    }

  • Newbie question (I think you can answer me)

    Hello.
    I am a newbie about EJB. But I am teacher of a Java course and I have
    introduced EJB to my students. I have said them that EJB is good for big
    applications but, when the application is small, is overkill (I read this in
    several books). But then a student has asked me (I don't know how to
    exppress the sentence in English) "How big has to be the application in
    order to take advantage of EJB?". I mean: EJB is overkill for an application
    with two concurrent users. But, if concurrent users are thousand, it is
    necessary. Where is the limit between two situations? Of course, there is no
    exact limit but it must exist some QUANTITATIVE parameter.
    I had no reply for my student. Good question but no answer. I said that I
    will look for this information.
    I am getting mad looking for this information in Internet. I have seen no
    studies that study such a basic question. Even it has been impossible to
    find "a ballpark estimate". I seen EJB FAQs, pages, books about EJBs, but I
    found nothing. Any information of this kind would help me a lot.
    So, please, can anybody help me?
    Any help would be greatly appreciated.
    Thanks,
    Pau Vic.
    (I sent a former copy of this message to an unrelated thread. This was a
    mistake. Please excuse the inconveniences)

    Thank you, Ji.
    Pau Vic.
    "ji zhang" <[email protected]> escribió en el mensaje
    news:[email protected]...
    >
    Hi Pau.
    How big has to be the application in order to take advantage of EJB?There is no measurement standard for developers to decide the utilizationof EJB
    in their applications. It is clearly unnecessary to develop a nonenterprise application
    for only few ( as you mentioned 2 ) routing users with EJBs.
    The question is more likely why using EJBs. Few major considerationslisted below:
    >
    1) A real production internet application is getting to rely on anapplication
    container ( for example: #1 application server WebLogic ) to handleunderly resources,
    backend works and Object life cycles.
    By using EJBs, EJB container handles the sophisticate backend jobs foryou.
    Developers may only focus on their business logics.
    2) A real production internet application may be also a combination ofsome reusable
    logical components. To reduce the application development hardness,modeled and
    specification oriented plugable components such as EJBs may be used. Thatis also
    why the EJB component vendors exist.
    3) There are concepts of scalability and high availability in realproduction.
    EJB components can be easily deployed to be scaled and load balanced inthe EJB
    containers in a cluster. Fully implemented Weblogic Cluster is a goodexample.
    >
    There may be other advantages of using EJB as well.
    Thanks.
    Ji Zhang
    Developer Relations Engineer
    BEA WebLogic Support
    "Pau Vic" <[email protected]> wrote:
    Hello.
    I am a newbie about EJB. But I am teacher of a Java course and I have
    introduced EJB to my students. I have said them that EJB is good for
    big
    applications but, when the application is small, is overkill (I read
    this in
    several books). But then a student has asked me (I don't know how to
    exppress the sentence in English) "How big has to be the application
    in
    order to take advantage of EJB?". I mean: EJB is overkill for an
    application
    with two concurrent users. But, if concurrent users are thousand, it
    is
    necessary. Where is the limit between two situations? Of course, there
    is no
    exact limit but it must exist some QUANTITATIVE parameter.
    I had no reply for my student. Good question but no answer. I said that
    I
    will look for this information.
    I am getting mad looking for this information in Internet. I have seen
    no
    studies that study such a basic question. Even it has been impossible
    to
    find "a ballpark estimate". I seen EJB FAQs, pages, books about EJBs,
    but I
    found nothing. Any information of this kind would help me a lot.
    So, please, can anybody help me?
    Any help would be greatly appreciated.
    Thanks,
    Pau Vic.
    (I sent a former copy of this message to an unrelated thread. This was
    a
    mistake. Please excuse the inconveniences)

Maybe you are looking for

  • CK11n Costing Run does not pull purchasing price from info record.

    Hi, I have material which is a semi finished product (Material type: SEMI) and is purchased from a fixed vendor (specified in the source list). The costing run does not pick up the purchasing price from the purchasing info record but instead incorrec

  • Problem with Droid 4 (4Glte) producing static

    Recently got a Motorola Droid 4.   Phone causes intermittent static buzzing on PC speakers and clock radio whenever within about 3 ft.  Buzzing happens about every 30 sec and lasts about 10 sec.  Happens when phone is not being used. Not related to B

  • Need java help urgent plzzz

    Ive never visited a Java forum other than this one and its been over 2 years now. Out of curiosity I just went to JavaRanch. Ive seen a lot of heated flaming from both sides (on these forums) but i figured id take a look today. The FIRST post i look

  • Sharing with my family

    I have 5 family members all with their own apple computers and all with their own itunes accounts. I would like to know how I can easily share music my wife and I have already bought under our Itunes accounts.  Is there a better way to share for the

  • Bought Photoshop CC and Lightroom 5 but not able to download

    bought Photoshop CC and Lightroom 5 but not able to download. while the creative cloud kept update of Photoshop CC but I'm unable to open it.