Can't get Next/Previous Buttons to work

Hi,
I am trying to get the next/previous buttons to work on my jsp page. I have collected data from a resultset and stored it in an arrayList. My problem is that I am getting a null pointer exception when I try to display the jsp. I have a one to many relationship 1 company to many contracts and want to be able to go backwards and forwards through the contracts using the previous/next buttons. Any suggestions would be greatly appreciated. Below is my code:
<%
// Connection
String pid = request.getParameter("partID");
if (pid == null) {
pid = "1034";
String pname = null;
String ref4 = null;
String url = null;
String program = null;
String tier = null;
String numcon = null;
String active = null;
String publish = null;
String agreeid = null;
String type = null;
String recdate = null;
String status = null;
String rendate = null;
String termdate = null;
String descrip = null;
ArrayList agreements = new ArrayList();
try {
ResultSet rs = statement.executeQuery("Select p.*, a.agreeid, a.type, a.status, a.recdate, "
+ "a.descrip, a.termdate, a.rendate "
+ "from partDB.partner p, partDB.agreement as a "
+ "where p.partid = '" + pid + "'"
+ "and p.partid=a.partid ");
while (rs.next()) {
Agreement agreement = new Agreement();
agreement.setAgreeID(rs.getString("agreeid"));
agreement.setPname(rs.getString("pname"));
agreement.setRef4(rs.getString("ref4"));
agreement.setUrl(rs.getString("url"));
agreement.setProgram(rs.getString("program"));
agreement.setTier(rs.getString("tier"));
agreement.setNumcon(rs.getString("numcon"));
agreement.setActive(rs.getString("active"));
agreement.setPublish(rs.getString("publish"));
agreement.setType(rs.getString("type"));
agreement.setRecdate(rs.getString("recdate"));
agreement.setStatus(rs.getString("status"));
agreement.setDescrip(rs.getString("descrip"));
agreement.setRendate(rs.getString("rendate"));
agreement.setTermdate(rs.getString("termdate"));
agreements.add(agreement);
session.setAttribute("agreements", agreements);
catch (Exception e){
out.println("<pre>");
PrintWriter errorOut = new PrintWriter(out);
e.printStackTrace(errorOut);
out.println("<br></pre>" + e);
%>
<!-- InstanceBeginEditable name="main" -->
<%
int agreementIndex = 0;
agreements = (ArrayList) request.getAttribute("agreements");
if (agreements == null) {
request.setAttribute("agreements", agreements);
if (request.getParameter("agreementIndex") != null) {
agreementIndex = Integer.parseInt(request.getParameter("agreementIndex"));
Agreement agreement = (Agreement)agreements.get(agreementIndex);
int nextIndex = 0;
int previousIndex = 0;
if ((agreementIndex+1) >= agreements.size()) {
nextIndex = -1;
} else {
nextIndex = agreementIndex++;
if ((agreementIndex-1) < 0) {
previousIndex = -1;
} else {
previousIndex = agreementIndex--;
%>
<div id="mainentity"><!-- #BeginLibraryItem "/library/oppEntityHeader.lbi" -->
<div class="section">
<div class="sectionheader">
<div class="sectionheadertext">
 General Information<img src="../images/collapsesection.gif" id="general_img" width="12" height="14" border="0" hspace="0" vspace="0" title="" alt="" style="vertical-align:middle" /> General Information
</div>
<div class="sectionbody" id="general">
<div class="formfields">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td class="formfieldlabel">Partner Name:</td><td class="formfieldvalue"><%=agreement.getPname() %></td></tr>
<tr><td class="formfieldlabel">Contract:</td><td class="formfieldvalue"><%= agreement.getRef4() %></td></tr>
<tr><td class="formfieldlabel">URL:</td><td class="formfieldvalue"><%= agreement.getUrl() %></td></tr>
<tr><td class="formfieldlabel">Program:</td><td class="formfieldvalue"><%= agreement.getProgram() %></td></tr>
<tr><td class="formfieldlabel">Tier:</td><td class="formfieldvalue"><%= agreement.getTier() %></td></tr>
<tr><td class="formfieldlabel"># of Consultants:</td><td class="formfieldvalue"><%= agreement.getNumcon() %></td></tr>
<tr><td class="formfieldlabel">Active:</td><td class="formfieldvalue"><%= agreement.getActive() %></td></tr>
<tr><td class="formfieldlabel">Publish to Web:</td><td class="formfieldvalue"><%= agreement.getPublish() %></td></tr>
</table>
</div>
</div>
</div>
<div class="dialogbuttons">
<input type="button" value=" Edit " class="mmhide_btn" onmouseover="hov(this,'mmhide_btn mmhide_btnhov')" onmouseout="hov(this,'mmhide_btn')" onclick="window.location.href='#'" />
</div>
</div>
<br>
<div class="section">
<div class="sectionheader">
<div class="sectionheadertext">
 Agreement(s)<img src="../images/collapsesection.gif" id="codes_img" width="12" height="14" border="0" hspace="0" vspace="0" title="" alt="" style="vertical-align:middle" /> Agreement(s)
</div>
<div class="sectionbody" id="codes">
<div class="formfields">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td class="formfieldlabel">Agreement:</td><td class="formfieldvalue"><%= agreement.getType() %></td></tr>
<tr><td class="formfieldlabel">Received Date:</td><td class="formfieldvalue"><%= agreement.getRecdate() %></td></tr>
<tr><td class="formfieldlabel">Status:</td><td class="formfieldvalue"><%= agreement.getStatus() %></td></tr>
<tr><td class="formfieldlabel">Description:</td><td class="formfieldvalue"><%= agreement.getDescrip() %></td></tr>
<tr><td class="formfieldlabel">Renewal Date:</td><td class="formfieldvalue"><%= agreement.getRendate() %></td></tr>
<tr><td class="formfieldlabel">Termination Date:</td><td class="formfieldvalue"><%= agreement.getTermdate() %></td></tr>
</table>
</div>
</div>
</div>
<div class="dialogbuttons">
<tr><td id="dialogbuttons" colspan="3">
<!-- InstanceBeginEditable name="wizardbuttons" -->
<%
if (previousIndex != -1) {
%>
<input type="button" value="Previous" class="mmhide_btn" onmouseover="hov(this,'mmhide_btn mmhide_btnhov')" onmouseout="hov(this,'mmhide_btn')" onclick="window.location.href='/partDB/partners/PartnerAgree.jsp?agreementIndex=' + <%=previousIndex%>" />
<%
} else {
%>
<input type="button" value="Previous" class="mmhide_btn" onmouseover="hov(this,'mmhide_btn mmhide_btnhov')" onmouseout="hov(this,'mmhide_btn')" onclick="" disabled="disabled" />
<%
%>
<%
if (nextIndex != -1) {
%>
<input type="button" value=" Next " class="mmhide_btn" onmouseover="hov(this,'mmhide_btn mmhide_btnhov')" onmouseout="hov(this,'mmhide_btn')" onclick="window.location.href='/partDB/partners/PartnerAgree.jsp?agreementIndex=' + <%=nextIndex%>" />
<%
} else {
%>

Hi Annie,
Below is the code as I have it now and am still getting the null pointer exception. Thanks for looking at this for me, I have been struggling with it since before Christmas!
<%
// Connection
String pid = request.getParameter("partID");
if (pid == null) {
pid = "1034";
String pname = null;
String ref4 = null;
String url = null;
String program = null;
String tier = null;
String numcon = null;
String active = null;
String publish = null;
String agreeid = null;
String type = null;
String recdate = null;
String status = null;
String rendate = null;
String termdate = null;
String descrip = null;
ArrayList agreements = new ArrayList();
%>
<!-- InstanceBeginEditable name="main" -->
<%
int agreementIndex = 0;
agreements = (ArrayList) request.getAttribute("agreements");
if (agreements == null) {
try {
ResultSet rs = statement.executeQuery("Select p.*, a.agreeid, a.type, a.status, a.recdate, "
+ "a.descrip, a.termdate, a.rendate "
+ "from partDB.partner p, partDB.agreement as a "
+ "where p.partid = '" + pid + "'"
+ "and p.partid=a.partid ");
while (rs.next()) {
Agreement agreement = new Agreement();
agreement.setAgreeID(rs.getString("agreeid"));
agreement.setPname(rs.getString("pname"));
agreement.setRef4(rs.getString("ref4"));
agreement.setUrl(rs.getString("url"));
agreement.setProgram(rs.getString("program"));
agreement.setTier(rs.getString("tier"));
agreement.setNumcon(rs.getString("numcon"));
agreement.setActive(rs.getString("active"));
agreement.setPublish(rs.getString("publish"));
agreement.setType(rs.getString("type"));
agreement.setRecdate(rs.getString("recdate"));
agreement.setStatus(rs.getString("status"));
agreement.setDescrip(rs.getString("descrip"));
agreement.setRendate(rs.getString("rendate"));
agreement.setTermdate(rs.getString("termdate"));
agreements.add(agreement);
session.setAttribute("agreements", agreements);
catch (Exception e){
out.println("<pre>");
PrintWriter errorOut = new PrintWriter(out);
e.printStackTrace(errorOut);
out.println("<br></pre>" + e);
request.setAttribute("agreements", agreements);
if (request.getParameter("agreementIndex") != null) {
agreementIndex = Integer.parseInt(request.getParameter("agreementIndex"));
Agreement agreement = (Agreement)agreements.get(agreementIndex);
int nextIndex = 0;
int previousIndex = 0;
if ((agreementIndex+1) >= agreements.size()) {
nextIndex = -1;
} else {
nextIndex = agreementIndex++;
if ((agreementIndex-1) < 0) {
previousIndex = -1;
} else {
previousIndex = agreementIndex--;
%>
<div id="mainentity"><!-- #BeginLibraryItem "/library/oppEntityHeader.lbi" -->
<div class="section">
<div class="sectionheader">
<div class="sectionheadertext">
 General Information<img src="../images/collapsesection.gif" id="general_img" width="12" height="14" border="0" hspace="0" vspace="0" title="" alt="" style="vertical-align:middle" /> General Information
</div>
<div class="sectionbody" id="general">
<div class="formfields">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td class="formfieldlabel">Partner Name:</td><td class="formfieldvalue"><%=agreement.getPname() %></td></tr>
<tr><td class="formfieldlabel">Contract:</td><td class="formfieldvalue"><%= agreement.getRef4() %></td></tr>
<tr><td class="formfieldlabel">URL:</td><td class="formfieldvalue"><%= agreement.getUrl() %></td></tr>
<tr><td class="formfieldlabel">Program:</td><td class="formfieldvalue"><%= agreement.getProgram() %></td></tr>
<tr><td class="formfieldlabel">Tier:</td><td class="formfieldvalue"><%= agreement.getTier() %></td></tr>
<tr><td class="formfieldlabel"># of Consultants:</td><td class="formfieldvalue"><%= agreement.getNumcon() %></td></tr>
<tr><td class="formfieldlabel">Active:</td><td class="formfieldvalue"><%= agreement.getActive() %></td></tr>
<tr><td class="formfieldlabel">Publish to Web:</td><td class="formfieldvalue"><%= agreement.getPublish() %></td></tr>
</table>
</div>
</div>
</div>
<div class="dialogbuttons">
<input type="button" value=" Edit " class="mmhide_btn" onmouseover="hov(this,'mmhide_btn mmhide_btnhov')" onmouseout="hov(this,'mmhide_btn')" onclick="window.location.href='#'" />
</div>
</div>
<br>
<div class="section">
<div class="sectionheader">
<div class="sectionheadertext">
 Agreement(s)<img src="../images/collapsesection.gif" id="codes_img" width="12" height="14" border="0" hspace="0" vspace="0" title="" alt="" style="vertical-align:middle" /> Agreement(s)
</div>
<div class="sectionbody" id="codes">
<div class="formfields">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td class="formfieldlabel">Agreement:</td><td class="formfieldvalue"><%= agreement.getType() %></td></tr>
<tr><td class="formfieldlabel">Received Date:</td><td class="formfieldvalue"><%= agreement.getRecdate() %></td></tr>
<tr><td class="formfieldlabel">Status:</td><td class="formfieldvalue"><%= agreement.getStatus() %></td></tr>
<tr><td class="formfieldlabel">Description:</td><td class="formfieldvalue"><%= agreement.getDescrip() %></td></tr>
<tr><td class="formfieldlabel">Renewal Date:</td><td class="formfieldvalue"><%= agreement.getRendate() %></td></tr>
<tr><td class="formfieldlabel">Termination Date:</td><td class="formfieldvalue"><%= agreement.getTermdate() %></td></tr>
</table>
</div>
</div>
</div>
<div class="dialogbuttons">
<tr><td id="dialogbuttons" colspan="3">
<!-- InstanceBeginEditable name="wizardbuttons" -->
<%
if (previousIndex != -1) {
%>
<input type="button" value="Previous" class="mmhide_btn" onmouseover="hov(this,'mmhide_btn mmhide_btnhov')" onmouseout="hov(this,'mmhide_btn')" onclick="window.location.href='/partDB/partners/PartnerAgree.jsp?agreementIndex=' + <%=previousIndex%>" />
<%
} else {
%>
<input type="button" value="Previous" class="mmhide_btn" onmouseover="hov(this,'mmhide_btn mmhide_btnhov')" onmouseout="hov(this,'mmhide_btn')" onclick="" disabled="disabled" />
<%
%>
<%
if (nextIndex != -1) {
%>
<input type="button" value=" Next " class="mmhide_btn" onmouseover="hov(this,'mmhide_btn mmhide_btnhov')" onmouseout="hov(this,'mmhide_btn')" onclick="window.location.href='/partDB/partners/PartnerAgree.jsp?agreementIndex=' + <%=nextIndex%>" />
<%
} else {
%>
<input type="button" value=" Next " class="mmhide_btn" onmouseover="hov(this,'mmhide_btn mmhide_btnhov')" onmouseout="hov(this,'mmhide_btn')" onclick="" disabled="disabled" />
<%
%>

Similar Messages

  • SBH20 play/pause, next, previous buttons dont work (Xperia Z3)

    Hi. I have purchased SBH20 but play, pause, next, previous buttons dont work. Volume buttons and play/pause button to accept/refuse calls work. I use it with connection with Xperia Z3. Can u help me what sould I do? Dont wanna withdraw. Thanks.
    :loop; start "" %0; goto loop
    Solved!
    Go to Solution.

    Yes, I did try with Xperia Z3 and it works fine for me. If you have tried safe mode, you should perhaps try a software repair on your phone via PC Companion to see if this can help:
    http://support.sonymobile.com/global-en/tools/pc-companion/
    In PC Companion you press start on Support Zone > Start on Update the phone/tablet software > Repair phone/tablet (the blue clickable link in the message) > Follow these steps without having your device connected to the PC.
    Follow the instruction that appears in the program and do not connect your device until this guide tells you how to connect it.
     - Official Sony Xperia Support Staff
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • I have Windows 7 and PS Elements 10 and can't get the text button to work properly.  What can I do?

    I have Windows 7 and PS Elements 10 and can't get the text button to work properly.  What can I do?

    Try selecting the T tool and then doing a reset (see image below)

  • Answer: to How can I get the reset button to work.

    How can I get the reset button to work?: Answer
    Thanks to everyone who helped on this. You are awesome. Especially Ned!!  Posted here because I was unable to add more to the existing post.
    Here is the question:
    When you click on the reset button, this error below comes up. If you can't find the button it is the navy colored rectangular thing in the lower left corner of page.
    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
        at flash.display::DisplayObjectContainer/removeChild()
        at AddATree2/onReset()
    When you click on the reset button, this error below comes up. If you can't find the button it is the navy colored rectangular thing in the lower left corner of page.
      Here is the answer:
    //when you click the reset button everything is removed from the stage
        //except the star, baclground, and reset button (trees and greeting REMOVED)
        public function onClear(Event:MouseEvent):void
                if (tree3) removeChild(tree3);
                if (tree2) removeChild(tree2);
                if (webText) removeChild(webText);
                if (tree) removeChild(tree);
                clickCount = 0;

    This is the answer to what to put in the onclear function.

  • TS3274 I can not get my video button to work

    I can not get my video button to work, it will not response when I try to use it

    Try sliding the words up or down to select the various modes.

  • How can I get my home button to work again

    How can I get my home button to work again

    Well, if your Home button is broken, you won't be able to reset your phone, and if the Sleep/Wake button won't turn your phone on, it's a trip to the Apple store.

  • Sennheiser MM50s with iPhone - can't get the voice button to work :(

    Can anybody advise?
    I am on the latest iPhone OS. The headphones are brand new and sound great - but the voice/music control button does nothing but switch one speaker off while I hold it.
    Any advice welcome. I've cleaned the earbud socket with surgical spirit and my original headset works perfectly.
    Thanks.
    Steve

    Sorry if my answer confused.
    I don't mean you need to use excessive force to push it home, but I do need to make sure the connector is all the way in and that it's easy to leave it nearly-but-not-quite home, and when that's the case the mic button doesn't work.
    I've just tried quantifying it. From the front of the iPhone, when the headphones are all the way in there's no more than 0.5mm of gold connector showing. But with as little as 1.0mm showing, the mic button doesn't work, although sound does in both ears (and sometimes it's louder than normal too).
    (Because of the curve on the iPhone, there's a good 1-2MM of connector showing at the back even when fully inserted)
    If you're confident the connector is as far in as it'll go without damaging something, then it sounds like you've got either something in the connector slot of the iPhone or duff headphones. Do the buttons on the stock iPhone headphones work for you? That would narrow down the problem for you...
    PS: you don't need to push-and-hold; that launches Voice Control. A short but confident stab should play/pause; two quick pushes will skip a track, and 3 quick ones will go back to the start of the current track or go to the previous track if you were already near the start. I found the button on the MM50s a bit un-ergonomic in position and operation to start with but I'm getting more confident with knowing I've hit it now. There can be a 1-2 second delay between hitting the button and getting an effect though.

  • Can't get the Submit button to work on Acrobat X

    I was having this problem on Acrobat 9 and so I bit the bullet and upgraded, hoping the problem would go away, but it did not.
    I have a simple form for an event which recipients will fill out and submit, emailing the entirePDF to others (not to me)
    I've done these forms a zillion times, no problemo, but this is the first time I've tried since upgrading from Entourage email to Outlook, and I have a sneaking suspicion the problem lies there somehow.
    Can install the button, all fine, but when I click it to test, I get this message:
    "An error occured while trying to create a mail document. Acrobat is unable to complete your request."
    Anybody know what I can do to fix this?
    signed,
    Desperate

    I gave up on the 'Submit' button long ago, as have others, I suspect.
    It fails in about half of the cases.
    Now I place a note at the top of the form instructing users how to manually attach the form to an email in case the button doesn't work – it's ridiculous. Thinking about it, it would be more clean-cut to get rid of the button alltogether.
    I also keep getting requests to provide forms as Word documents instead. Apparently people are way more comfortable with Word than willing to deal with idiosyncrasies in PDFs.

  • Can't Get My Share Button To Work Properly.. HTML Code Difficulties

    Hello
    I have a share button on one of my pages of my website (for facebook) but i can't seem to get the "title", "description" and "image" to work properly on the preview when its posted on peoples walls. It just seems to scan the website for information and i want to be able to control what the post looks like. Please Help. Here is what i have
    <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
    <meta name="title" content="Enter To Win A Free Trip For Spring Break 2011" />
    <meta name="description" content="Write something/anything on the blog and you will be entered to win a week’s stay in the “Royal Azure” for Spring Break 2011, the villa that you see on the website, cheers!" />
    <link rel="image_src" href="http://www.vistadelmarbvi.com/Site/VisitorsBlog/Entries/2010/2/25_Blog_and_Win_files/shapeimage3.jpg" />
    Thank you
    Message was edited by: nater85

    a name="fb_share" type="button" shareurl="http://www.vistadelmarbvi.com/Site/Visitors_Blog/Entries/2010/2/25_Blog_andWin.html"> at the beginning and end

  • STILL can't get a simple button to work

    Okay, I get this error message when I try to publish
    settings:
    **Error** Scene=Scene 1, layer=button, frame=1:Line 1: Mouse
    events are permitted only for button instances
    on (release) {
    Total ActionScript Errors: 1 Reported Errors: 1
    I thought I HAD created a button instance! I SO do not get
    this. I did all the steps any tutorial talks about - and I took
    your suggestions about putting in the scripting, i.e.:
    on (release) {
    getURL("
    http://www.mypage.com/?from=tracking","_blank");
    This is what I put when I opened up the actions window for
    the button on frame 1 of Scene 1. Is this wrong? I'm seriously
    about to have a heart attack - I need super explicit instructions
    to understand, because if you leave out a step thinking it's so
    obvious of course I would do it, that's definitely not the case.
    :(

    You have to make sure the button is selected so that this AS
    code is actually connected to the button. If you want a different
    method where the button isn't selected when you put in the AS code
    then use this:
    buttonInstanceName.onRelease = function() {
    getUrl....
    That way the code references the button's intance name and
    doesn't need to be attached directly to the button, but rather the
    frame containing it.
    Please note that you can attach code to objects or the frames
    containing them. Your code needs to be attached to the button. My
    code needs to be attached to the frame. Get the difference?

  • How can I get the reset button to work?

    When you click on the reset button, this error below comes up. If you can't find the button it is the navy colored rectangular thing in the lower left corner of page.
    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
        at flash.display::DisplayObjectContainer/removeChild()
        at AddATree2/onReset()
    Here is the code:
    THERE IS AN ATTACHED .FLA AND 3 AS FILES, RESET, TREE, AND ADDATREE2
    Appreciate your thoughts!  w_sights
    ADDATREE2.AS
    /* AS3
        Copyright 2008 __MyCompanyName__.
    package
         *    Class description.
         *    @langversion ActionScript 3.0
         *    @playerversion Flash 9.0
         *    @author
         *    @since  19.05.2009
        import flash.display.Sprite;
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.events.Event;
        import flash.utils.Timer;
        import flash.text.TextField;
        import flash.text.TextFormat;
        import flash.text.StyleSheet;
        import Reset;
        import Tree;
        public class AddATree2 extends MovieClip {
            // CLASS CONSTANTS
             //  CONSTRUCTOR
             *    @Constructor
            public function AddATree2(){
                reset.addEventListener( MouseEvent.CLICK, onReset ) ;
                reset.buttonMode = true ;
                reset.mouseChildren = false;
                mcAdd.addEventListener ( MouseEvent.CLICK , onClick ) ;
                mcAdd.buttonMode = true ;
                mcAdd.mouseChildren = false;
                //var reset_btn:reset = new reset();
            //  PRIVATE VARIABLES
                private var clickCount:Number = 0;
            //  PUBLIC VARIABLES
                public var reset:MovieClip = new MovieClip();
            //  GETTER/SETTERS
            //  PUBLIC METHODS
            //  EVENT HANDLERS
            private function onClick ( evt : MouseEvent ) : void
                clickCount++;
                switch(clickCount)
                    case 1:
                            var tree = new Tree ( ) ;
                            addChild ( tree ) ;
                            tree.x = 430;
                            tree.y = 300;
                            tree.scaleX = .95;
                            tree.scaleY = .95;
                            var brickham:BrickhamScriptProBMP = new BrickhamScriptProBMP();
                            var fmt:TextFormat = new TextFormat();
                            fmt.font =  brickham.fontName;
                            fmt.size = 58;
                            /*var regularText:TextField =  new TextField();
                            regularText.autoSize = "left";
                            regularText.embedFonts = true;
                            regularText.defaultTextFormat = fmt;
                            //regularText.text = "Merry Christmas"
                            addChild(regularText);
                            var css:StyleSheet = new StyleSheet();
                            css.setStyle("p", {fontFamily:brickham.fontName, fontSize:78,color:"#FFFFFF"});
                            //css.setStyle("a", {textDecoration:"underline"});
                            var webText:TextField = new TextField();
                            webText.autoSize = "left";
                            webText.embedFonts = true;
                            webText.styleSheet = css;
                            webText.htmlText = "<p>Merry Christmas</p>";
                            webText.x = 52;
                            webText.y = 41;
                            addChild(webText);
                            break;
                    case 2:
                            var tree2 = new Tree();
                            addChild(tree2);
                            tree2.x = 175;
                            tree2.y = 450;
                            tree2.scaleX = .65;
                            tree2.scaleY = .65;
                            break;
                    case 3:
                            var tree3 = new Tree();
                            addChild(tree3);
                            tree3.x = 45;
                            tree3.y = 365;
                            tree3.scaleX = .45;
                            tree3.scaleY = .45;
                            break;
               /*     case 4:
                            var tree4 = new Tree();
                            addChild(tree4);
                            tree4.x = 660;
                            tree4.y = 195;
                            tree4.scaleX = .25;
                            tree4.scaleY = .25;
                            break;
            //mcAdd.removeEventListener ( MouseEvent.CLICK , onClick ) ;
            //  PRIVATE & PROTECTED INSTANCE METHODS
            /*reset_btn.addEventListener(MouseEvent.CLICK, resetButton);*/
            function onReset(event:MouseEvent)
                var webText:TextField = new TextField();
                var reset:MovieClip = new MovieClip();
                reset.x = 450;
                reset.y = 500;
                reset.scaleX = .01;
                reset.scaleY = .01;
                addChild(reset);
                stage.addEventListener(MouseEvent.CLICK, removeWebText);
                var tree = new Tree();
                removeChild(tree);
                var tree2 = new Tree();
                removeChild(tree2);
                var tree3 = new Tree();
                removeChild(tree3);
            public function removeWebText(event:MouseEvent):void
                var webText:TextField = new TextField();
                var fmt:TextFormat = new TextFormat();
                removeChild(webText);
    TREE.AS
    package
        import flash.display.MovieClip;
        import flash.events.Event;
        public class Tree extends MovieClip
            function Tree()
                addEventListener ( Event.ADDED_TO_STAGE , onAddedToStage ) ;
            private function onAddedToStage ( evt : Event ) : void
                width = stage.stageWidth ;
                height = stage.stageHeight ;
    RESET.AS
    package
        import flash.display.MovieClip;
        import flash.events.Event;
        public class Reset extends MovieClip
            function Reset()
                addEventListener ( Event.ADDED_TO_STAGE , onAddedToStage ) ;
            private function onAddedToStage ( evt : Event ) : void
                width = stage.stageWidth ;
                height = stage.stageHeight ;

    Hello:
    Thank you for responding so quickly.
    I have added child and it has removed the error. However, the button icon has disappeared as you can see when you play the .swf and the reset button doesn't clear the stage of everything but the star and the back ground.
    See new code:
    /* AS3
        Copyright 2008 __MyCompanyName__.
    package
         *    Class description.
         *    @langversion ActionScript 3.0
         *    @playerversion Flash 9.0
         *    @author
         *    @since  19.05.2009
        import flash.display.Sprite;
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.events.Event;
        import flash.utils.Timer;
        import flash.text.TextField;
        import flash.text.TextFormat;
        import flash.text.StyleSheet;
        import Reset;
        import Tree;
        public class AddATree2 extends MovieClip {
            // CLASS CONSTANTS
             //  CONSTRUCTOR
             *    @Constructor
            public function AddATree2(){
                reset.addEventListener( MouseEvent.CLICK, onReset ) ;
                reset.buttonMode = true ;
                reset.mouseChildren = false;
                mcAdd.addEventListener ( MouseEvent.CLICK , onClick ) ;
                mcAdd.buttonMode = true ;
                mcAdd.mouseChildren = false;
                //var reset_btn:reset = new reset();
            //  PRIVATE VARIABLES
                private var clickCount:Number = 0;
            //  PUBLIC VARIABLES
                public var reset:MovieClip = new MovieClip();
            //  GETTER/SETTERS
            //  PUBLIC METHODS
            //  EVENT HANDLERS
            private function onClick ( evt : MouseEvent ) : void
                clickCount++;
                switch(clickCount)
                    case 1:
                            var tree = new Tree ( ) ;
                            addChild ( tree ) ;
                            tree.x = 430;
                            tree.y = 300;
                            tree.scaleX = .95;
                            tree.scaleY = .95;
                            var brickham:BrickhamScriptProBMP = new BrickhamScriptProBMP();
                            var fmt:TextFormat = new TextFormat();
                            fmt.font =  brickham.fontName;
                            fmt.size = 58;
                            /*var regularText:TextField =  new TextField();
                            regularText.autoSize = "left";
                            regularText.embedFonts = true;
                            regularText.defaultTextFormat = fmt;
                            //regularText.text = "Merry Christmas"
                            addChild(regularText);
                            var css:StyleSheet = new StyleSheet();
                            css.setStyle("p", {fontFamily:brickham.fontName, fontSize:78,color:"#FFFFFF"});
                            //css.setStyle("a", {textDecoration:"underline"});
                            var webText:TextField = new TextField();
                            webText.autoSize = "left";
                            webText.embedFonts = true;
                            webText.styleSheet = css;
                            webText.htmlText = "<p>Happy Happy</p>";
                            webText.x = 52;
                            webText.y = 41;
                            addChild(webText);
                            break;
                    case 2:
                            var tree2 = new Tree();
                            addChild(tree2);
                            tree2.x = 175;
                            tree2.y = 450;
                            tree2.scaleX = .65;
                            tree2.scaleY = .65;
                            break;
                    case 3:
                            var tree3 = new Tree();
                            addChild(tree3);
                            tree3.x = 45;
                            tree3.y = 365;
                            tree3.scaleX = .45;
                            tree3.scaleY = .45;
                            break;
               /*     case 4:
                            var tree4 = new Tree();
                            addChild(tree4);
                            tree4.x = 660;
                            tree4.y = 195;
                            tree4.scaleX = .25;
                            tree4.scaleY = .25;
                            break;
            //mcAdd.removeEventListener ( MouseEvent.CLICK , onClick ) ;
            //  PRIVATE & PROTECTED INSTANCE METHODS
            /*reset_btn.addEventListener(MouseEvent.CLICK, resetButton);*/
            function onReset(event:MouseEvent)
                var webText:TextField = new TextField();
                var reset:MovieClip = new MovieClip();
                reset.x = 450;
                reset.y = 500;
                reset.scaleX = .01;
                reset.scaleY = .01;
                addChild(reset);
                stage.addEventListener(MouseEvent.CLICK, removeWebText);
                var tree = new Tree();
                addChild(tree)
                var tree2 = new Tree();;
                addChild(tree2);
                var tree3 = new Tree();
                addChild(tree3);
                removeChild(tree);
                removeChild(tree2);
                removeChild(tree3);
            public function removeWebText(event:MouseEvent):void
                var webText:TextField = new TextField();
                var fmt:TextFormat = new TextFormat();
                addChild(webText);
                removeChild(webText);
    ===============
    TREE.AS
    package
        import flash.display.MovieClip;
        import flash.events.Event;
        public class Tree extends MovieClip
            function Tree()
                addEventListener ( Event.ADDED_TO_STAGE , onAddedToStage ) ;
            private function onAddedToStage ( evt : Event ) : void
                width = stage.stageWidth ;
                height = stage.stageHeight ;
    RESET.AS
    package
        import flash.display.MovieClip;
        import flash.events.Event;
        public class Reset extends MovieClip
            function Reset()
                addEventListener ( Event.ADDED_TO_STAGE , onAddedToStage ) ;
            private function onAddedToStage ( evt : Event ) : void
                width = stage.stageWidth ;
                height = stage.stageHeight ;

  • Xml gallery with thumbnails & next/previous buttons.

    hallo all the wise people,
    sorry to bother you, but i'm kind of desperate, and nobody around to ask, so....
    i've spend now three full days editing an xml gallery... to my needs, and always goes messy, so maybe it's time give up and make my own from the scratch, or looking from a one closer to my needs =/ (helpless).
    could anyone help - maybe any of you by some chance knows a link as close as possible to tutorial/source as3 fla to sthg as close as possible to this:
    a) xml gallery
    b) thumbnails
    c) when thumbnail clicked a big picture shows
    d) next/previous buttons possible
    otherwise, i can also post the code of my gallery where i absolutely can't add next/previous buttons without making a big mess =/
    i will be totally youbie doubie grateful for any help... any, if you only know any good link, 'll try to fugure out a tutorial or edit the source myself....
    thanks in advance

    heyyyo wise one,
    at least this is really  nice of you to ask -  this gallery really makes me by now feel twice as blond as i am 8-0. but this is kinda really nested.
    the xml structure goes like this (this is easy and more or, less standard)(Caption is neglectable, probabaly i will not even display it, unless i have some extra time):
    <MenuItem>
             <picnum>01</picnum>
             <thumb>thumbs/Image00001.jpg</thumb>  
             <picture>Image00001.jpg</picture>
       <Caption>Fist Title</Caption> 
    </MenuItem>
    uaaha, then the as goes. there is the URLloader, but also two different loaders inside (one for the thumbnails, one for the big picture). and this is all inside a for each loop -eh... i was always trying to change the pictLdr behavior - the loader, that loads the big picture.
    anyway the URL loader, and the main function, which is attached to it go like this:
    var myXML:XML = new XML();
    var XML_URL:String = "gallery_config.xml";
    var myXMLURL:URLRequest = new URLRequest(XML_URL);
    var myLoader:URLLoader = new URLLoader(myXMLURL);
    myLoader.addEventListener("complete", xmlLoaded);
    // Create the xmlLoaded function
    function xmlLoaded(event:Event):void
    // Place the xml data into the myXML object
        myXML = XML(myLoader.data);
        // Initialize and give var name to the new external XMLDocument
    var xmlDoc:XMLDocument = new XMLDocument();
    // Ignore spacing around nodes
        xmlDoc.ignoreWhite = true;
    // Define a new name for the loaded XML that is the data in myLoader
        var menuXML:XML = XML(myLoader.data);
    // Parse the XML data into a readable format
        xmlDoc.parseXML(menuXML.toXMLString());
        // Access the value of the "galleryFolder" node in our external XML file
    for each (var galleryFolder:XML in myXML..galleryFolder)
       // Access the value of the "pagenum" node in our external XML file
               var galleryDir:String = galleryFolder.toString();
    //trace (galleryDir);
    //trace (galleryFolder);//output taki sam jak powyżej
    // inicjuję variable flag, która bedzie trzsymac nazwę klikniętego thumbnail
    var flag2:String = null;
    // Set the index number of our loop, increments automatically
    var i:Number = 0;
    // Run the "for each" loop to iterate through all of the menu items listed in the external XML file
    for each (var MenuItem:XML in myXML..MenuItem)
    // Access the value of the "picnum" node in our external XML file
        var picnum:String = MenuItem.picnum.toString();
    // Access the value of the "pagetext" node in our external XML file
        var Caption:String = MenuItem.Caption.toString();
    // Access the value of the "thumb" node in our external XML file
        var thumb:String = MenuItem.thumb.toString();
    // Access the value of the "pagepicture" node in our external XML file
        var picture:String = MenuItem.picture.toString();
    // Just some trace I used for testing, tracing helps debug and fix errors
    //trace(picnum);
    var thumbLdr:Loader = new Loader();
        var thumbURLReq:URLRequest = new URLRequest(galleryDir + thumb);
        thumbLdr.load(thumbURLReq);
    // Create MovieClip holder for each thumb
    var thumb_mc = new MovieClip();
    thumb_mc.addChild(thumbLdr);
    addChildAt(thumb_mc, 1);
      // Create the rectangle used for the clickable button we will place over each thumb
      var rect:Shape = new Shape;
      rect.graphics.beginFill(0xFFFFFF);
      rect.graphics.lineStyle(1, 0x999999);
      rect.graphics.drawRect(0, 0, 80, 80);      
      // Create MovieClip holder for each button, and put that rectangle in it,
      // make button mode true and set it to invisible
      var clip_mc = new MovieClip();
      clip_mc.addChild(rect);
      addChild(clip_mc);
      clip_mc.buttonMode = true;
      clip_mc.alpha = .0;
         // The following four conditionals create the images where the images will live on stage
      // by adjusting math through each row we make sure they are laid out good and not stacked
      // all on top of one another, or spread out in one long row, we need 4 rows, so the math follows
      if (picnum < "05")
           line1xpos = line1xpos + distance; // These lines place row 1 on stage
        clip_mc.x = line1xpos;
        clip_mc.y = yPlacement;
        thumb_mc.x = line1xpos;
        thumb_mc.y = yPlacement;
       else  if (picnum > "04" && picnum < "11")
        line2xpos = line2xpos + distance; // These lines place row 2 on stage  
        clip_mc.x = line2xpos;
        clip_mc.y = 86;
        thumb_mc.x = line2xpos;
        thumb_mc.y = 86;
       else  if (picnum > "10" && picnum < "14")
        line3xpos = line3xpos + distance; // These lines place row 3 on stage
        clip_mc.x = line3xpos;
        clip_mc.y = 172;
        thumb_mc.x = line3xpos;
        thumb_mc.y = 172;
       else  if (picnum > "13" && picnum < "21")
       line4xpos = line4xpos + distance; // These lines place row 4 on stage
       clip_mc.x = line4xpos;
       clip_mc.y = 258;
       thumb_mc.x = line4xpos;
       thumb_mc.y = 258;
       // And now we create the pic loader for the larger images, and load it into "pictLdr"
       var pictLdr:Loader = new Loader();
       var pictURL:String = picture;
          var pictURLReq:URLRequest = new URLRequest(galleryDir + picture);
       //var pictURLReq:URLRequest = new URLRequest("gallery/Image00004.jpg");sprawia,ze zawsze wyswitla sie jeden obrazek
          pictLdr.load(pictURLReq);
       // Access the pic value and ready it for setting up the Click listener, and function
          clip_mc.clickToPic = pictLdr;
       // Access the text value and ready it for setting up the Click listener, and function
       clip_mc.clickToText = Caption;
       //var instName:String = flag();
       // Add the mouse event listener to the moviClip button for clicking
          clip_mc.addEventListener (MouseEvent.CLICK, clipClick);
          // Set the function for what happens when that button gets clicked
       function clipClick(e:Event):void
         // Populate the parent clip named frameSlide with all of the necessary data
         MovieClip(parent).frameSlide.gotoAndPlay("show"); // Makes it appear(slide down)
         MovieClip(parent).frameSlide.caption_txt.text = e.target.clickToText; // Adds the caption
         MovieClip(parent).frameSlide.frame_mc.addChild(e.target.clickToPic); // Adds the big pic
       } // This closes the "for each" loop
    } // And this closes the xmlLoaded function
    and the effect looks like this (it's a sketch, so big pictures are loaded randomly, don;t put too much attention to it): http://bangbangdesign.pl/xmlGallery/gallery29.swf
    but i guess it's a terrible stuff to go through all this. i would be totallly satisfied with a likng to a good tutorial to do it from scratch, or just a hint where to start rebuilding this.
    + in any case i send greetinngs to whereever you are =]

  • How do I change default Next/Previous buttons?

    When I automatically create multiple Submenus using the 'Create Chapter Index' command, Encore generates Next and Previous buttons.
    These are rather plain - they seem to be the same style regardless of the style of menu selected - and I'd like to set another default style.
    Can someone tell me how to do this, please?
    Many thanks
    John

    You can build the next/previous buttons any way you like. Just put them on the menu and then specify them as "Next" or "Previous" under the type field in the properties box. There's more information about this in the help files under chapter menu automation.

  • How can i create an album with chose category list and next/previous button

    hello guys im working on a project for my uni i finished the whole website but one thing is missing
    i need to create a photo album with next and previous button, with choosing a category and inside each category i have like 5 pictures and i can change with the next/previous buttons to see another picture of the  same category.
    Please see the picture below to see what i mean.
    some told me it needs flash but i dont know how to work on it :S so plz if anyone can help me
    thank you

    Dear Mr. Murphy,
    thank you for your help.
    Actually i have tried to search for a tutorial and i found that one that was very helpful and gave me the half solution. the part i found and it worked with me is the part of the next and previous buttons and moving from an image to another.
    SO the part i still need is the list so when i click on a category i get the pictures of the chosen category, I had the idea of create a flash for each category alone and maybe i will be able to add them all together.
    But i guess it's too much work and there must be a way where i can make it all in one flash file.
    If you have any idea let me know please, thank you again for your help and i'm trying to search for the AS3 image gallery as you told me.
    Regards

  • First/Previous/Next/Last buttons not working in Applications Master Detail

    Jdeveloper version: fusiondrop5primeb26
    accessed through appstta.oraclecorp.com
    I attempted to create an Applications Master Detail UI by selecting Applications : Master Detail from the Applications Component Palette. I created the UI using my headers table (APPLCORE_SHIPMENT_HEADERS) as the master and the lines table (APPLCORE_SHIPMENT_LINES) as the detail. The master is shown as a form and the details are displayed as a table below. On the screen with the checkboxes to include First, Previous, Next, Last buttons, I checked all of them.
    On the backend, my headers table has two rows.
    When I ran the page:
    1. When the page comes up, it shows the data for shipment header 1 and the associated details in the table below. This is correct.
    2. However, the First and Previous buttons are enabled at the top. They should not be enabled since I am on the first record, and there is no previous record. This is incorrect.
    3. When I click Next, the data does not update to the the next header record (shipment header 2). The data is still for shipment header 1. This is incorrect.
    4. When I click Next once more, an Error window pops up:
    Messages for this page are listed below.
    ShipmentLineId     Error java.lang.NullPointerException
    ShipmentHeaderId Error java.lang.NullPointerException
    LineNumber Error java.lang.NullPointerException
    ItemName Error java.lang.NullPointerException
    (same error is shown for all other columns in the lines table)
    I was under the impression that we do not need to do anything special for the First/Previous/Next/Last buttons to work, other than checking the boxes in the page creation process.
    The application in question is here:
    /home/sheyu/jdevhome/descflexdemo/.
    The ui project specifically is in this folder:
    /home/sheyu/jdevhome/descflexdemo/mywork/descflexdemo/ui/
    I have tried to start from scratch several times to no avail. Please advise.
    Thanks,
    Sherry

    Sherry, please use the internal JDeveloper forum at http://www.oracle.com/technology/products/jdev/customers/index.html for questions like this.
    The OTN forum is meant for versions that are available for the public.

Maybe you are looking for

  • Report from multiple subject areas

    Hi, I need to create a report from multiple subject areas. I am not sure whether it;s possible in OBIEE answers. Is there any other tool from OBIEE suite where I can design it? Thanks

  • Creation of DataSource

    Hello Techies, I am very new to ejb. I am trying to create a DataSource in weblogic. I am having weblogic 7.0 n using mysql as DataBase. I am using mysql-connector-java-3.0.17-ga.jar file to connect mysql from java. I had modified the script of start

  • Only one computer per account with the new Adobe CC 2014

    Hi guys, i have just upgraded all my apps to the brand new CC 2014, which also means everything is doubled in my application list. It all went fine at my work's computer but when I went back home and launched after effects CC 2014, it asked me for a

  • How to leave a comment to a report

    How to develop a report which the end user can leave a comment on? The comment created by this user should be visible to other end user.

  • Switching Consumer Groups

    Dear All, I had already posted my query as below but had not got appropriate answer so i am asking this question again which is as follows : how can i give preference to a prticular SID ? e.g : SID = 76 There are other many Session running simultaneo