Help with MSO over buttons...

I have something with MSO that I can't find a solution...
I have a page with a set of frames (thumbnails) set as "buttons", which work as a "menu" to open a MSOs with a big view of that images (in the menu). When I touch one of these buttons(thumbs), it goes to its respective state (bigger image). When the state/image is 'opened', there is a "close" button and also a "buy" button, and both of them works perfectly. The problem is, if I tap anywhere else but the "close" or "buy" button, it changes to another "state", because of the other "buttons" which are under the current state... Did I miss something to avoid this???
There is a similar example in a free preview of Wired Magazine on App Store (it's the orange cover which says "iPad edition free preview") - the fourth page (Inside a nuclear cooling tower). They have a close button at the top, but if you tap in the areas where the buttons are, it changes to other states without closing it... Weird.
Does anybody knows how to avoid it?

Put the buttons into the MSO.
Bob

Similar Messages

  • Need help with Flash CS4 buttons/can't get buttons to control anything

    Hello,
    I need help with Flash CS4. I am making a banner with an animation (Image change into movie clip "3D Spiral") and added buttons but I cannot get the buttons to control the animation. Please help I am frustrated! If someone could help I would be most appreciated.

    Thank you.
    Regards,
    Michael J. Sheehan  allelois
    Date: Mon, 17 Aug 2009 18:48:09 -0600
    From: [email protected]
    To: [email protected]
    Subject: Need help with Flash CS4 buttons/can't get buttons to control anything
    Hi there
    I'm not sure how you wound up where you did. But you wound up in the Adobe Captivate forums. Please stand by as I move your thread to the Flash forums.
    Cheers... Rick
    >

  • Help With Scrolling Menu / Button Rollovers

    First thank you to anyone who can answer and help with this
    question.
    http://paragon.sortismarketing.com
    - at this link I have created a site with a simple scrolling menu.
    Now what I want to happen is when you rollOver the buttons on the
    scrolling menu they get larger and then smaller again after you
    roll off them.
    I know how to do this with tweening in a non moving
    environment, by making them a movie clip instead of button. But for
    some reason when I did this in this case it screwed the menu all up
    and made it go crazy. Is there a way to do this with action script
    that isn't going to screw up the underlying code for the
    scrolling?

    You can use the below code also. As your mouse pointer goes
    over the down, it will scroll down.
    on(rollOver){
    scrolltext.scroll -= 1;

  • Help with Find / Replace button title tag contents (text)

    Hi there,
    I designed my site with Sitegrinder (Medialab) –
    Currently all the title tags generated for buttons are the same as
    the actual html page name.
    The problem with this is that the tooltip which appears in
    browsers when you hover over the button with the mouse gives you
    the page name. Instead I want to use these tooltips to give the
    user an indication of what the function of the button is.
    An example: A zoom button above an image: Currenty the
    tootlip says “zoom imagename pagename” – Instead
    it should say “click here to zoom”.
    I need help to get the Dreamweaver Find and Replace tool to
    batch replace these tags for me for about a 100 pages.
    Here is an example of the code:
    <body>
    <div id="id1zoomimpastooilweddingbutton"><a
    href="zoomimpastooilwedding.html"
    title="zoomimpastooilwedding"></a></div>
    I only want to replace the text in the title tag - Since the
    text “zoom” appears several times in the body, I
    can’t get the Find tool to pick up and Replace the occurrence
    of “zoom” in the title only…….
    Options I’ve tried:
    Search Current document: Search for: “specific
    tag”: “title”, “containing”:
    “text” = zoom (I’ve tried this with
    “zoomimpastooilwedding” and zoom[^”]* with no
    results
    I’ve also tried: Search for: “specific
    tag”: “body”, “containing”:
    “specific tag” “title”
    “containing”: “text” = zoom
    etc……………..
    I need help with what parameters to enter in order to find
    and replace all the text within the title tag with my own text
    Thanks very much!
    Anton

    You have ~ 100 pages, each of which has images with title
    attributes (not
    tags), all of which BEGIN with the letters "zoom"?
    What do you want to replace that text with? Wouldn't it be
    different for
    each button? Or do you mean that you would do multiple
    sitewide searches,
    one for each button? This illustrates how wrong it is to not
    use DW
    Templates or server-side includes to simplify the management
    of your
    navigation elements....
    Did you ask Medialabs if it would be possible to specify this
    before
    generating the HTML?
    How did you like working with SiteGrinder? It looks like a
    nice product to
    me, although I'm not fond of the final results code-wise....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "unison123" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hi there,
    >
    > I designed my site with Sitegrinder (Medialab) ?
    Currently all the title
    > tags
    > generated for buttons are the same as the actual html
    page name.
    >
    > The problem with this is that the tooltip which appears
    in browsers when
    > you
    > hover over the button with the mouse gives you the page
    name. Instead I
    > want to
    > use these tooltips to give the user an indication of
    what the function of
    > the
    > button is.
    >
    > An example: A zoom button above an image: Currenty the
    tootlip says ?zoom
    > imagename pagename? ? Instead it should say ?click here
    to zoom?.
    >
    > I need help to get the Dreamweaver Find and Replace tool
    to batch replace
    > these tags for me for about a 100 pages.
    >
    > Here is an example of the code:
    >
    > <body>
    > <div id="id1zoomimpastooilweddingbutton"><a
    > href="zoomimpastooilwedding.html"
    > title="zoomimpastooilwedding"></a></div>
    >
    > I only want to replace the text in the title tag - Since
    the text ?zoom?
    > appears several times in the body, I can?t get the Find
    tool to pick up
    > and
    > Replace the occurrence of ?zoom? in the title only??.
    >
    > Options I?ve tried:
    >
    > Search Current document: Search for: ?specific tag?:
    ?title?,
    > ?containing?:
    > ?text? = zoom (I?ve tried this with
    ?zoomimpastooilwedding? and zoom[^?]*
    > with
    > no results
    >
    > I?ve also tried: Search for: ?specific tag?: ?body?,
    ?containing?:
    > ?specific
    > tag? ?title? ?containing?: ?text? = zoom etc?????..
    >
    > I need help with what parameters to enter in order to
    find and replace all
    > the
    > text within the title tag with my own text
    >
    > Thanks very much!
    >
    > Anton
    >
    >

  • Help with voice-over on Ipod nano

    I'm totally blind and am using the 60g Ipod Nano with voice-over inabled. I am finding though even though the voice speaks the names of the menus, ie music, albums etc it doesn't speak the names of my albums or songs or tracks. What have I done wrong? I've tried connecting and leaving it to see if any voice tags are made, but nothing has happened. Any help would be welcome, it's driving me mad Many thanks from Lori.

    Try resetting your iPod.
    1. Toggle the Hold switch on and off. (Slide it to Hold, then turn it off again.)
    2. Press and hold the Menu and Center (Select) buttons simultaneously until the Apple logo appears, about 6 to 8 seconds. You may need to repeat this step.
    Tip: If you are having difficulty resetting your iPod, set it on a flat surface. Make sure the finger pressing the Select button is not touching any part of the click wheel. Also make sure that you are pressing the Menu button toward the outside of the click wheel, and not near the center.
    If the above steps did not work, try connecting iPod to a power adapter and plug the power adapter into an electrical outlet, or connect iPod to your computer. Make sure the computer is turned on and isn't set to go to sleep.
    Since you are totally blind, perhaps some one can double check your voice over settings to make sure everything is updated.
    The following information are links:
    iPod nano (5th generation): Enabling and updating VoiceOver
    Using Software Update for Windows to keep your Apple software up-to-date
    Every iPod comes with complimentary, single-incident telephone technical support within 90 days of your iPod purchase. _If you also purchased AppleCare, then your warranty is extended for technical support and hardware coverage for *two years* from the original purchase date of your iPod._

  • Ipod touch help with missing accept button for terms and conditions

    I want to update my apps but when I try it tells me that i first have to accept the new terms and conditions, however, there is no accept button to click.
    I have tried the other option to have it sent by e-mail but when I open the e-mail it's still the same with no accept button.
    I went into settings and allowed cookies on safari.
    I have an ipod touch 4th gen with ios 6.1.3.  I am also not able to buy any apps, music , etc.
    Someone PLEASE help!!!!

    Under Safari settings I have also "cleared history" and "cleared cookies and data"
    I have also given the i-pod both a restart, and a hard restart (holding the power and home buttons until the apple appears)
    "private browsing" is set to off.  "block pop-ups" is off too.

  • Help with the hold button on my ipod

    First, my ipod was starting to act up so I went onto the apple website and reset the ipod using what they told me to do (hold the menu and the center button at the same time) which of course I lost everything. Well when it came back on I plugged it into my computer and it recognized it and everything, acted like it was syncing my music and videos and when I unplugged it, only the names of the artist and songs were on it, 3 songs actaully went thru corrently, one of them for some reason was cut short the other was somehow mixed in with another song. I thought it was my computer so I tried it with my mother's laptop. It did the same thing. Then it decided it wouldn't turn on for anything, I plugged it into the charger and now it charges and comes on but the hold button won't go off, I've tried flicking the switch tons of times, I've tried resetting it, but with the hold button on I can't do anything. How can I get the hold button off. The warrenty is expired on it, is there a way I could take it back to apple for a new one or a refurbished one, for free? Or would I have to pay like $150 for it? Is there a way I could fix it at home?

    it might be a malfunction in your device. you might ave to send it to repairation
    1.ave you try resetting it or restoring it?
    2. did your hold boutons whas working beffor?

  • Help with using same buttons on timeline

    This is really basic,
    I've got 3 buttons on the main timeline, which is 25 frames. All my actions are on frame 14.
    Three buttons work on frame 15. But these same 3 buttons stop working on frame 17  - why?
    Please visit link below:
    http://www.simplecelebrations.info

    If your code is on frame 14 and your buttons are on frame 15, those buttons can't work unless they were on frame 14 first.  If you place new instances of these buttons on frame 17 but do not assign code for them, they will not work.  When you assign code to objects, such as buttons, they need to be present when that code executes.  So if you execute that code in frame 14, and the buttons are in frame 17, they are not present when that code executes so they cannot work.
    What you may find easier to deal with might be to have the buttons span the timeline where they are needed, meaning they have a keyframe at frame 14 where they get coded, and that extends as far down the timeline as you know those buttons need to be accessible.  You do not create new keyframes of them.  Then, if you need to hide the buttons for any reason, then you hide them by setting their visible property to be false. And if you need to display them again, you set it to true.
    There is not issue with having different buttons command the same thing, but if you are going to do that, then the different buttons should share the same function.  When I want to share a function or other code, such as variables, I always create a layer that I dedicate to the entire timeline.  It extends from frame 1 thru the last frame of the timeline.  All code on this layer is in frame 1. Any code on this layer is then accessible by anything along the timeline.  Then, as needed, I will have another actions layer that deals with frame level actions.
    So what I would do in your case, if you want to use different instances of the same buttons, would be to have the shared layer hold my event handler functions.  Then in my frame level actions layer I would have keyframes where I have the buttons and assign my event listners in those frames.  So if I had identical buttons in frames 15 and 17, but they were different instances, then in frame 15 I would have the same event listener assignments as I do in frame 17.  These listeners would be calling on the same functions that I have in that shared actionscript layer.
    // frame 15 code of frame level actions layer
    stop();
    btn1.addEventListener(MouseEvent.CLICK,go15);
    btn2.addEventListener(MouseEvent.CLICK,go18);
    btn3.addEventListener(MouseEvent.CLICK,go19);
    btn4.addEventListener(MouseEvent.CLICK,go20);
    btnb.addEventListener(MouseEvent.CLICK,go15);
    btnc.addEventListener(MouseEvent.CLICK,go17);
    // frame 17 code of frame level actions layer
    stop();
    btn1.addEventListener(MouseEvent.CLICK,go15);
    btn2.addEventListener(MouseEvent.CLICK,go18);
    btn3.addEventListener(MouseEvent.CLICK,go19);
    btn4.addEventListener(MouseEvent.CLICK,go20);
    btnb.addEventListener(MouseEvent.CLICK,go15);
    btnc.addEventListener(MouseEvent.CLICK,go17);
    frame 1 of shared actionscript layer...
    function go15(e:MouseEvent):void
    gotoAndStop(15);
    function go18(e:MouseEvent):void
    gotoAndStop(18);
    function go19(e:MouseEvent):void
    gotoAndStop (19);
    function go20(e:MouseEvent):void
    gotoAndStop (20);
    function go17(e:MouseEvent):void
    gotoAndStop (17);

  • Need help with audio on button ASAP THANKS!

    Hi,
    Using CS3 I added via properties audio to the "over" part of a gold button.  The audio I added is 4Mb in size which I had imported to the library.  When I selected "over" on the button and then using properties assigned the audio file .... the wave form appeared ... but not under "over" but over, down and hit.  Thus when I publish what is happening is the page loads fine ... the audio begins to play on roll over as wanted ...
    HERES THE GLITCH:  if you accidently roll over again a new audio begins to play out of sync with the first one ... basically you get the row, row row your boat effect where each roll over audio is delayed.
    MY FAILED SOLUTION:  I tried to move the audio file and assign it via properties under hit. Thus have to have someone click on the sound.  Yet the same outcome happend where the wave form appeared not just under hit but it showed on over, down and hit. The same thing happened when I tried assigning to "down".
    MY QUESTIONS:
    Is this caused by the sound file being too big?  I tried a small audio beed and it would assign directly under the part I assigned but not with the bigger 4MB audio file.
    If it is the size of the sound file, can I link the button to an external audio file. If so, what code would I use if I am using Action Script 2.0. I am very new at action script.
    If it is not the size, could some one please tell me how to fix this glitch.  I would be satisfied with the button working on either over or hit.  If you wish to see what the button is doing, you can see it online at www.signaturehill.com.
    THANKS.

    Hi Erika,
    That might just be what I need ... but I am confused as to where do put the action code.  Can you help me with the following questions:
    1. Did you put it inside the button via actionscript or did you select the button just and ad it there ...  or somewhere else? Since I have several buttons doing the same thing on different pages, I am not sure where to put it.
    2. What was the exact code you used  ie  on (release)  {....   StopAllSounds(); }  .... did you even use "release" or some other mouse event.
    Please include the action script code I might try since I am very new to scripting. THANK YOU>

  • HELP with animation for buttons (i tried to search for days for solution)

    Hellooo
    i've been trying to look at the threads here for a solution but i just can't find... can someone please help me???
    i'm designing a website in flash8... now i have created some buttons, and i want that when i click on the button stars will fly from them and there will be a sound... i have already created the animation of the stars seperatly and it's in the library, i have also the sound file.... i just can't remember how to put everything together.... can someone please remind me what to do step by step so when i'll press on the button the stars will be flying from the button and the sound will play??? pleaseeeeeeeee, it's very very important to me... i would be thankful <3

    hey!!! thank you, the sound is fixed,now the problem is with the stars.... i've been trying to do this soooooooo many times but i have really no idea why it's not working... i don't wantto give up... i don't know what i'm doing wrong.....grrrrrrrrrrrrrrrrrr

  • Please help with next/previous buttons.

    Hello all, I'm very new at this but I'm hoping you can help.
    I'm not a programmer but I've set up a site for my cartoons.
    Basically I have this Java double combo box set up for the archive section. From the first combo box, the user can select a range of strips to be viewed 1-30, 30-60 etc. From the, then propogated second list, the user can select a specific strip.
    This works fine.
    I've now written some code (untested) on the end of this, that calculates the 'next' strip and the 'previous' strip.
    My problem is, I don't know how to insert buttons to make said functions work!
    I'd like the user to be able to press either button and be zipped to the strip of their choice.
    If the combo's could be updated to show the choice, that would be cool too. Please have a look over at:
    http://theamoeba.ontheweb.com
    and select the 'Archive' item in the menu at the top of the screen to see what I mean.
    Many thanks in advance for anyone kind enough to help.
    The code is as follows.......
    <form name="doublecombo">
    <p><select name="example" size="1" onChange="redirect(this.options.selectedIndex)">
    <option>Strips 1-30</option>
    <option>Strips 31-60</option>
    <option>Strips 61-90</option>
    <option>Strips 91-120</option>
    </select>
    <select name="stage2" size="1">
    <option value="AmoebaStrips/Strip0000.gif">Strip 1</option>
    <option value="AmoebaStrips/Strip0001.gif">Strip 2</option>
    <option value="AmoebaStrips/Strip0002.gif">Strip 3</option>
    (etc......)
    </select>
    <input type="button" name="test" value="Go!"
    onClick="go()">
    </p>
    <script>
    var groups=document.doublecombo.example.options.length
    var group=new Array(groups)
    for (i=0; i<groups; i++)
    group=new Array()
    group[0][0]=new Option("Strip 1","AmoebaStrips/Strip0000.gif")
    group[0][1]=new Option("Strip 2","AmoebaStrips/Strip0001.gif")
    (etc.....)
    group[1][0]=new Option("Strip 31","AmoebaStrips/Strip0030.gif")
    group[1][1]=new Option("Strip 32","AmoebaStrips/Strip0031.gif")
    (etc....)
    group[2][0]=new Option("Strip 61","AmoebaStrips/Strip0059.gif")
    group[2][1]=new Option("Strip 62","AmoebaStrips/Strip0060.gif")
    (etc...)
    group[3][0]=new Option("Strip 91","AmoebaStrips/Strip0089.gif")
    group[3][1]=new Option("Strip 92","AmoebaStrips/Strip0090.gif")
    (etc...)
    var temp=document.doublecombo.stage2
    function redirect(x){
    for (m=temp.options.length-1;m>0;m--)
    temp.options[m]=null
    for (i=0;i<group[x].length;i++){
    temp.options[i]=new Option(group[x][i].text,group[x][i].value)
    temp.options[0].selected=true
    function go(){
    top.frames["mainFrame"].location=temp.options[temp.selectedIndex].value
    function getCurrentComicNum(selectEl) {
    var selected = selectEl.options[selectEl.selectedIndex].text;
    var currentNum = selected.substr(selected.indexOf("/"),selected.indexOf("."));
    return parseInt(selected.replace(/^0-9/gi,""));
    var baseURL = "AmoebaStrips/Strip";
    var fileType = ".gif";
    function nextComic(selectEl) {
    var thisComic = getCurrentComicNum(selectEl);
    thisComic++;
    thisComic.toString();
    while (thisComic.length<3) { thisComic = "0"+thisComic; }
    top.frames["mainFrame"].location = baseURL + thisComic + fileType;
    function prevComic(selectEl) {
    var thisComic = getCurrentComicNum(selectEl);
    thisComic--;
    thisComic.toString();
    while (thisComic.length<3) { thisComic = "0"+thisComic; }
    top.frames["mainFrame"].location = baseURL + thisComic + fileType;
    //-->
    </script>
    I apologise for the length of this mail but hopefully, you'll solve my problem.
    Cheers again.
    Paul (NooBee)

    Hello NooBee. Just to let you know this is a Java forum. This is not a JavaScript forum. The code you posted is JavaScript, not Java. I suggest you go to google and perform a search on JavaScript forums. You will probably find a good forum to post on.

  • Help with images and buttons

    I was wondering if anyone could recommend a tutorial or point me in the right direction. I've been trying to figure out how to use buttons to add images (been using png from photoshop with alphachannel) to a canvas. I don't have any problems skinning the buttons nor putting in a single image, nor text. As far as getting the images to layer when the buttons are clicked then I'm pretty lost. Not sure if an array is best or if adding and removing them as children in another container would be any easier..

    I've been using flash builder beta 2. I was planning on embedding the images. I'm not sure if the help files and examples I am reading are not compatible or if I just have the syntax wrong. I haven't been able to find any examples that use embedded images and toggle visibility. I've used spark components. In design mode it puts the code in for a button when drag-dropped, then recommends using spark component instead. It seems that the only time that the images really do anything is when there's a spark component.
    I've never used flex before would it be easier to use wordpad and try compiling it with something other than flash builder?

  • Help with Inventory Program Buttons & images

    I'm supposed to have buttons that move between the items in my program individually showing them one by one and also going to the first item when the last one is reached and vice versa, but I cannot get the buttons to to show even show up. I'm also having problems getting any type of image to show up. Any help on this would be appreciated.
    My code is below
    import java.awt.GridLayout;
    import java.text.NumberFormat;
    import java.util.Arrays;
    import javax.swing.*;
    //Begin Main
    public class InventoryProject {
              @SuppressWarnings("unchecked")
              public static Product[] sortArray(Product myProducts[])
                   //Comparator comparator = null;
                   ProductComparator comparator = new ProductComparator();
                   Arrays.sort(myProducts, comparator);
                   return myProducts;
              public static double CalculateInventory(Product myProducts[])
                    double total = 0;
                 for (int i = 0; i < myProducts.length; i++)
                    total += myProducts.calculateInventory();
         return total;
         public static void main (String[] args) {
                   Product products[] = new Product.Supplier[5];
                   //Create 5 Product Objects
                   Product.Supplier invItem0 = new Product.Supplier("The Matrix (DVD)", 100001, 12, 15.99, "Warner Brothers");
                   Product.Supplier invItem1 = new Product.Supplier("The Matrix Reloaded (DVD)", 100002, 9, 17.99, "Warner Brothers");
                   Product.Supplier invItem2 = new Product.Supplier("The Matrix Revolutions (DVD)", 100003, 27, 18.99, "Warner Brothers");
                   Product.Supplier invItem3 = new Product.Supplier("300 (DVD)", 100004, 5, 18.99, "Warner Brothers");
                   Product.Supplier invItem4 = new Product.Supplier("Harry Potter and the Sorcerers Stone (DVD)", 100005, 10, 15.99, "Warner Brothers");
                   //products array
                   products[0] = invItem0;
                   products[1] = invItem1;
                   products[2] = invItem2;
                   products[3] = invItem3;
                   products[4] = invItem4;
                   products = sortArray(products);
                   // Output Product Object
    JTextArea textArea = new JTextArea();
    for (int a = 0; a < products.length; a++)
    textArea.append(products[a]+"\n");
    textArea.append("\nTotal value of the inventory is "+new java.text.DecimalFormat("$0.00").format(CalculateInventory(products))+"\n\n");
    JButton prevBtn = new JButton("Previous");
    prevBtn.setEnabled(false);
    JButton nextBtn = new JButton("Next");
    JPanel p = new JPanel(new GridLayout(1,2));
    p.add(prevBtn); p.add(nextBtn);
    JFrame frame = new JFrame();
    frame.getContentPane().add(new JScrollPane(textArea));
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setTitle("DVD Inventory");
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    /*          for (int a = 0; a < products.length; a++)
                        System.out.println(products[a]); //use the toString method that you have defined in your Product class to print out the product information.
                   System.out.println("Total Value of The Inventory: " + nf.format (CalculateInventory(products)));
         private String name;
         private int number;
         private int unitCount;
         private double unitPrice;
    //     public String SupplierName;
    //     public static double calculateInventory;
         //Constructor
         public Product (String name, int number, int unitCount, double unitPrice)
              setName(name);
              setNumber(number);
              setUnitCount(unitCount);
              setUnitPrice(unitPrice);
    //     get and set methods for Number attribute
         public void setNumber(int itemnumber){
              number = itemnumber;
         public int getNumber(){
              return number;
    //     get and set methods for Name attribute
         public void setName(String names){
              name = names;
         public String getName(){
              return name;
    //     get and set methods for UnitCount attribute
         public void setUnitCount(int count){
              unitCount = count;
         public int getUnitCount(){
              return unitCount;
    //     get and set methods for UnitPrice attribute
         public void setUnitPrice(double price){
              unitPrice = price;
         public double getUnitPrice(){
              return unitPrice;
    //     get and set Total Inventory method
         public double calculateInventory()
              return getUnitPrice() * getUnitCount();
         public String toString () {
              return "Item Name: " + name + "\n" + "Item Inventory Number: " + number + "\n" + "Item Unit Count: " + unitCount + "\n" + "Item Unit Price: " + unitPrice + "\n" ;
         public void Supplier() {
              // TODO Auto-generated method stub
              return;
    //     public Supplier getSupplierName() {
    //     // TODO Auto-generated method stub
    //     return null;
         static class Supplier extends Product
              //private double restockFee;
              private String supplierName;
              NumberFormat nf = NumberFormat.getCurrencyInstance();
              public Supplier(String Name, int Number, int UnitCount, double UnitPrice, String SupplierName)
                   super(Name, Number, UnitCount, UnitPrice);
                   setSupplierName(SupplierName);
                   //setRestockFee(restockFee);
                   this.supplierName = SupplierName;
              //get and set methods for Supplier attribute
              public String setSupplierName(String supplier)
                   supplierName = supplier;
                   return supplierName;
              public String getSupplierName()
                   return supplierName;
              public double calculateRestockFee()
                   return (((getUnitPrice()) * (getUnitCount())) * 0.05);
              public double calculateInventory()
                   return ((getUnitPrice() * getUnitCount()));
              public String toString ()
                   return "Item Name: " + getName() + "\n" + "Item Inventory Number: " + getNumber() + "\n" + "Item Unit Count: " + getUnitCount()
                        + "\n" + "Item Unit Price: " + nf.format(getUnitPrice()) + "\n" + "Inventory Value: " + nf.format(calculateInventory()) + "\n"
                        + "Supplier Name: " + getSupplierName() + "\n" + "Restock Fee: " + nf.format(calculateRestockFee()) + "\n";
         public int compareTo(Product arg0)
              // TODO Auto-generated method stub
              return (this.name.compareTo(arg0.getName()));
    }public class ProductComparator implements java.util.Comparator
         public int compare(Object o1, Object o2)
                   if(o1 == null) return -1;
                   if(o2 == null) return 1;
                   Product p1 = (Product) o1;
                   Product p2 = (Product) o2;
                   String s1 = p1.getName();
                   String s2 = p2.getName();
                   int compVal = s1.compareTo(s2);
                   return compVal;

    The program does work because I can get the content of my array to show in a GUI the only problem is the buttons aren't showing up in the GUI which is what I'm having a problem with. I also tried adding the panel to the frame but it didn't do any good either so maybe I'm not doing it right although when I compile I get 0 errors. What's the link to the swing tutorial?
            JTextArea textArea = new JTextArea();
            for (int a = 0; a < products.length; a++)
                textArea.append(products[a]+"\n");
            textArea.append("\nTotal value of the inventory is "+new java.text.DecimalFormat("$0.00").format(CalculateInventory(products))+"\n\n");
            JButton prevBtn = new JButton("Previous");
            prevBtn.setEnabled(false);
            JButton nextBtn = new JButton("Next");
            JPanel panel1 = new JPanel(new GridLayout(1,2));
            panel1.add(prevBtn); panel1.add(nextBtn);
            JFrame frame = new JFrame();
            frame.getContentPane().add(new JScrollPane(textArea));
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setTitle("DVD Inventory");
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
            frame.add(panel1);Edited by: Morepheus on May 20, 2009 12:55 AM
    Edited by: Morepheus on May 20, 2009 12:58 AM
    Edited by: Morepheus on May 20, 2009 1:00 AM

  • Help with booleans and Buttons

    Hi,
    while ( repeat ) {
        tempValue = compMove.getRandomNumber();
        if ( nought.getUsedSquare(tempValue) ) {
            repeat = true;
        else if ( crosses.getUsedSquare(tempValue) ) {
            repeat = true;
        else {
            playButton[tempValue].setLabel("O");
            playButton[tempValue].setEnabled(false);
            nought.setSquareUsed(tempValue);
            repeat = false;
    }getUsedSquare(tempValue) - Should return true if button is used
    This code gets a random number in the range 0 to 8, and then uses this random number to check if a button has already been clicked and had its label changed using the getSquareUsed method. If the button has not been clicked then the label should be changed. Basically it is a Tic-Tac-Toe game.
    The problem is that sometimes the code will change the label on a button that has already been clicked.
    Why is this?
    Thanks for any help you can give.

    Alright:
    if ( event.getSource() == playButton[0] ) {
        playButton[0].setLabel("X");
        crosses.setSquareUsed(0);
        if ( crosses.checkForWin() )
            System.out.println("Crosses Win!");
        while ( repeat ) {
            tempValue = compMove.getRandomNumber();
            if ( nought.getUsedSquare(tempValue) )
                repeat = true;
            else if ( crosses.getUsedSquare(tempValue) )
                repeat = true;
            else {
                playButton[tempValue].setLabel("O");
                playButton[tempValue].setEnabled(false);
                nought.setSquareUsed(tempValue);
                repeat = false;
        repeat = true;
        if ( nought.checkForWin() )
            System.out.println("Noughts Win!");
        playButton[0].setEnabled(false);
    }That is the code i have for when the human player clicks on a button, the computer will make a random move, nothing intelligent about it (bit like me).
    I changed my coding for the getSquareUsed method to:
    public boolean getUsedSquare( int a ) {
       return squareUsed[a];
    }I know that the button is set as being used in the setSquareUsed method, but still the computer player will overwrite an already used square.
    Any ideas from this, or should i start again with something different?

  • Please help with aligning google button

    hi this is my website i have made,
    after making a few changes i have messed something up and now the google+ button has moved over to the right to much?
    i need to know how i can get the button to place above the facebook and twitter buttons where it was to begin with.
    www.uniquelawns.com
    many thanks Dave

    Run your page through the validator here and clean out the errors (except the two specific to the google code)
    http://validator.w3.org/
    That should make realigning an easier task.

Maybe you are looking for