Help with buttons within buttons

I am trying to get stop and play buttons for the background
music of my site to work within an animated rollover state of a
separate button. When I put the stop and play buttons into the
rollover animation they effect the hit state of the button they are
inside, how do I get around this? If you look at
www.thepixelplaypen.com/site you will see the menu bar at the
bottom. If you click on the references button (the 3d thought
bubble) i have directed it to how I want the page to look and work
when the music bar is 'rolled over'.

I've look at the site but am not sure what you mean. 1st I
don't know what the music bar is. Are you talking about the menu
bar when it's blank and minimized? Because when I go over that it
jumps from expanding to its full form to back to its minimized
state over and over.
I think what you need is something a little more involved
than the over/out states buttons give you.
I would say a two state movie clip with a variable that flags
on and off for the menu. Have the "toggle" turn off when moved out
from the menu, but not when over the music switch. For example, a 2
second delay that tests for the toggle being off, and the music
button turns it on on over...
Hope that helps...

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 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 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;

  • 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 navigation within a spark list...

    hey guys, so in my application when you click on a list item, it opens up an image, and along with the image a few buttons are created dynamically...
    the image and the url/labels for the dynamic buttons is provided through an xml/xmlListCollection.
    what i need help with is the url or more specifically when you click on one of these dynamic buttons it needs to navigate me to another part of an list or display a certain set of images that is not in my spark list...
    please let me know if this makes no sence
    the code i have is
    <code>
        [Bindable] private var menuXml:XML;
        [Bindable] private var imgList:XMLListCollection = new XMLListCollection();
        [Bindable] private var navControl:XMLListCollection = new XMLListCollection();
        [Bindable] private var fullList:XMLListCollection = new XMLListCollection();
        private var returnedXml:XMLListCollection = new XMLListCollection();
        private var myXmlSource:XML = new XML();
        //[Bindable] private var xmlReturn:Object;
        private var currImage:int = 0;
        //public var userOpProv:XMLListCollection = new XMLListCollection();
        //private var troubleShootProvider:XMLListCollection = new XMLListCollection();
        private function myXml_resultHandeler(event:ResultEvent):void{
            userOptionProvider.source = event.result.apx32.userOptions.children();
            troubleShootProvider.source = event.result.apx32.troubleShooting.children();
            fullList.source = event.result.apx32.children();
            returnedXml.source = event.result[0].children();
            myXmlSource = event.result[0];
        private function myXml_faultHandler(event:FaultEvent):void{
            Alert.show("Error loading XML");
            Alert.show(event.fault.message);
        private function app_creationComplete(event:FlexEvent):void{
            userOptions.scroller.setStyle("horizontalScrollPolicy", ScrollPolicy.OFF);
            myXml.send();
            //trouble.scroller.setStyle("horizontalScrollPolicy", ScrollPolicy.OFF);
            myXml = new HTTPService();
            myXml.url = "modules/apx32/apx32TroubleshootingXml.xml";
            myXml.resultFormat = "e4x";
            myXml.addEventListener(ResultEvent.RESULT, myXml_resultHandeler);
            myXml.addEventListener(FaultEvent.FAULT, myXml_faultHandler);
            myXml.send();
        private function troubleShootChange(event:IndexChangeEvent):void{
            dynamicButtons.removeAllElements();
            navControl.source = troubleShootProvider[event.newIndex].children();
            currImage = 0;
            imgList.source = troubleShootProvider[event.newIndex].images.children();
            definition.source = imgList[currImage].@url;
            if(imgList[currImage].@details == "true"){
                if(imgList[currImage].buttons.@hasButtons == "true"){
                    for each(var item:XML in imgList[currImage].buttons.children()){
                        var newButton:LinkButton = new LinkButton();
                        newButton.label = item.@name;
                        newButton.x = item.@posX;
                        newButton.y = item.@posY;
                        newButton.setStyle("skin", null);
                        newButton.styleName = "dynamicButtonStyle";
                        dynamicButtons.addElement(newButton);
            //var isMultiPage:String = navControl[2]["multiPages"];
            //trace(isMultiPage);
            //        if(isMultiPage){
            if(currImage >= imgList.length - 1){
                next.visible = false;
                back.visible = false;
            else{
                back.visible = false;
                next.visible = true;
        private function customButtonPressed(event:Event):void{
            if(imgList[currImage].button.@changeTo != ""){
        private function userOptionsChange(event:IndexChangeEvent):void{
            dynamicButtons.removeAllElements();
            navControl.source = userOptionProvider[event.newIndex].children();
            currImage = 0;
            imgList.source = userOptionProvider[event.newIndex].images.children();
            definition.source = imgList[currImage].@url;
            if(imgList[currImage].@details == "true"){
                if(imgList[currImage].buttons.@hasButtons == "true"){
                    for each(var item:XML in imgList[currImage].buttons.children()){
                        var newButton:LinkButton = new LinkButton();
                        newButton.label = item.@name;
                        newButton.x = item.@posX;
                        newButton.y = item.@posY;
                        newButton.setStyle("skin", null);
                        newButton.styleName = "dynamicButtonStyle";
                        newButton.addEventListener(MouseEvent.MOUSE_DOWN, customButtonPressed);
                        dynamicButtons.addElement(newButton);
            var isMultiPage:String = navControl[2]["multiPages"];
            if(isMultiPage == "true"){
                if(navControl[2]["next"] == "NEXT STEP"){
                    navContainer.x = 630;
                else{
                    navContainer.x = 640;
                next.label = navControl[2]["next"];
                back.label = navControl[2]["back"];
            if(currImage >= imgList.length - 1){
                next.visible = false;
                back.visible = false;
            else{
                back.visible = false;
                next.visible = true;
        private function nextClickHandler(event:MouseEvent):void{
            currImage += 1;
            dynamicButtons.removeAllElements();
            if(currImage >= imgList.length-1){
                currImage = imgList.length - 1;
                //next.visible = false;
                next.label = "YOU'RE DONE";
            else
                next.label = navControl[2]["next"];
            back.visible = true;
            if(imgList[currImage].@details == "true"){
                if(imgList[currImage].buttons.@hasButtons == "true"){
                    for each(var item:XML in imgList[currImage].buttons.children()){
                        var newButton:LinkButton = new LinkButton();
                        newButton.label = item.@name;
                        newButton.x = item.@posX;
                        newButton.y = item.@posY;
                        newButton.setStyle("skin", null);
                        newButton.styleName = "dynamicButtonStyle";
                        dynamicButtons.addElement(newButton);
            definition.source = imgList[currImage].@url;
        private function backClickHandler(event:MouseEvent):void{
            currImage -= 1;
            dynamicButtons.removeAllElements();
            if(currImage == 0){
                back.visible = false;
            next.visible = true;
            next.label = navControl[2]["next"];
            if(imgList[currImage].@details == "true"){
                if(imgList[currImage].buttons.@hasButtons == "true"){
                    for each(var item:XML in imgList[currImage].buttons.children()){
                        var newButton:LinkButton = new LinkButton();
                        newButton.label = item.@name;
                        newButton.x = item.@posX;
                        newButton.y = item.@posY;
                        newButton.setStyle("skin", null);
                        newButton.styleName = "dynamicButtonStyle";
                        dynamicButtons.addElement(newButton);
            definition.source = imgList[currImage].@url;
    </code>
    i have attached a copy of the xml that i have right now to this post for reference...
    any help will be greatly appretiated!!! i've been stuck on this problem for the last week and my project is due soon
    again thank you in advance...

    hey david... just nevermind my previous post... I was able to subclass a link button, so i now have two variables that get assigned to a link button,
    one is "tabId" <-- contains the information on which tab to swtich to, and the second is, "changeTo"... this contans the label name which it needs to switch to
    I'm just stuck on how to change my selected item in my tabNavigator/list
    the code i have right now is
        private function customButtonPressed(event:Event):void{
            if(event.currentTarget.tabId == "troubleShooting"){
                for each(var item:Object in troubleShootProvider){
                    if(item.@label == event.currentTarget.changeTo){
        private function userOptionsChange(event:IndexChangeEvent):void{
            dynamicButtons.removeAllElements();
            navControl.source = userOptionProvider[event.newIndex].children();
            currImage = 0;
            imgList.source = userOptionProvider[event.newIndex].images.children();
            definition.source = imgList[currImage].@url;
            if(imgList[currImage].@details == "true"){
                if(imgList[currImage].buttons.@hasButtons == "true"){
                    for each(var item:XML in imgList[currImage].buttons.children()){
                        var newButton:customLinkButton = new customLinkButton();
                        newButton.label = item.@name;
                        newButton.tabId = item.@tab;
                        newButton.changeTo = item.@changeTo;
                        newButton.x = item.@posX;
                        newButton.y = item.@posY;
                        newButton.setStyle("skin", null);
                        newButton.styleName = "dynamicButtonStyle";
                        newButton.addEventListener(MouseEvent.MOUSE_DOWN, customButtonPressed);
                        dynamicButtons.addElement(newButton);
            var isMultiPage:String = navControl[2]["multiPages"];
            var videoPresent:String = navControl[1]["videoPresent"];
            if(videoPresent == "true"){
                if(isMultiPage != "true"){
                    navContainer.x = 825;
            if(isMultiPage == "true"){
                if(navControl[2]["next"] == "NEXT STEP"){
                    navContainer.x = 630;
                else{
                    navContainer.x = 640;
                next.label = navControl[2]["next"];
                back.label = navControl[2]["back"];
            if(currImage >= imgList.length - 1){
                next.visible = false;
                back.visible = false;
            else{
                back.visible = false;
                next.visible = true;
    as you know, my xml gets divided into two saperate xmllistcollections one is the userOptionProvider, and the troubleshootingProvider
    as is in the following xml
    <mx:TabNavigator id="tabNav" width="275" tabStyleName="tabStyle" fontWeight="bold" height="400" paddingTop="0"
                             tabWidth="137.5" creationPolicy="all" borderVisible="false">
                <mx:VBox label="USER OPTIONS" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                    <s:List id="userOptions" width="100%" height="100%" itemRenderer="modules.apx32.myComponents.listRenderer"
                            borderVisible="false" contentBackgroundColor="#e9e9e9"
                            change="userOptionsChange(event)">
                        <s:dataProvider>
                            <s:XMLListCollection id="userOptionProvider" />
                        </s:dataProvider>
                    </s:List>
                </mx:VBox>
                <mx:VBox label="TROUBLESHOOTING">
                    <s:List id="trouble" width="100%" height="100%" itemRenderer="modules.apx32.myComponents.listRenderer"
                            borderAlpha="0" borderVisible="false" contentBackgroundColor="#e9e9e9"
                            change="troubleShootChange(event)">
                        <s:dataProvider>
                            <s:XMLListCollection id="troubleShootProvider" />
                        </s:dataProvider>
                    </s:List>
                </mx:VBox>
            </mx:TabNavigator>
    Im having some trouble updating my list... basically change to the troubleshooting tab, and then select the one that i need...
    hopefully that makes sence...

  • Buttons within Button?

    Hi,
    i'm looking for a way to achieve the following:
    i have movieClip called mcHolder.
    When the onMouseOver event of mcHolder is triggered when the
    user sets the mouse over mcHolder.hitArea the mcHolder movie plays
    and displays three subbuttons. onMouseOut of mcHolder the mcHolder
    timeline is played backwards
    The problem is that the three subbuttons don't work because
    of the mcHolder hitArea (i think?)
    Anyone any idea how to achieve this kind of functionality?
    thanks in advance

    hi kdlad,
    thanks for the reponse I achieved to track the onMouseDown by
    adding an event listener to the Mouse and testing with hitTest, but
    could you please give me some more help with the mouseOver event?
    Do I need to make an on enterFrame loop?

  • 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

  • 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?

  • Help with validating radio buttons

    I would like to set my radio button so they can only click it after they have entered text into the 2 previous text fields.  Can someone help me out with a script how to do that?
    Thanks

    Please try the following Script :
    // Function to enable form fields function
    EnableFormField (cFieldName) {
    // First acquire the field to be enabled
    var oFld = this.getField(cFieldName)
    // Next acquire the hidden field with the normal colors
    var oNmlFld = this.getField("NormalColorsFld");
    if(oFld) {
    // Make field interactive
    oFld.readonly = false;
    // Restore Normal Colors
    oFld.fillColor = oNmlFld.fillColor; oFld.borderColor = oNmlFld.borderColor; oFld.textColor = oNmlFld.textColor;
    // Function to disable form fields function
    DisableFormField(cFieldName) {
    // First acquire the field to be disabled
    var oFld = this.getField(cFieldName)
    if(oFld) {
    // Make field Read-Only
    oFld.readonly = true;
    // Set Grayed out colors
    oFld.fillColor = ["G", 0.75]; oFld.borderColor = ["G", 2/3]; oFld.textColor = ["G", 0.5];

  • I need help with setting my button to link to my website! URGENT HELP!!!!

    Hello everyone. Lately, I've been trying to link a button to my site with Action Script 3, however, whenever I try to load my movie, I keep getting an error! The error says: Scene 1, Layer 'Button', Frame 1, Line 5 1071: Syntax error: expected a definition keyword (such as function) after attribute fuction, not pes.
    This is what I wrote...
    stop();
    peshp_btn.addEventListener (MouseEvent.CLICK, pes);
    fuction pes(e:MouseEvent):void{
    var pesLink:URLRequest = new URLRequest("http://www.penguinentertainmentstudios.com");
    navigateToURL(pesLink,"_blank");
    PLEASE HELP ME I IVE BEEN TRYING FOR ALMOST 2 HOURS NOW!!!!!

    Use the following:
    peshp_btn.addEventListener(MouseEvent.CLICK, pes);
    function pes(event: MouseEvent) {
    var pesLink:URLRequest = new URLRequest("http://www.penguinentertainmentstudios.com");
    navigateToURL(pesLink, "_blank");

Maybe you are looking for

  • How to downgrade from iOS 8.1 to 7.1.2 for iPhone 5 ?

    Dear Experts How to downgrade from iOS 8.1 to 7.1.2 for iPhone 5 ? The situation is that in Hong Kong, I bought the iPhone 5 for my mainland China friend. The seller said that the iPhone 5 was brand new and was come from USA. I found that iPhone 5 wa

  • Step for User Decision

    Hi All, I have a scenario and two solutions for it. Please give me the input for which is a better solution and why. Scenario - Approver have to either Approve/ Reject a particular request made. The user decision has to come from Java front end  and

  • Report Builder 6i Data Model

    Report Builder 6i is ending in error if we try to add additional column in the data model query select rpad('a',50,'-') cust_name_inv, rpad('a',30,'-') cust_no_inv, rpad('a',30,'-') sal_name, ---added column rpad('a',4000,'-') sort_field1_inv, rpad('

  • Get current page details from within dynamic page

    Is there any API or any other way of getting the current page id that the dynamic page portlet is being called from? Thanks in advance.

  • How do I sync my iPod classic to include Genius playlists?

    I recently set up Genius playlists in my iTunes library. Liking this feature, I ASSUMED that when I attempted to stnc my library to my iPod, this feature would be added to that remote unit. WRONG. If this feature is available with my 120GB Classic, t