Making buttons

Hello. Trying to learn some graphics by making 2 frame classes I will call from my main. But my first class where I whant to make an quit button dosent compile. Any tips why?
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
// View class who creates an quit button for the JFrame
public class View extends JPanel{
    private JButton quit;
    // Create the Quit Button
    public QuitButton(){
        JButton quit = new JButton("Quit");
        add(quit);
        ActionListener listener = new clickListener();
        quit.addActionListener(listener);
    // Tell the JButton to quit the JFrame when pushed
    public class clickListener implements ActionListener{
        public void actionPerformed(ActionEvent event){
            System.exit(0);
// error: invalid method declaration; return type required (Line 12 - public QuitButton(){ )And when I try to set "QuitButton" to "void" I?m getting:
"cannot find symbol - class ActionListener" @ line 21 where I try to implement ActionListener.

Ok. All my classes are done now and compiling just
becouse I have put the all to be "void". And this
leads to no results so apparently they need to have a
return type as you said. Can we maybe look at my most
simpel class who are supposed to draw the
rectangle?(It compiles but I guess it dosent do
anything with void as a type. If I change to "static"
it says once again it need a return type. Any idea?)Do you call the Rectangle method on that class? If you don't, then it will never run, and nothing will be drawn. Perhaps you want to put that drawing code in the paintComponent() method, so that it will be drawn as part of the JPanel? If you want the Rectangle method to be treated as a constructor, then you have to give it the same name as the class:
public View() {   // a constructor
public void Rectangle() {   // a method
}Painting: http://java.sun.com/docs/books/tutorial/uiswing/painting/index.html
Constructors: http://java.sun.com/docs/books/tutorial/java/javaOO/constructors.html

Similar Messages

  • Making button and a html site in visual studio community version

    Hi,
    I like to Making button and a html site  in visual studio community version but i dont know how to put the right code in my c# form to perform a action to my new html site i made with visual studio.
    So ik have a button and i added a html site with the "add" options to my form.I want the button to open onclick that site so i can make a html about some info of the button image (tool to use with metal)
    Any one? Sorry i am very new at this and also from the netherlands but i want to  coding in c# great to to learn..
    Many thanks!
    Arend

    Hi Arend,
    Thank you for posting in MSDN forum.
    Since this forum is to discuss: Visual Studio WPF/SL Designer, Visual Studio Guidance
    Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor. Based on your issue, I think that the issue is more related to the programming. So I’m afraid that it is not the correct forum for this issue.
    To help you find the correct forum for this issue, could you please tell
    me which kind of app you want to create? Is it winform app or others?
    If you want to code for a winform app using c# language, I suggest you
    can consult your question on specific
    WinForm forum so that they can share you something for you to start.
    Thanks for your understanding.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Making buttons for an ArrayList

    I am in a hurry as this program has to be handed in tomorrow so quick replys would be helpful.
    I dont know how to make buttons in my GUI for an ArrayList and have it respond individualy with the name of the button i.e. i want to make it so that when you click on the drill button it will get take the label of that button and return it as a string. The problem is making the individual buttons that will respond to individual commands.
    Im pretty sure that made no sense but im out of ideas.

    Disregard the previos post i was doing it wrong.
    Ive realised that the main problem is that is ignoring this
    else if (event.getSource() == y)
                    String text = ((JButton)event.getSource()).getText();
                    game.playGUI("grab "+ text);
                    frame.dispose();
                    makeFrame();
                }

  • Problem making buttons visible

    Hi there, I have a poker game that all worked fine until I was told to restructure it in a MVC style. I never had this problem before I changed it but I'm having issues with making my buttons visible when it's the players turn. At first I setVisible to false which works fine, then I call my method to display them from my model and they display fine, so seemings as all is good to here I think it's the next bit that's causing my issue, I have actionListeners attached that when fired setsVisible on all the buttons to false again (which works) but the next time I call my method to make certain buttons visible they don't appear. I've tested that the method is being called with the correct parameter passed and it is. Now I must apologise because my knowledge of swing is very poor but I have searched and read alot and tried several approaches with no joy, I will definitly be studying up more on it in the future but time is against me at the mo. The only thing that seems to half work is if I use this.paint(g) the buttons display as I want them but my program crashes cos to be honest I don't know what g should be. Is this the right approach or is there a more simple way I can update my GUI to display my buttons?

    Works for me but you could try to add a revalidate(); repaint(); on the buttons parent.
    import java.awt.BorderLayout;
    import java.awt.EventQueue;
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    public class TestVisible {
        public static void main(String[] args) {
            EventQueue.invokeLater(new Runnable() {
                public void run() {
                    final JButton button = new JButton("I do nothing");
                    final JFrame frame = new JFrame("Test");
                    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                    frame.getContentPane().add(button);
                    frame.getContentPane().add(new JButton(new AbstractAction("Toggle") {
                        @Override
                        public void actionPerformed(ActionEvent e) {
                            button.setVisible(!button.isVisible());
    //                        frame.getRootPane().revalidate();
    //                        frame.getRootPane().repaint();
                    }), BorderLayout.PAGE_START);
                    frame.pack();
                    frame.setLocationRelativeTo(null);
                    frame.setVisible(true);
    }

  • Making buttons to effect multiple layers

    Just wondering how to create several layers where by the push
    of a button (say 3 buttons correspond to the three layers) they
    layer will be visable or not, or likewise one button making two or
    more layers visable or not. And how to do this without recreating
    those layers multiple times through the timetime to suit every
    possible combo.
    Thank you hope I'm not too annoying in my ignorant question.

    Sorry for such novice questions but!
    I tried that and currently, although there are no errors in
    the compilation, the mc still does not disappear / appear. any
    advice on what im doing wrong (its in the frames script with the
    movie clip called "mc" and the button called "btn"
    thanks (i just want when the button is pressed for the movie
    clip to not be seen/be seen. (the movie clip is just a static box
    right now)

  • What would the CODE be, in Flash, for making buttons transparent on MOUSEOVER?

    I am building my site in Flash, and I have these thumbnails, that when moused over, a larger version pops up.
    Problem is, they are being obscured by the other thumbs. See for yourself:
    http://www.andreadams.com/Andre_Adams_products_games.htm
    (also attaching a jpeg example of what I'm talkin about)
    I tried to make the buttons transparent, put them on different layers, all this stuff, nothing worked. I figured there must be some code to make it work, like, "on mouseover, make buttons A, B, C transparent." Something like that, just have no idea how to write it.
    If someone could help me out it would be much appreciated! I will reward you with a copy of my Cartoon Express CD collection--500 vector images. No joke!
    cheers, Andre

    The more correct way to deal with this is to manage the depths of the movieclips/buttons so that whichever is currently being rolled over is brought to the top of the pecking order.  It may require a little bit of redesign, but not necessarily.  How you go about mamanging the depths depends on what version of actionscript you're using.  In AS2 you want to look into the swapDepths() method, and in AS3 you want to look into the setChildIndex() method.
    To answer the title question, to make something transparent, like a button or a movieclip, you set the alpha/_alpha (AS3/AS2) property to 0. But in doing that you will probably be creating a problem because transparent objects can still interact with a mouse.  Your better bet is to set the visible/_visible property to false... invisible objects won't interact with mice.

  • Making Button links within a movie clip

    I am attempting to learn more Flash in general and
    actionscript in particular. I have created a flash piece that
    consists of 4 buttons within a movie clip that is being masked by
    another movie clip. One movie is the set of 4 buttons. The other
    movie is a "spotlight" that moves with the cursor. As the spotlight
    shines on each button, the button's text changes color and is "lit
    up".The Over state of each button is set to cause the button to
    change color. When I put a keyframe in the Down state of each
    button in order to add actionscript to create the action that makes
    the button clickable to take the viewer to a web page, it tells me
    that no actions can be given to this Down state. If I try using
    Behaviors to accomplish the same thing, it tells me that Behaviors
    are not supported. If I put actionscript into the actions layer of
    the timeline, it does not do the required action, i.e. clicking on
    the buttons leads nowhere. I have tried moving the actionscript
    before, between, and after the setInterval and setMasker
    actionscript that controls the interaction between the two movie
    clips (which work perfectly). I have tried inserting an actions
    layer into the button movie clip--same result--nothing. I have
    tried putting the actionscript in the second frame of the actions
    layer (both in the main timeline and in the movie clip), all to no
    avail. I did give each button an instance name and used them in the
    actionscript.
    Here is the actionscript I am using for one of the buttons:
    book.onPress = function(){
    book.getURL("http.//www.bainbridge.wednet.edu");
    I do not get an error message with this actionscript. I just
    don't get sent to the web page. I am using Flash 8.
    What else I should be doing? Is this a problem because the
    cursor is already attached to an action? I am sure that this must
    be possible, if only I knew more.
    Thanks for helping.

    do you have the actual mc identified as ( book ) on the root
    as well as the code i posted above? if so, are the code and the mc
    on the same frame? also you should note that the code posted above
    is meant to be placed on your root time line, not directly on the
    mc identified as ( book ). one more thing: you must target your mc
    ( book ) correctly.
    target like this:
    IF YOU ARE ON THE MAIN TIME LINE ( _root ):
    // if ( book ) is setting on the _root already then your
    target path is simply book.onRelease.
    // if ( book ) is setting inside another movieclip on the
    _root, find out what movieclip ( book )
    // resides in. that will now be the first part of your target
    path.
    // next find out if ( book ) resides in yet another
    movieclip. if so, that will be the next part of
    // your target path.
    // continue this until you reach ( book ). the entire path
    you took to reach ( book ) is your
    // target path.
    // you can also click on the target icon in your actionscript
    pane to insert a target path for
    // your movieclip.
    here is an example in which ( book ) resides inside another
    movie clip ( yourMovieClip ) on your _root:
    yourMovieClip.book.onRelease = function () {
    getURL("
    http://www.cnn.com/");

  • Making button disable in tool bar

    Guru,
    I am displaying on ALV using class. I have some toolbar in out put.
    Could you pls tell me how to disable them.
    Thanks,
    Sandeep Garg

    Hi,
    Use this code to disable standard buttons from alv toolbar, its working:-
    *FOR EXCLUDING STANDARD BUTTON FROM ALV TOOLBAR
    DATA : it_exclude TYPE slis_t_extab,
                wa_exclude TYPE slis_extab.
    *          FOR EXCLUDING STANDARD BUTTONS FROM ALV TOOLBAR
      wa_exclude-fcode = '&OUP'.
      APPEND wa_exclude TO it_exclude.
      CLEAR wa_exclude.
      wa_exclude-fcode = '&ODN'.
      APPEND wa_exclude TO it_exclude.
      CLEAR wa_exclude.
      wa_exclude-fcode = '&OAD'.
      APPEND wa_exclude TO it_exclude.
      CLEAR wa_exclude.
      wa_exclude-fcode = '&INFO'.
      APPEND wa_exclude TO it_exclude.
      CLEAR wa_exclude.
    *--similarly append other function codes of the buttons that you want to exclude
    *--and pass this internal table to FM REUSE_ALV_GRID_DISPLAY
    *          DISPLAY RECORDS IN ALV GRID
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
       i_callback_program                = rep_id
    *   i_callback_pf_status_set          = 'PF'
       i_callback_user_command           = 'COMMAND'
       i_callback_top_of_page            = 'TOP'
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  =
    *   I_BACKGROUND_ID                   = ' '
       i_grid_title                      = wa_title
    *   I_GRID_SETTINGS                   =
       is_layout                         = wa_layout
       it_fieldcat                       = it_field
       it_excluding                      = it_exclude "excule buttons
    *   IT_SPECIAL_GROUPS                 =
       it_sort                           = it_sort
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *   I_DEFAULT                         = 'X'
       i_save                            = 'A'
       is_variant                        = wa_variant
       it_events                         = it_event
    *   IT_EVENT_EXIT                     =
    *   IS_PRINT                          =
    *   IS_REPREP_ID                      =
    *   I_SCREEN_START_COLUMN             = 0
    *   I_SCREEN_START_LINE               = 0
    *   I_SCREEN_END_COLUMN               = 0
    *   I_SCREEN_END_LINE                 = 0
    *   I_HTML_HEIGHT_TOP                 = 0
    *   I_HTML_HEIGHT_END                 = 0
    *   IT_ALV_GRAPHICS                   =
    *   IT_HYPERLINK                      =
    *   IT_ADD_FIELDCAT                   =
    *   IT_EXCEPT_QINFO                   =
    *   IR_SALV_FULLSCREEN_ADAPTER        =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it_ekpo
    EXCEPTIONS
       program_error                     = 1
       OTHERS                            = 2.
      IF sy-subrc <> 0.
      ENDIF.
    Hope this helps you.
    Thanks & Regards,
    Tarun Gambhir

  • Making buttons stay "selected"

    Hi,
    I can't figure out how to make a movie clip button appear to
    stay selected.
    Right now, I have a duplicate button off the stage, and was
    thinking when one of my nav buttons was clicked, I could make this
    duplicate button move over the actual button to look like it
    changed colors.
    Right now, my non-working code looks like this:
    print1.onRelease = function() {
    redButton.moveTo (391,485);
    startLoading("NWN4.jpg");
    This seems like it should be really easy to do, but I haven't
    done enough in Flash to know how to do it.
    If anyone can help me out, that would be great!!!!
    Thanks!
    Laura

    Hi TinyTrim
    Unfortunately, I've never discovered a way to make this work.
    I think the reason that things are this way are because clicking
    each of the built in buttons causes a more or less semi-permanent
    effect on the area below the toolbar. The selected pane remains
    visible in the frameset. Additional custom buttons are really
    intended for a single action. So I think this may be why we can't
    choose a state for them to appear in.
    Probably something you should consider submitting an
    enhancement request for. You can do that by
    clicking
    this way cool and very handly little link right here!
    Cheers... Rick

  • Making buttons rollovers and hyperlinks work in an interactive PDF!

    Hello!
    I'm actually real life tearing my hair out here, I wonder if anyone can help??
    I'm desperately desperately trying to make a simple document, that has a few menus where text will link to certain pages, and that has a few links to websites via highlighted text.
    I have -finally after an entire day of trying!- managed to create a 'go to page' element in an interactive pdf so that the links within the document can connect to the correct pages. However! I cannot at all get the external website links to work and I cannot get any of the rollover states for the buttons to work. It is important to get it to work as otherwise the user doesnt know that its an interactive element!
    I hope that makes sense?
    To be clear:
    -The Rollover states of the biuttons do not work ing an interactive pdf
    -and the URL links do not work in a PDF
    Please please can anyone help?? I was supposed to finish this this morning but it looks like it will be a late night for me. Adobe is usually so good but this has been a total nightmare, not intuitive to use at all and no clear information on how to use it
    Best
    Jade

    EDIT: I see you mentioned that yourself but the header of your question was 'How to make SWF file work in interactive PDF'. Strictly speaking, forgetting the iPad, the answer would be: export the animation from InDesign to SWF, delete the animation and now place the exported SWF back on the page. Then export to interactive PDF.
    Still won't work on iPad however!
    On Desktop this will work in PDF *if* Flash player is installed on that desktop for Adobe reader/Acrobat 10 and later; versions 9 and earlier have 'build in' Flash players...

  • Making buttons of U.S. states

    I have a vector map of the U.S., and I'm trying to make each
    state a simple button. But certain landlocked states (Oklahoma,
    West Virginia, Kansas) won't allow me to make buttons of them. How
    do I do this?

    Laura,
    >I have a vector map of the U.S., and I'm trying to make
    each
    > state a simple button. But certain landlocked states
    (Oklahoma,
    > West Virginia, Kansas) won't allow me to make buttons of
    them.
    > How do I do this?
    You have two options: a) create separate symbols out of all
    50 states
    or b) overlay each state with an "invisible" button, or
    hotspot. To create
    an invisible button, create a button symbol and draw a shape
    only in the Hit
    frame. That gives the button a clickable surface, but a
    surface that
    doesn't look like anything (the authoring environment will
    show you the
    shape as a semitransparent teal, for convenience).
    If you go with the latter choice, you'll probably want to
    make your
    invisible buttons match the shape of each state as closely as
    possible ...
    and if so, you may as well forego the invisible buttons and
    just make each
    state it's own symbol. ;)
    That said, maybe you've already tried this, and that's where
    you're
    getting stuck. To create a symbol from each of the landlocked
    states, you
    should be able to carefully use the Selection tool to click
    on each piece of
    the state's stroke, and then its fill, then convert. Doing
    that, however,
    will "steal" strokes from neighboring states, so the workflow
    I would use is
    this (starting with the original vector map):
    a) Create a new layer above the original map layer.
    b) Choose a state and carefully select its stroke and fill.
    c) Copy to the clip board.
    d) Paste in place to the new layer. (This leaves the original
    strokes in
    place, to be used to create the symbols for neighboring
    states.
    e) In the new layer, select the state's stroke and fill, then
    convert to a
    button or movieclip.
    f) Repeat steps b through e another 49 times.
    David Stiller
    Co-author, Foundation Flash CS3 for Designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • Making Buttons appear depending on the results of a SQL Query

    I need some help here I am still working on a time clock program
    I need help with the clock in and out buttons i need to know how to make
    the clock in button appear only if they are not clocked in. But I can not seem
    to make the sql statement or maybe my code is wrong, it needs to just get a
    count to see if they have any entries that have 0 in the hoursworked column
    and if so then it needs to just display the clock out if not then just the clockin button needs to be displayed this was my orignal code that was not working
    <%   
        String statement = "select count(*) as cnt from TimeSheet Where idnum = " + session.getAttribute("IDNUM");
        stmt.execute(statement);
        rs = stmt.getResultSet();
        rs.next();
        int num = rs.getInt("cnt");
        if (num == 0 || num == null)
        {%>
            <tr>
                <td><input type="submit" value="Clock In" name="button"></td>
            </tr>
        <%}
        else
        {%>
            <tr>
                <td><input type="submit" value="Clock Out" name="button"></td>
            </tr>
         <% } %>but it did not work it would only display the clock out button so i need to figure this out so that the user can not clock into the program twice to get double hours and so forth.

    Does it even compile ?Yes, it wouldnt, not even in 1.5
    it needs to just get a
    count to see if they have any entries that have 0 in the hoursworked column
    and if so then it needs to just display the clock out if not then just the clockin button needs to be displayed in which case,
    1. your sql is not correct.
    2. session.getAttribute("attrName") returns an Object - is the IDNUM column of type number
    (going by the fact that you have not enclosed the value in single quotes '')
    Assuming that you have a column called 'hoursworked' in table 'timesheet' and
    IDNUM is of type NUMBER
    <%
         Integer idNum = (Integer)session.getAttribute("IDNUM");
         //from the OP ::  get a count to see if they have any entries that have 0 in the hoursworked column
         String statement = "select count(*) as CNT from TIMESHEET where IDNUM = " + idNum + " and HOURSWORKED = 0 ";
         //remaining stuff :: Look out for the error pointed out by Pgeuens
         cheers,
    ram.

  • Question about making buttons

    I've been struggling with formatting my website (http://www.lesill.com). I have posted pictures fine, but these are photos offered for sale and I can add paypal carts and add to cart buttons fine. The problem is that the Add to cart buttons, even the smallest are too big and each photo can be ordered in different sizes. I recently visited a site that has a perfect setup, but I can't figure out how to do this. The side was www.heartdogstudios.com . I have written the author asking how it was accomplished so I am hoping to hear back from him/her. If anyone here can help it would be appreciated.
    Also, are there free shipping calculators that can be added?
    Thanks Lee

    Thanks for your help anyway Brad. At least we troubleshooted
    as much as we could with it.
    I'll see if I can contact RJ through his blog since he's the
    evangalist on Captivate over at Adobe. Maybe he might know or at
    least can tell me if it's different in Captivate 4. There are so
    many new things that it's possible they are allowing quiz templates
    and more freedom with the design.
    Mine is on order as well. I can't wait!
    Thanks again,
    Kristen

  • (Please Help) making buttons clickable (layout done in photoshop)

    I am a newbie to all of this. I been trying to learn html/css
    and I am still learning it but I needed a quick way to get my
    website up and running. So, I created my layout in photoshop, I
    sliced it and imported it anything dreamweaver. I made the content
    area editable. Now I have 10 buttons that needs to be clickable. I
    was on my index.html page and use the hotspot tools to try and make
    them clickable. Indeed it did on my index page. Was I suppose to
    use the hotspot tools or was I suppose to select the image, replace
    it and then link it (when I tried that way at first, it messed the
    page and had boxes and lines everywhere, like the page was broken
    up, I really dont know what I did wrong there)
    My problem is that how do I make all 10 pages of my website
    buttons clickable without having to go to each page, like the about
    page, services page, contact page, etc.... and using the hotspot on
    all 10 pages?
    Do I have to make it as a template or something?
    Here is a picture of the problem...What did I do wrong or how
    to fix the problem?
    http://i39.tinypic.com/2ltmuzs.jpg

    So many problems, so little time. First and most importantly,
    I admire your courage to "forge ahead", but you need to start with
    the basics (some of the dreamweaver tutorials, template pages, etc.
    and learn slowly and methodically.) A well functioning site is far
    more important than a graphically pleasing site...
    There are many apparent problems based on your jpg, but can't
    address any without seeing the code.
    Buttons: If they are separate slices, they don't need image
    map "hot spots" to link them. Simply select one, and assign a link
    to it via the properties window. If you saved your entire "header
    graphic" as all one piece, and placed it into your page, that would
    be when you would want to assign "hot spots" to each section of the
    graphic, but if they are separate pieces, there is no need for the
    hot spots.
    Templates: Yes, a template is the best way to ensure each
    page functions and has the same links as the rest. If you dont have
    a template set up, you will need to assign all of your links
    separately to each page of your document. To create a template, you
    first need to create one good, functioning page, then save as
    template. Once a template, you'll need to assign which areas you
    want to be editable (usually the "content area"). The advantage of
    a template is also that if you need to make a global change to all
    of the pages somewhere down the road, the change will automatically
    update itself on all pages. After the template is created, create a
    "New page from Template".
    By the looks of your jpg image, you have a whole host of
    other problems with the way the page is set up - if you're using
    tables to compile, you aren't using them well. The more complicated
    you try to slice up a single table, the likelyhood of problems like
    you're showing multiplies exponentially - keep it simple.
    Experiment with "nested tables" to see if that helps, but DON"T
    OVERDO... If you're using css - do some reading, or try to begin
    with one of the Dreamweaver template pages to start, then slowly
    modify and test as you go - it's tricky at first.
    For that matter, if you don't have any "rollover" effect or
    anything else going on in the top area, you may be far better off
    saving it as one piece and image mapping the "hot spots" for your
    links, and it won't break apart the way you're showing.
    Keep trying, but take it slow - take a course or purchase a
    tutorial dvd - it is well worth the investment and will save you
    countless hours of frustration and "stabbing in the dark"...
    Hope that helps - don't be in such a hurry to get your site
    "live" - take your time and it will get easier...

  • Making buttons play music?

    I want to make on button play a piece of music and another one to stop the music. I manage to make buttons work for playing frames in the timeline, but how do I make the buttons play the music and stop it? I tried this http://www.flash-here.com/tutorials/flash_play_sound.html but I guess this is not action script 3.0 which I am using because it does not work...

    Thanks for the tutorial, but I think it is too advanced for my needs. My knowledge inte action script are still on a very low level so I am trying to learn by doing. This is what I have managed to do so far.
    stop();
    var snd:Sound = new popeye();
    radio_on_btn.addEventListener (MouseEvent.CLICK, play_radio_fkn);
    function play_radio_fkn (event:MouseEvent):void {
    snd.play();
    radio_off_btn.addEventListener (MouseEvent.CLICK, stop_radio_fkn);
    function stop_radio_fkn (event:MouseEvent):void {
    snd.close();
    But using close() does not work, the error message says there is no stream to close. The on-button works though. I am guessing I need a soundChannel-something. But I have a problem with the syntax and I don't know how to fit it in...

Maybe you are looking for

  • Error in Trigger ( PL/SQL: ORA-01744: inappropriate INTO)

    Hi , I've written the trigger in the following format.. As the original trigger is around 700 lines, so just format is written here.. please co-operate.. CREATE OR REPLACE TRIGGER -- AFTER UPDATE OF COL1 ON TAB1 REFERENCING NEW AS NEW OLD AS OLD FOR

  • ITunes stops working when trying to play purchased video

    Hey Everyone, For some reason whenever I try to play a video or TV program that I purchased from the iTunes store it causes iTunes to shut down and it won't play the video. It does bring up the player for a few seconds then just hangs and a few secon

  • Why won't my iPhoto pictures permanently delete?

    When I go to delete my pictures in my events album, they go into the trash, and then when I try to delete my photos from trash they get sent back into their original albums. I already tried to restart my Mac, and to delete less than 100 pictures at a

  • Tax reporting Germany

    Hi all, I have a German customer that shold start running SAP. I wonder what kind of VAT reporting do they do in Germany. They say that they have one monthly and one yearly VAT report. Could anyone please explain what reports in SAP that they need in

  • Alternate color in group footer

    Hi i am using following formula to apply alternate color in detail section, section expert, color, background color- if Remainder(recordnumber,2)=0 then RGB(223,223,223) else RGB(255,252,255) but if i apply same formula to group footer section it's n