Flash ad weirdness.....help!

I've created a flash ad with an action script (simple
on-release event and the URL) and it tests fine for me, but when
submitted to the publisher that uses a CMS to create their web
pages, they claim that the ad is generating a series of
uncontrolled pop-ups. The publiser isn't forthcoming with the
details (browser and platform info) and it leaves me with a very
frustrating problem of trying to replicate the same situation, but
my tests have been without problems. QUESTION: is there an
incompatibility with certain CMS software? or is there something I
need to do to better prep my files?
See:
http://www.dcampeau.com/GQ-Button-Ad/GQ-Button-ads.htm
Any help or suggestions appreciated! And if you do have a
problem with the ad, please let me know with browser, v# and
platform. Thanks!

Interesting. I would say if your ad used an "onmouseenter" or
"onrollover", uncontrolled popups might happen in a CMS, depending
on how they display different <div>s.
If you are just using
on (release) {
getURL("
http://blah", "_blank");
- you are simply using what a lot of other ad creators have
used.
Definitely request more information about this from the
publisher... I didn't have any problems with your ad. It behaved
fine on it's testing page and popped up a window when
clicked.

Similar Messages

  • Flash CS5 Button Help

    To start, I'm a total newbie in Flash, so I'm sorry if what I'm asking is ridiculously primitive, but I was literally thrown into this blindfolded and I'm using google and several forums to help me out.
    What I'm doing:  redesigning a website.  At the moment, the website has a flash file that introduces it's logo and subcategories of its' website on the top of the page.  What I wanted to do was make sure there was a hyperlink on the logo that would bring anyone back to the homepage, very basic stuff.  The issue I have run into is that the logo is actually a flash movie.  Different parts of the logo appear at different times, and I think this is what is specifically causing me issues.
    The logo that I want to hyperlink has several layers, and what I've done so far is select them all and create a button (F8, select 'Button' and rename it).  When I did that, I noticed the layers significantly changed and when I tested the movie, it looks terrible, choppy and not how it originally looked.
    I know the step after that is to go into behaviors and insert the url to which I want it to be hyperlinked.  The only thing is that I don't want to show a terrible flash movie to my boss even if it's hyperlinked to the homepage. 
    Anyone understand all that gibberish I wrote down?  Or does anyone see a flaw in what I'm doing?  I'm not 100% positive if the steps I'm taking are correct, I've been to several different sites, all of which tell me to do different things. 
    Initially I tried coding it with ActionScript, but I was having terrible issues with that as well. 
    If it helps, the file I'm working on was altered a while back.  Could it be that the file is not compatible or proper for Flash CS5? 
    Help!!!

    ... how do I give that shape/button a url?
    Since it is a button, it is already a self animating object that will react to mouse interactions, but only visually at this stage.  The first thing you need to do to make it useful code-wise is to assign it a unique instance name.  So you drag a copy of it out to the stage from the library, and while it's still selected, you enter that unique instance name for it in the Properties panel... let's say you name it "btn1"
    In AS3, to make a button work with code, you need to add an event listener and event handler function for it.  You might need to add a few (for different events, like rollover, rollout, clicking it, but for now we'll just say you want to be able to click it to get a web page to open.  In the timeline that holds that button, in a separate actions layer that you create, in a frame numbered the same as where that button exists, you would add the event listener:
    btn1.addEventListener(MouseEvent.CLICK, btn1Click);
    The name of the unique function for processing the clicking of that button is specified at the end of the event listener assignment, so now you just have to write that function out:
    function btn1Click(evt:MouseEvent):void {
       var url:String = "http://www.awebsite.com/awebpage.html";
       var req:URLRequest = new URLRequest(url);
       navigateToURL(req);
    ... how do I know it's properly placed on the correct area?
    What area?  If you place it where you want it, that should be correct. (?)
    ... how do I make sure it's invisible...?
    If you can't see it when you test the file and you know it's there and your cursor turns into  a hand when you are over where it should be, it's invisible.
    ...how do I see the other objects in the flash file I'm working on?
    Select Edit -> Edit Document to get out of the symbol editing mode and back to the file editing mode.  If you doubleclick an object on the stage, rather than clickingit in the library, you open it up in editing mode on the stage, but the stage and everything else will still be visible behind it in a faded tone.

  • I can't open swf files for schoolwork. Installed VCL, Flip4Mac and Adobe flash and shockwave players. Can get white screen with connection erro message with adobe flash player. Help me!

    i can't open swf files for schoolwork. Installed VCL, Flip4Mac and Adobe flash and shockwave players. Can get white screen with connection erro message with adobe flash player. Help me!

    Apple dropped playback support for .swf formats in QuickTime almost ten years ago.
    Adobe Flash Player is the only way to view them.

  • I have the 10.7.4 and I cannot get the Flash Player ,, please help me.

    I have the 10.7.4 and I cannot get the Flash Player ,, please help me.

    If you downloaded it, it's likely in your Downloads folder as a Disk Image .dmg. Just open it and intall Flash player and restart your browser. Everything should work.
    Clinton

  • $$$%%%   Linking flash file PLZ HELP  $$$%%%

    hello and thankyou for whoever is reading this for taking the
    time! Im makinga band
    web site and I made flash buttons in flash 8(not the
    flash buttons in dreaweaver). now I need to add a link to each
    button. How can I do this. I see that a lot of band pages are made
    like this. take a look at www.relientk.com. Thats what im trying to
    make. Can any one help me with Ho I could link a flash file????
    linking flash FILE PLZ HELp
    thank you so much

    See your answer on the DW forum.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "beliy333" <[email protected]> wrote in
    message
    news:enffbg$c3f$[email protected]..
    > hello and thankyou for whoever is reading this for
    taking the time! Im
    > makinga
    > band
    web site and I made flash buttons in flash 8(not the
    flash
    > buttons
    > in dreaweaver). now I need to add a link to each button.
    How can I do
    > this. I
    > see that a lot of band pages are made like this. take a
    look at
    > www.relientk.com. Thats what im trying to make. Can any
    one help me with
    > Ho I
    > could link a flash file????
    >
    linking flash FILE PLZ HELp
    >
    > thank you so much
    >

  • Adobe flash webcam crash help,

    adobe flash webcam crash help,
         Hello,
              I have followed all the steps on the site,,  My webcam works on other programs, ie: yahoo, aol, skype.    The crash issue I'm having is, When I turn on my webcam through Firfox - adobe,  The webcam goes on, sometimes for only a second, sometimes for a min, so I know it works, but then every time, all the time it crashes,     Every time, on different sites,    Again I followed all the steps, including, uninstalling, and using 10.,   and then  11.2   and back to where i started with 11.3.
    Please help, and thank you for your time.
    Best wishes,
         Grant
    Problem signature:
      Problem Event Name:    APPCRASH
      Application Name:    FlashPlayerPlugin_11_3_300_262.exe
      Application Version:    11.3.300.262
      Application Timestamp:    4fe20fae
      Fault Module Name:    YCWebCameraSource.ax
      Fault Module Version:    2.0.8342.3407
      Fault Module Timestamp:    4acc3fd6
      Exception Code:    c0000005
      Exception Offset:    00004fca
      OS Version:    6.1.7601.2.1.0.256.48
      Locale ID:    1033
      Additional Information 1:    a7aa
      Additional Information 2:    a7aa91f17ea749d42a4de3b390fa5b3d
      Additional Information 3:    a7aa
      Additional Information 4:    a7aa91f17ea749d42a4de3b390fa5b3d
    Read our privacy statement online:
      http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409
    If the online privacy statement is not available, please read our privacy statement offline:
      C:\Windows\system32\en-US\erofflps.txt

    This looks like an Adobe Flash issue, not a Firefox issue. Have you tried asking in the Adobe forums? I did a quick search and found this: http://forums.adobe.com/thread/769338

  • Weird flash cs3 bug help!

    Hi ANybody help me on this?
    All of a sudden I lost a file I had been working onlast
    night, it was still there but when i opened it it was last saved
    some 12 hours before my final save of the day. Thought that was it
    and then i found something else, when flash is not open, I click on
    a file to launch the software and it causes the finder to crash /
    relaunch! But if i open the software and then open it its OK and
    works.. another weird thing is when i look at the icon of the flash
    .fla in the finder it appears as a small volume slider like a .mp3!
    now that really is scary! I tried to reinstall and no changes
    there, all i can expect to try next is a complete system reinstall?
    any ideas.
    thanks JAY

    As long as I'm understanding the issue correctly, this is a long standing "Flashism" (not saying it's right or desirable, but something that has required a workaround for a very long time). See if you can use nesting to get around the issue (the animation will restart when keyframes are encountered), I'll send this issue in for review. It's possible it has something to do with Player, although I can't find any concrete information on this to know for sure.

  • New to Flash AS3, Need help with some weird issues, have .fla link attached...

    Basically, the buttons are not visible when siteplan_mc is replayeed after floorplan closes, but they still work. Most things are only working on double click for soe reason, tho I have them to function on click. and the back button only woorks on unit 1 floorplan, tho the code it the same for all floorplans. I have a feeling it has something to do with levels... but I really have no idea... hopefully someone can help!
    thanks in advance,
    Sarah
    http://www.30eastroosevelt.com/RRHA_SITE.fla

    There are at least two things you're doing wrong. You can't go to a frame where something exists for the first time, and immediately do something to it. Like in your playunit functios for example:
    gotoAndStop("unit1")
    unit1_mc.alpha = 1
    unit1_mc hasn't yet drawn itself on stage to have its alpha set, and so there's an error. That is something that was improved in Flash 10, so if you had set the Flash to publish for Flash 10 and not Flash 9, then the floor plans and the back buttons appears ok. It would sometimes work with double clicks because by the second time you clicked, the movieclip now existed. You might be able to do what you want by having all of the room units on frame 1 of the siteplan_mc, and then set their visible to true or false as you need them, instead of doing the gotoAndStop().
    The other problem is that you're trying to set listeners on the Back buttons that don't yet exist. Wait until you're on the frame where the buttons exists, and then set its listener for the mouse click.
    Other things you're doing could be improved too, but really you might want to get together with someone who has done more AS3, to help you become more familiar with how it works.

  • Adobe Flash Player Weird Issue....

    So guys,i play a MMORPG called Dead Frontier,i always played this game normally,without any issues...but then...2 weeks ago,this annoying warning keeps appearing in the site,and i think this issue is messing up with other things in my pc...yes i have the most recently flash player version installed,and i uninstalled and installed a bunch of times,,just to see if this would fix...well nothing seems to be different...same problem...
    This warning is messing up with my game,some youtube videos i normally see,but now there are weird noises sometimes in the videos and in the MMORPG game(this weird noises is worse when i play the game),i believe this annoying noises is because this flash player issue....can someone help me how to fix this problem?i tried in alot of ways to fix,but i give up...you guys are my only hope to fix this flash player problem:
    Repeating:the warning is :"This game requires that you have Javascript turned on, and that you have Adobe Flash 9 or higher installed. Click the button below to install it (will take less than 30 seconds).:"
    i already have javasscript and he is turned on,he is updated as well,everything normally....but this warning is really annoying me,i just give up trying fix...if someone have some idea in how fix this little issue,i would be very grateful
    I don't want format my computer again,i already formated recently....help me here guys,i desperate here
    Take a look,maybe this image helps to explain....(bad english?i know,i brazilian)
    if this helps,my windows is 8.1....i just tired of trying fix this,help me someone....

    Hi Fireseed,
    Please do the following:
    Ensure you have the latest version installed:
    Launch Firefox and go to Adobe - Flash Player
    There is a widget on the page that lists the version installed, and a table listing the latest versions for each OS and browser.If you don't have the latest version, Firefox will block Flash from displaying.
    If it is installed, and you have the latest version, ensure Flash is enabled:
    Launch Firefox and go to https://helpx.adobe.com/flash-player/kb/enabling-flash-player-firefox.html
    Follow instructions for verifying Flash Player is enabled
    If it is installed, and you have the latest version, Ensure JavaScript is enabled: JavaScript settings and preferences for interactive web pages | Firefox Help
    Maria

  • Flash Game Ground HELP!

    Hello all, I just started with flash and I'm pretty new to the language.
    I am currently making a game in flash and have a sprite that needs to jump up to platforms.
    He stands on the first rectangle I made but doesn't land on the others and passes right through them.
    I have changed the character code many times to no avail. I have tried other ways but he falls through the main ground platform when I change.
    Here's the code on my character, there is no code on the platforms. (I have tried coding the platforms which don't help either)
    onClipEvent (load) {
    speed = 8;
    isJumping = false;
    jumpSpeed = 0;
    startY = _y;
    scale = _xscale;
    onClipEvent (enterFrame) {
    if (isJumping) {
    _y += jumpSpeed;
    jumpSpeed += .86;
    if (_y>=startY) {
    _y = startY;
    isJumping = false;
    speed = 8;
    } else {
    if (Key.isDown(Key.UP)) {
    isJumping = true;
    jumpSpeed = -15;
    speed = 8;
    if (Key.isDown(Key.LEFT)) {
    play();
    _x -= speed;
    _xscale = -scale;
    } else {
    if (Key.isDown(Key.RIGHT)) {
    play();
    _x += speed;
    _xscale = scale;
    } else {
    stop();
    If there is more info I can provide to help, I will.
    Thank you.

    to have a game with Gravity, Jumping, and Ground Detection, first you need to make sure you enable all of these.
    GRAVITY-
    Gravity sounds weird and tricky but its also very simple.
    Theres a simple layout of code to enable Gravity.
    onClipEvent (load) {
         var Grav:Number = 0;
         var Gravity:Number = 5;
    onClipEvent (enterFrame) {
         _y += Grav;
         Grav += Gravity;
    What that does is adds a consistent pull on the MC you place it into. Adding a Gravity like effect.
    JUMPING-
    Jumping is also very simple once you've done it once or twice, and as i seen in your code you have.
    I will add Jumping to the previous code now.
    onClipEvent (load) {
         var Grav:Number = 0;
         var Gravity:Number = 5;
         var maxJump:Number = -22
    onClipEvent (enterFrame) {
         _y += Grav;
         Grav += Gravity;
         if (Key.isDown(Key.UP)) {
         Grav = maxJump;
    The maxJump variable is the height of the jump and can be modified to your liking, REMEMBER to always have the number as a minus - since flashes y axis is backwards.
    GROUND DETECTION-
    This is something i did not see in your code, which i believe it your issue.
    Ground Detection is very simple but hard to figure out with out good know how of Flash.
    First, make your Ground convert it to a MC, name it whatever you like.
    Second, set the Instance Name of your Ground MC, to "Ground" (no brackets).
    Third make sure all of you level/games ground is within this MC or within another MC with "Ground" as the Instance Name.
    I will add the Ground Detection to the previous code now.
    onClipEvent (load) {
         var Grav:Number = 0;
         var Gravity:Number = 5;
         var maxJump:Number = -22
         var touchingGround:Boolean = false;
         var Ground:MovieClip = _root.ground;
    onClipEvent (enterFrame) {
         _y += Grav;
         Grav += Gravity;
         while (Ground.hitTest(_x, _y, true)) {
              _y -= Gravity;
              Grav = 0;
         if (Ground.hitTest(_x, _y+5, true)) {
              touchingGround = true;
         } else {
              touchingGround = false;
         if (Key.isDown(Key.UP) && touchingGround){
              Grav = maxJump;
    Take your time to learn this and study it and re-build it on your own, or just use it and add to it.
    Message was edited by: UltimateFlashxz

  • Flash video weird look on iWeb

    It's new , when i open my project iWeb 8 version 2.03 all my Flash movie look Weird. I use "Widjet and Fragment HTML" put the code inside the result very strange? The movie go like "flash faster" on, off on off on off like disco dance light faster. When i go to my web site with a last Safari 3.04 version same think?
    Only "Elf" video give me just a half video, but with firefox works very good??
    Michel

    Hi!
    I am trying really hard to do what you are trying to get rid of!
    I am new to iWeb and know very little about what coding is, but am trying to get this to happen...
    1) have "welcome" page automatically play a very short 2 or 3 second full screen video (heavily compressed I guess?)
    2) As soon as the video ends, the actual, static, welcome screen opens / shows itself.
    That's it!
    But I have no idea as to how to make it happen. Can I copy and paste the code you have in your message? I would really, really appreciate any and all help you can offer.
    Thanks!
    James

  • Can someone take a look at my project and give me ideas to reduce lag/optimize it? (relatively new to flash and need help)

    Dropbox - TV_AL_Q
    I really need to reduce the lag happening in this project. I know practically nothing about action script except for what I've used in this project so please keep that in mind.
    Im going to try and break apart the grouped art so its in its most basic form and see if that helps, and also change all my tweens to frame by frame since those two things helped me with an animation I did awhile back that was lagging severely.
    But I was hoping someone with more knowledge could take a look and see if there is anything that they know of that I could do to help fix this. I'm working in Flash cs6 and using action script 3.
    I have to turn this project in by this Friday (the 20th) so I would love to get this sorted by then but even if I can't I would still be interested in some possible solutions, just for learnings sake.
    Thanks.

    Thank you for yet another cryptic reply, remember I'm the idiot here who doesn't understand this stuff so please can you explain things in a little more detail. Thanks.
    I am using the JW Player setup assistant and it lists two types of code
    The "Embed code" and the "swfobject 1.5 code" but not an Object/Embed code that you mention.
    This is the code that the website is telling me to use.
    <script type="text/javascript" src="/embed/swfobject.js"></script>
    This text will be replaced
    <script type="text/javascript">
    var so = new SWFObject('/embed/player.swf','mpl','480','270','9');
    so.addParam('allowscriptaccess','always');
    so.addParam('allowfullscreen','true');
    so.addParam('flashvars','&file=http://web.me.com/nathmac31/Flash/WaineWeddingHD. swf');
    so.write('player');
    </script>
    My movie does play on through the player on the JW site, after about 30 seconds of waiting for the picture to appear. When I cut and paste the above code into my webpage, I don't get anything. I have dropped the "Player.swf" and "swfobject.js" files into the folder containing the contents of the page that I want the player to appear on.
    Where is the exact best place to drop these files?

  • Firefox constantly freezing due to issues with Flash. Please help.

    I was running the firefox 20 beta (and have been for a while) when in the last few days, suddenly any time I tried to open any site that used even the slightest amount of flash, the browser would freeze for minutes on end before finally releasing a "plugin error" type message about Shockwave Flash. If i clicked 'continue' it would stay frozen. If i clicked 'stop script' then sometimes it would fix it, but most of the time it would keep freezing and showing that same message over and over until I stopped the process in task manager.
    First I tried to update flash and shockwave- both are up to date. So i decided to delete the files themselves and the programs via add/remove and reinstalled them. Still did not fix the problem.
    Next I tried to do a reset firefox to default state. This didn't work. I tried doing it again with the flash files deleted/uninstalled AND I rebooted the computer and the problem still persisted.
    Finally, I tried to downgrade to a more stable version of firefox, so I downloaded 19 and it still didnt work. Tried the uninstall/re install for flash one more time and nothing.
    At this point, I cannot access about half of the pages I usually go to on the web and I need help here, please anything will do.
    One thing that I noticed that might be helpful is that no matter how many times i uninstalled or reinstalled flash, every time it would try to run, task manager would show two instances of it, each using different amount of memory.
    again, please please help. If there is any solution short of a total wipe it would be greatly appreciated

    hello, maybe it's an issue with the protected mode in the flash plugin - you could try if [https://support.mozilla.org/en-US/kb/flash-113-crashes#w_solution-2-downgrade-to-flash-10-3 downgrading to flash 10.3] (which is still supported) or [http://forums.adobe.com/thread/1018071#TemporaryWorkaround disabling protected mode] makes a difference.

  • Simon game. buttons wont flash... help!

    This is a simple "Simon" memory game, produced in GUI...........
    The main(); invokes the FIRE(); which generates random numbers , which in turns invokes one of four COLOR methods, red(), green(), yellow(), blue(); .... These methods flash one of the four buttons and are assigned their own values. when they are invoked, they pass that value to Pattern();
    Pattern (); fills an array with the random values passed from the color methods, As well as compares users entry against the array and IF user entry is accurate then increase difficulty++
    (Pattern method has poor logic in it. I would like tips on this.)
    PROBLEM: it executes nearly perfect the first time the code cycles. After that the buttons no longer flash when the FIRE(); invokes COLOR(); methods.
    THANKS IN ADVANCE FOR YOUR HELP.
    import java.io.File;
       import java.io.IOException;
       import javax.sound.sampled.AudioFormat;
       import javax.sound.sampled.AudioInputStream;
       import javax.sound.sampled.AudioSystem;
       import javax.sound.sampled.DataLine;
       import javax.sound.sampled.LineUnavailableException;
       import javax.sound.sampled.SourceDataLine;
       import java.awt.*;
       import java.awt.event.*;
       import javax.swing.*;
       import java.util.*;
        public class Simon extends JFrame implements MouseListener,ActionListener
          //static int pat=1;
          private static final int     EXTERNAL_BUFFER_SIZE = 128000;
          static JButton but1 = new JButton("Green");
          static JButton but2 = new JButton("Blue");
          static JButton but3 = new JButton("Orange");
          static JButton but4 = new JButton("Red");
          static JPanel pane1 = new JPanel();
          static JPanel pane2 = new JPanel();
          static JPanel pane3 = new JPanel();
          static JPanel pane4 = new JPanel();
          static JPanel pane5 = new JPanel();
          static JButton but5 = new JButton("Start");
          //static JLabel lab1 = new JLabel("Simon Says");
          Container con = getContentPane();
          static File soundFile = new File("hiho.wav");
          static File utopia = new File("utopia.wav");
          static File cowbell = new File("cowbell.wav");
          static File slap = new File("sound16.wav");
          static int G1=1,B2=2,Y3=3,R4=4;
          static int[] array = new int[256]; // maximum value
          static int difficulty = 3; //initial value
          static int count;
          static int x=0;
          static boolean click=false;
           public Simon()
             super("Simon Says");
             con.setLayout(new BorderLayout());
             con.add(pane5,BorderLayout.CENTER);
             con.add(pane4,BorderLayout.NORTH);
             con.add(pane3,BorderLayout.SOUTH);
             con.add(pane2,BorderLayout.EAST);
             con.add(pane1,BorderLayout.WEST);
             pane1.add(but1);
             pane2.add(but2);
             pane3.add(but3);
             pane4.add(but4);
             pane5.add(but5);
             but1.addMouseListener(this);
             but2.addMouseListener(this);
             but3.addMouseListener(this);
             but4.addMouseListener(this);
             but1.addActionListener(this);
             but2.addActionListener(this);
             but3.addActionListener(this);
             but4.addActionListener(this);
             but5.addActionListener(this);
           public static void main(String[]args)
             JFrame af = new Simon();
             af.setSize(275,135);
             Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
             af.setLocation( (screenSize.width - af.getWidth())/2,
                (screenSize.height - af.getHeight())/2 );
             af.setVisible(true);
             af.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             af.setResizable(false);
             but1.setContentAreaFilled(false);
             but1.setOpaque(true);//enabling button to changed with mouse events.
             but2.setContentAreaFilled(false);
             but2.setOpaque(true);
             but3.setContentAreaFilled(false);
             but3.setOpaque(true);
             but4.setContentAreaFilled(false);
             but4.setOpaque(true);
             but1.setBackground(Color.darkGray);
             but1.setForeground(Color.WHITE);
             but2.setBackground(Color.darkGray);
             but2.setForeground(Color.WHITE);
             but3.setBackground(Color.darkGray);
             but3.setForeground(Color.WHITE);
             but4.setBackground(Color.darkGray);
             but4.setForeground(Color.WHITE);
                // everytime the pattern fires a button it invokes a method which
                // recieves an int ... fills an array with digits. and before the int
                // is assigned a subscript a variable is incremented so the array continues
                // to cycle. 
                //store the last pattern in an array then, and do a check if they match generate new pattern.
             FIRE();
           public static void FIRE()
             for(x=0;x<difficulty;++x)
                double rnd = Math.random()*10;
                if (rnd<2.5)
                   play(soundFile);   
                   green();
                else if (rnd>=2.5&&rnd<=5.0)
                   play(utopia);
                   blue();
                else if (rnd>5.0&&rnd<=7.5)
                   play(cowbell);
                   yellow();
                else //if (rnd>7.5);
                   play(slap);
                   red();
             if(x==difficulty)
                count=0;
           public static void green()///////////////////////////////////////////////////////
             but1.setBackground(Color.GREEN);
             but1.setForeground(Color.WHITE);
             try
                Thread.sleep(200);
                 catch(InterruptedException e){}
             but1.setBackground(Color.darkGray);
             but1.setForeground(Color.WHITE);   
             try
                Thread.sleep(200);
                 catch(InterruptedException e){}
             Pattern(G1);
           public static void blue()////////////////////////////////////////////////////
             but2.setBackground(Color.BLUE);
             but2.setForeground(Color.WHITE);
             try
                Thread.sleep(200);
                 catch(InterruptedException e){}
             but2.setBackground(Color.darkGray);
             but2.setForeground(Color.WHITE);
             try
                Thread.sleep(200);
                 catch(InterruptedException e){}
             Pattern(B2); 
           public static void yellow()///////////////////////////////////////////////////////
             but3.setBackground(Color.ORANGE);
             but3.setForeground(Color.WHITE);
             try
                Thread.sleep(200);
                 catch(InterruptedException e){}
             but3.setBackground(Color.darkGray);
             but3.setForeground(Color.WHITE);
             try
                Thread.sleep(200);
                 catch(InterruptedException e){}
             Pattern(Y3); 
           public static void red()//////////////////////////////////////////////////////////
             but4.setBackground(Color.RED);
             but4.setForeground(Color.WHITE);
             try
                Thread.sleep(200);
                 catch(InterruptedException e){}
             but4.setBackground(Color.darkGray);
             but4.setForeground(Color.WHITE);
             try
                Thread.sleep(200);
                 catch(InterruptedException e){}
             Pattern(R4);
           public void mousePressed(MouseEvent e)////////////////////////////////////////////////////////////////
             //System.out.println(" Count Equals before Fire()"+count);
             Object source = e.getSource();
             if (source==but1)
                click = true;
                but1.setBackground(Color.GREEN);
                but1.setForeground(Color.WHITE);
                play(soundFile);
                Pattern(G1);
             if(source==but2)
                click = true;
                but2.setBackground(Color.BLUE);
                but2.setForeground(Color.WHITE);
                play(utopia);
                Pattern(B2);
             if (source==but3)
                click = true;
                but3.setBackground(Color.orange);
                but3.setForeground(Color.WHITE);
                play(cowbell);
                Pattern(Y3);
             if (source==but4)
                click = true;
                but4.setBackground(Color.RED);
                but4.setForeground(Color.WHITE);
                play(slap);
                Pattern(R4);
           public void mouseReleased(MouseEvent e)/////////////////////////////////////////////////////////////
             Object source = e.getSource();
             if(source==but1)
                but1.setBackground(Color.darkGray);
                but1.setForeground(Color.WHITE); 
             else if (source==but2)
                but2.setBackground(Color.darkGray);
                but2.setForeground(Color.WHITE);
             else if (source==but3)
                but3.setBackground(Color.darkGray);
                but3.setForeground(Color.WHITE);
             else if (source==but4)
                but4.setBackground(Color.darkGray);
                but4.setForeground(Color.WHITE);
           public static void Pattern(int A)/////////////////////////////////////////////////////////////
             if (x<difficulty)
                array[count]=A;
                System.out.println("Randomly generated array position "+count+"'s value is, "+A);
                ++count;
             if (x==difficulty)
                System.out.println(".....User entry at array position "+count+"'s value is, "+A);       
                if (array[count]==A&&count==difficulty-1) //if user entry is correct and the array has reached
                   NEXT();
                                                                     //array.length then invoke NEXT();    
                if (A!=array[count]/*&&count<difficulty*/&&count!=0)//poor logic: at anytime if array[count] is not equal to user entry, LOSE();        
                   LOSE();
                if (click==true)       
                   count++; 
             click =false;                
           public static void LOSE()
             System.out.println("YOU LOSE");
             System.exit(0);
           public static  void NEXT()
         //     String[] s = null;
             System.out.println("NEXT LEVEL");
             ++difficulty;
             count=0;
             x=0;
               // Simon.main((s = new String[] {"N"}));
             FIRE();
           public static void play(File soundFile)////////////////////////////////// AUDIO PLAYER
             AudioInputStream     audioInputStream = null;
             try
                audioInputStream = AudioSystem.getAudioInputStream(soundFile);
                 catch (Exception e)
                   e.printStackTrace();
                   System.exit(1);
             AudioFormat     audioFormat = audioInputStream.getFormat();
             SourceDataLine     line = null;
             DataLine.Info     info = new DataLine.Info(SourceDataLine.class,audioFormat);
             try
                line = (SourceDataLine) AudioSystem.getLine(info);
                line.open(audioFormat);
                 catch (LineUnavailableException e)
                   e.printStackTrace();
                   System.exit(1);
                 catch (Exception e)
                   e.printStackTrace();
                   System.exit(1);
             line.start();
             int     nBytesRead = 0;
             byte[]     abData = new byte[EXTERNAL_BUFFER_SIZE];
             while (nBytesRead != -1)
                try
                   nBytesRead = audioInputStream.read(abData, 0, abData.length);
                    catch (IOException e)
                      e.printStackTrace();
                if (nBytesRead >= 0)
                   int     nBytesWritten = line.write(abData, 0, nBytesRead);
          //       line.drain();
          //          line.close();
             //System.exit(0);
           private void printUsageAndExit()
             out("SimpleAudioPlayer: usage:");
             out("\tjava SimpleAudioPlayer <soundfile>");
             System.exit(1);
           private void out(String strMessage)
             System.out.println(strMessage);
           public void actionPerformed(ActionEvent e)//OVERRIDDEN INTERFACE METHODS
           public void mouseClicked(MouseEvent e)
           public void mouseEntered(MouseEvent e)
           public void mouseExited(MouseEvent e)
       }

    In the future, Swing related questions should be posted in the Swing forum.
    You don't use the Thread.sleep(...) method in the GUI Event Thread, it prevents the GUI from responding to events and repainting itself.
    Use a Swing Timer to schedule the frequency of whatever you are doing.

  • Cant view photos except one at a time??, and other iphoto weirdness, help!

    My iphoto is crazy, it does weird stuff all the time. A few months ago it started randomly eating pictures and a grey block would show up where they used to be. Just recently when I open an event i I can only look at the pics one at a time, not like smaller pictures in rows, where you can select them and do stuff with them. I don't know why it is different!!! I would think I could just change something under view and fix it, but nothing seems to help. Please someone help!

    Welcome to the Apple Discussions.
    Just recently when I open an event i I can only look at the pics one at a time, not like smaller pictures in rows,
    There's a slider lower right of the iPhoto Window - drag it left.
    A few months ago it started randomly eating pictures and a grey block would show up where they used to be.
    Try these in order - from best option on down...
    1. Do you have an up-to-date back up? If so, try copy the library6.iphoto file from the back up to the iPhoto Library (Right Click -> Show Package Contents) allowing it to overwrite the damaged file.
    2. Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
    3. If neither of these work then you'll need to create and populate a new library.
    To create and populate a new *iPhoto 08* library:
    Note this will give you a working library with the same Events and pictures as before, however, you will lose your albums, keywords, modified versions, books, calendars etc.
    In the iPhoto Preferences -> Events Uncheck the box at 'Imported Items from the Finder'
    Move the iPhoto Library to the desktop
    Launch iPhoto. It will ask if you wish to create a new Library. Say Yes.
    Go into the iPhoto Library (Right Click -> Show Package Contents) on your desktop and find the Originals folder. From the Originals folder drag the individual Event Folders to the iPhoto Window and it will recreate them in the new library.
    When you're sure all is well you can delete the iPhoto Library on your desktop.
    In the future, in addition to your usual back up routine, you might like to make a copy of the library6.iPhoto file whenever you have made changes to the library as protection against database corruption.
    Regards
    TD

Maybe you are looking for