To make a flashing effect?

Hi guys,
I am now making a pente game.
I basically have a n by n JLabels filled a JPanel and set an image of a +.
When the label gets click, then the label simply reset the image to an image that shows a black or white stone.
Now I want to make it looks cool by flashing the stones if one player can form five in a row.
I was thinking to set images to a flashing gif image but that was my last option if i can find some built-in functions that can archieve the same goal.
Can anyone help with this?
Thanks,

it's probably a lot easier making a separate class, incorporating the functionality.
somthing like this
have used JButtons - just click each button to start the flashing
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Testing
  public void buildGUI()
    FlashingButton b1 = new FlashingButton("test1.gif");
    FlashingButton b2 = new FlashingButton("test2.gif");
    FlashingButton b3 = new FlashingButton("test3.gif");
    FlashingButton b4 = new FlashingButton("test4.gif");
    JPanel panel = new JPanel(new GridLayout(1,4));
    panel.add(b1);panel.add(b2);panel.add(b3);panel.add(b4);
    JFrame f = new JFrame();
    f.getContentPane().add(panel);
    f.pack();
    f.setLocationRelativeTo(null);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setVisible(true);
  public static void main(String[] args)
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        new Testing().buildGUI();
class FlashingButton extends JButton
  ImageIcon icon;
  javax.swing.Timer timer;
  final int MAX_FLASHES = 50;//<--to test all flash
  public FlashingButton(String fileName)
    super(new ImageIcon(fileName));
    icon = new ImageIcon(fileName);
    addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent ae){
        if(timer == null)
          timer = new javax.swing.Timer(250,new ActionListener(){
            int count = 1;
            public void actionPerformed(ActionEvent ae){
              if(count % 2 == 1) setIcon(null);
              else setIcon(icon);
              count++;
              if(count > MAX_FLASHES)
                timer.stop();
                timer = null;
          timer.start();
}

Similar Messages

  • Make 3D Flash wedding photo gallery with songs

    Last week, my dearest sister got married. There were about a gazillion things to love about her wedding day… so many moments all wrapped up into one very totally unforgotten event. I took lots of wedding photos on her wedding day and wanted to give her a surprise of making her a 3D flash wedding photo gallery with wedding songs.
    As I expected, my sister was moved, many thanks she said to me. Now I just want to give my many thanks to Aneesoft 3D Flash Gallery. It is a wedding gallery making software that helped me make so gorgeous flash gallery with my sister's wedding pictures. Knowing nothing about flash making, I never thought making a splendid 3D flash gallery would be so easy. My friend, do you eager to make your own cool, awesome flash gallery now? Do you eager to sharing your wedding photos in a stunning 3D photo gallery? Let me show you the way!
    What you'll need:
    1. Wedding photos and wedding songs for your 3D flash gallery
    2. Aneesoft 3D Flash Gallery
    Step 1: Download & install Aneesoft 3D Flash Gallery
    We'll be using a very nice 3D gallery making software 'Aneesoft 3D Flash Gallery' to making a romantic wedding flash gallery with wedding photos and wedding songs, head over here and download the free trial version. Next step is to install the program.
    Step 2: Import wedding photos and edit
    You can add up to 500 photos that you want to use in your wedding photo gallery, arrange the photos as you like. Aneesoft 3D Flash Gallery supports a wide range of file formats for images, such as .jpg, .bmp, .gif. Click "Add Caption" to add title and description for your wedding photos. And you can also crop and add special effects to them to make your wedding photos more perfect
    Step 3: Choose from a variety of wedding flash gallery templates
    Aneesoft 3D Flash Gallery offer you an easy way to make a stunning wedding photo gallery by choosing from variety of flash gallery templates. A flash gallery template automatically put preset decoration to wedding gallery. When you select a preset flash gallery template, you're able to enhance it by customizing some additional settings, such as background, thumbnail effects, playback options and scrolling actions. For the adventurous users, explore the powerful advanced features and tools that gives you total control over how you compose your wedding flash photo gallery.
    Step 4: Add some wedding songs for your wedding flash gallery
    Wedding songs are a very important factor to consider when making your wedding flash photo gallery. They set the general mood and tone for your gallery, while also allowing you to express your feelings through music. You may find the perfect wedding songs out of hundreds of popular wedding songs and music through Amazon.com or iTunes.
    In this step, you can add some wedding songs as background music to play along with your wedding flash gallery. Click Add Music button to browse and add your wedding songs. You can add, remove and edit the wedding music files. And you may check the option to control the background music looping or not.
    Step 5: Preview and publish your 3D wedding flash gallery
    It is advisable that you preview the wedding flash gallery at least once, before you publish it. Click and drag mouse for scrolling and tilting the 3D flash gallery. Click on the thumbnail to zoom in and out the photos. You have several options to share and publish your 3D wedding photo gallery, such as SWF, EXE and HTML. It depends on your needs.
    OK, now your wedding flash gallery is done. What do you think of the wedding flash gallery that I made for my sister? End with my sister's sentences "Fun is not ending, romantic is not ending, and love is just beginning!" Wish your wedding pictures can also be splendid as my sister's, and your love is just beginning, enjoy!
    know more:
    http://www.aneesoft.com/win-3d-flash-gallery.html
    http://www.aneesoft.com/tutorials/3d-flash-gallery/make-wedding-flash-gallery-with-songs.h tml

    As for AS3 part of it, I am not sure your code really works. There are syntax and logical errors there.
    I think you need to take it step by step and accomplish several task in the following sequences:
    1. Write code that loads XML correctly;
    2. Write code that enables buttons;
    3. Write code that will load images on button clicks.
    The code below shows in principal what needs to be done in order to load XML and make the data in this XML available for further consumption. Also, by accomplishing this step you will iron out all the PHP vs Flash wrinkles including your XML.
    Please note, I don't know your XML structure so all the parsing issues you need to resolve yourself.
    Once you get handle on it - we, hopefully, will talk about steps 2 and 3.
    import flash.display.Loader;
    import flash.events.*;
    import flash.net.*;
    var images:XML;
    var myRequest:URLRequest;
    var myLoader:URLLoader;
    // list of image urls that will come from loaded XML
    var imageList:XMLList;
    myRequest = new URLRequest("Photography.php");
    myLoader = new URLLoader();
    myLoader.addEventListener(Event.COMPLETE, onFileLoaded);
    // suggested handler for unexpected errors - avoids some headaches
    myLoader.addEventListener(IOErrorEvent.IO_ERROR, onLoadError);
    myLoader.load(myRequest);
    // Note: all the listeners are removed
    // it is always wise to remove listeners that are needed any longer
    // to make objects eligible for arbage collection
    function onLoadError(e:IOErrorEvent):void
         trace(e.toString());
         myLoader.removeEventListener(Event.COMPLETE, onFileLoaded);
         myLoader.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
    function onFileLoaded(e:Event):void
         myLoader.removeEventListener(Event.COMPLETE, onFileLoaded);
         myLoader.removeEventListener(IOErrorEvent.IO_ERROR, onLoadError);
         images = new XML(myLoader.data);
         // only now xml is ready and you can start loading images
         imageList= images.pic;

  • Make button flash at the end of the content

    is there way to make button flash at the end of the video or auto progress the slide when the video is done?

    Put an effect on it, and time it correctly.

  • How can I tell what took someone used to make a flash...

    When I'm out surfing around I come across Flash that I'd love
    to make a one of. For example I like to do photography and I see a
    Flash window that has thumbs across the bottom and a larger picture
    on top, and then if you click on one of them you get a much larger
    pictures, I looked at the source for the page, but I can't see any
    clue as to what tool make that Flash...
    If I like what someone has created in Flash, how can I figure
    out how they made it?
    Thanks
    Kelvin

    I don't have problems with many things, but being called a
    THIEF is one of them.
    I did not say that I am helping the community move forward by
    decompiling others work.
    I did say that the community CAN move forward FASTER when
    people stop getting hung up on the idea that their code is
    something SACRED.
    If you develop something new that has never been done before,
    then you have something that you can protect.
    If you want to see how other people did it, so that you can
    better understand the different methods that can be used to do that
    one thing, you are not stealing.
    I know many people that take the same stance that I do.
    People that look at code to understand it. Most of the things I can
    do today because I looked at other peoples code. I didn't copy it,
    I took hints from methods and used them to create my own methods.
    Sometimes I decompile something, knowing how I would do it,
    to see how that person did it. If they have any hints at better
    methods that I could use to make my code faster, better. To say
    that the majority of people steal is to take the standard American
    view on the world. Americans tend to believe that everyone else is
    a thief, a crook, whose only intent is to do wrong. (I am BTW, an
    American, and I am very proud to be an American) If you step back,
    and open your views, and your code, you will find a much different
    picture painted. The majority of people aren't looking for
    something to steal, but they are forced to take methods that people
    would consider "stealing" to learn to do the things that they want
    to do.
    There are many good reasons to look at code, with or without
    the permission of the person who wrote it.
    In the end, these are my views, and I am not alone in them.
    Those are your views, and you are not alone in them. If you lose
    respect for me, then you do. I am here to help who I can help with
    the knowledge and experience that I have gained over my time as a
    web developer. I only entered these forums recently, and therefore
    don't have anywhere near as many posts as you do, but that doesn't
    make my position any less accurate. The advice I have given people
    is correct and true, and I offer up the things that others don't.
    Even if you do not believe in using decompilers, decompilers exist,
    and have their uses, therefore should be mentioned. In the end, I
    lose respect for you, who I have held in VERY high regards since I
    entered this forum, because you are closed minded, and unwilling to
    offer the full information to people who are asking.
    When I create code, I consider it open-source code. I am not
    about to try to fool myself into thinking that people can't see the
    code if I don't want them to. But why would I not want them to.
    Because I spent hours writing it myself. At least, if others see
    it, they won't have to spend as much time to get the same effect. I
    know that some of these people will take it verbatim to use in
    their projects, and not give me credit. But I don't expect credit.
    It is a few lines of code, why should I get credit for writing it,
    when I am not the first, nor the last, to write the same code.
    Please do not respond to this. We both have better things to
    do than sit and debate about the merits of open source code, and
    learning by looking.

  • How to get flash effect

    Friends,
    I have FCE 3.5.1. I sometimes insert still images in my movies. Is it possible to insert a "flash" effect that makes it appear as if a flash has gone off, leaving the image? I suppose I could do it by playing with the exposure in the timeline, but that seems cumbersome.
    Thanks!
    Steve

    You don't mean a transition, do you? If not, apply the color corrector filter to a few frames of the clip in the timeline. Keyframe the mids and whites so they go very high for a frame and then come back down.

  • Flash Effect Won't Stop

    Could someone please explain how to stop the flash effect from showing up in every frame? I used it once, and each new movie I make using still images, the flash effect is added. I can't find an option to turn it off. Thanks.

    Hi, I noticed your thread. Did you know you are on the Flash Player Forum that is for the browser plugins?
    I'm not even sure which Adobe Forum would be the best but you can choose from here:
    http://forums.adobe.com/index.jspa
    Thanks,
    eidnolb

  • Achieving a Camera Flash effect in FCE HD?

    Hello.
    I am trying to achieve a camera flash effect in FCE HD, but I don't think there is any effect that will do this. Does anybody have any ideas of how I can go about creating my own?
    Basically I have a scene where there is a group of people in the film, and I want to add sounds like a camera shutter going off, and add a corresponding number of flashes to illuminate the group for a few seconds.
    Any ideas? I am sure there was an effect like this for iMovie, but I can't find any reference to that either...

    I'd like to add to what Tom wrote...I find that two frames is just about right to produce the flash effect.
    As for the sound, start looking on the many sound effects websites out there. I'm sure you will find it and can download it for a reasonable fee. Or you can make it yourself by recording your own camera's shutter.

  • Help needed too make a flash presentation with sound

    Hi Folks,
    I've recently kicked off a 'not - for - profit' project to raise awareness of the effects of Post Traumatic Stress Disorder in Veterans.  I've been trying to make a flash video with an MP3 sound clip and slide images but I'm having makor problems with getting the file made.
    Is there anyone around that would be able to help with this project by making the presentation video for me?  I wouldn't be able to properly pay the person as funds are very restricted but I'd be happy for a credit to go in at the end of the video kisting you as 'producer', or something similar.
    This video has to be made to coincide with Veterans week in the UK  - 19-27 June 2010, so needs to be made and then uploaded ASAP.
    I can offer a nominal payment of £10, as a thank you once the file's completed and running.  I can't cope with making the file because of my disability, so I hope someone can help me.
    Regards
    RAF Veteran

    onclipevent(load)                                           
    total=_root.getbytestotal();                             
    onclipevent(enterframe)
    loaded=_root.getbytesloaded();
    current=int(loaded/total*100);
    p=""+current+"%";
    if(loaded==total)
    gotoandplay("Scene 2",1);
    sorry for getting the code and coment mixed up.

  • Can I purchase Mountain Lion and make a flash drive bootable? I do not want to install it on my Macbook Pro. I have Snow Leopard on my Macbook Pro now, and due to my hard drive needing repair I need to boot off of another source, like my flash drive.

    Can I purchase Mountain Lion and make a flash drive bootable? I do not want to install it on my Macbook Pro. I have Snow Leopard on my Macbook Pro now, and due to my hard drive needing repair, I need to boot off of another source, like my flash drive. I am in Paris and my Snow Leopard DVD is in Texas.

    Mac OS X has a built-in disk diagnostic and repair program called fsck or file system consistency check. Here’s how to verify and repair your startup disk with fsck.  As soon as you hear the startup tone, press and hold Command-S on the keyboard. Keep holding down those keys until you see a black screen with white lettering. This is called “booting into Single User Mode.”  As the Mac boots in this mode, the screen reports each step of the process. The line should end in root#.  Right after the root# prompt, enter the following: /sbin/fsck -fy
    If repairing the disk in single user mode fails, it means one of two things. Either your hard drive itself is failing (a hardware failure), or the directory damage on your hard drive is beyond the capability of the built-in repair procedures in OS X.

  • Hey guyz.. i wanna ask if i get an updated version from itunes when i plug my iPhone into the Pc, i get a letter tells me that there is an update for your iPhone ... i wanna ask is it safe to download ?? and does it make any side effects on longTerm using

    hey guyz.. i wanna ask if i get an updated version from itunes when i plug my iPhone into the Pc, i get a letter tells me that there is an update for your iPhone ... i wanna ask is it safe to download ?? and does it make any side effects on longTerm using ??

    It is safe to download if your phone is not jailbroken. Before you download it, however, take some precautions:
    Reboot your computer
    Disable your antivirus and firewall
    Connect the phone cable to a USB port directly on the computer, not a hub
    Before updating right click on the name of the phone in iTunes and choose "Backup"
    When you are given the choice choose "Download only", not "Download and Update"
    After the download completes successfully click the Update button to install it.
    Most of these steps are just being overly cautious, as most people ignore them and have no problems. But occasionally the extra steps save grief.

  • How to make adobe flash player content on websites run on safari browser of my ipad?

    How to make adobe flash player content on websites run on safari browser of my ipad?do I have to install adobe flash player on my ipad ?

    The flash add-on is not available for Safari on iOS. Never has been and in fact Adobe has ceased support for flash for mobile devices in general. Your options, depending on the specific sites:
    See if the site or sites in question have their own apps availabel in teh app store
    Look into some browsers such as Puffin adn iSwifter (there are others, I beleive). These browsers use a third server site to translate the flsh content into a form that the iPAd can use and restreams them to you. They may not work with all content.
    Use a computer capable of running flash.
    Seek a source of the conent that is designed for non flash use.

  • Make adobe flash player the preferred player when exporting indd to pdf

    Hi, I am making a pdf using indesign.  After I export to pdf, the movie files in the pdf play automatically on quicktime (when I click on them). I need them to automatically play on adobe flash player instead.  I understand I can change the rendition settings for each object in the pdf, and make adobe flash player the preferred player, but there are a hundred videos in my pdf (avi files), it would take a long time to make those changes individually; it would be much easier if when i exported from indesign, they were already set as default to open in flash player instead of quicktime within the pdf.  Any ideas appreciated.

    The export is a function of InDesign. Post your question in the forum for InDesign.

  • Hu is the name of plugin to make the film effect

    hu is the name of plugin to make the film effect.
    can halp me,thanks!

    What film effect? Grain? Grading? Film damage? There's a whole lot of them. There are plugins contained in suites such as The Foundry Tinderbox, Digieffects Delirium, Genarts Sapphire and surely even Boris and you can of course by more complex dedicated tools such as Cinelook and Magic Bullet Looks. Some grain management tools and color correction are included in AE. you can build a damaged film look manually as well. Check my old project:
    http://creation.mylenium.de/motiondesign/ae_downloads/ae_down_looks.html
    Mylenium

  • Logic does not accept key command of Play from a section. Shift   Enter makes display flashing.

    Logic does not accept key command of Play from a section. Shift   Enter makes display flashing.
    Another key command is normal.

    Hi
    If you are on a small keyboard (ie with no numbers pad) use FunctionShift Return
    or If you are on a 'numbers keyboard', the Enter key is on the right next to the 3 key (and NOT the Return Key).
    CCT

  • How to make Adobe Flash Player run faster

    how do you make adobe flash player run faster my child has a game and the game is running to slow to play/use some of the features
    please please help

    Welcome to our community
    I see this is your first post here. I'm guessing that you aren't using Adobe Captivate.
    I'm unsure exactly how you managed to end up posting your question here, but you seem to lost and unsure exactly where to post.This forum is where we help one another with the Adobe Captivate product.
    Click the link below to visit the main forums landing page. From there, you will either click an icon or click a drop-down list where you may choose from a gob of different forums. I'm guessing you want the forum for Flash Player.
    Click here to view
    Cheers... Rick

Maybe you are looking for

  • How can I select and delete the fill color (white background) of a live trace (B&W) with in an actio

    How can I select and delete the fill color (white background) of a live trace (B&W) with in an action set? Illustrator CS4 in windows XP.

  • ****Urgent**** Webservice Complex Type Handling ****Urgent****

    Hi kglad, am junior flash developer trying out webservices. So i was trying out a webservice "https://www.suhrkamp.de/webservice/suhrkamp_ws.cfc?wsdl" where i call getNews("webservicechef","remote147suhrkamp",41722) method.But even before the method

  • Dashboard manager documentation

    Hi all,   has anyone some documentation about the settings of the dashboard manager? If you have, could you please send it to [email protected]? Thanks, Daniele

  • Can I do search and replace in a batch?

    Hi, Everyone: Years ago before I start useing Indesign, I had a Chinese Desktop Prepress program named Westwinner, With tahat I could create a file putting all entries  needed to search and replace in, and search and replace all of them in one shot.

  • Memory to go website...

    Anybody use the www.memorytogo.com website to purchase memory. I noticed they have several selections for the PowerMac G5. An OEM version and Samsung. Just curious which is better? The prices seem to be pretty good compared to some of the local store