Sound and Loop Counter

Hi all - here's a quick rundown of what I'm trying to do...
The project: A looping banner animation with audio event
sounds
Background: I currently have event sounds of a camera-click
and an audio transition between 5 mc's on my main timeline. I'm
trying to find a way to disable the audio sounds once the movie
plays through one time.
The problem: I can't get my head around it. Do I use a
counter that initiates on the first frame of the loop and next time
it comes through it disables sound or unloads a mc or what?
The sample: You can view the animation here:
http://66.187.132.180/cherryhillevents/
Basically, I want to have the animation play one time - then
on the next pass through - disable the sounds. Thanks for help on
this.

NicknameAlreadyTaken,
> I currently have event sounds of a camera-click
> and an audio transition between 5 mc's on my
> main timeline. I'm trying to find a way to disable
> the audio sounds once the movie plays through
> one time.
Okay.
> The problem: I can't get my head around it.
Free yourself from the timeline, my friend! :) Use
ActionScript to
trigger those sounds, and you'll have complete control over
when they're
triggered. You mentioned a counter, and that makes good
sense. You could
set up a variable in the first frame ...
var counter:Number = 0;
... and set up your Sound instances as you need them. All you
need is an
instance of the Sound class (just like your movie clips are
instances of the
MovieClip class). Put something like this also in frame 1:
var cameraClick:Sound = new Sound();
cameraClick.attachSound("nameOfLibraryCameraSoundLinkageID");
var audioTrans:Sound = new Sound();
audioTransSound.attachSound("nameOfOtherLibrarySoundLinkageID");
In later frames, check that counter's value before you play
a sound:
// frame 20, say
if (counter < 1) {
cameraClick.start();
In your last frame, increment the counter by one, and
gotoAndPlay(2).
Why 2? Because if you go back to the very beginning, you'll
re-initialize
that counter to zero.
Make sense?
Alternatively, you could globally turn down the volume for
all sounds
after the first loop. ActionScript usually gives you half a
dozen ways to
accomlish a given goal. ;)
Here are some short articles that may help you in this
particular
endeavor.
http://www.quip.net/blog/2006/flash/how-to-loop-three-times
http://www.quip.net/blog/2006/flash/actionscript-20/understanding-the-sound-constructor
http://www.quip.net/blog/2006/flash/how-to-toggle-sound-globally
http://www.quip.net/blog/2006/flash/actionscript-20/ojects-building-blocks
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/
"Luck is the residue of good design."

Similar Messages

  • I just updated my Mac Mini to latest software, tried updating GarageBand. It downloaded but now it gets stuck downloading the 'essential sounds and loops'. It always worked fine before I updated and would really appreciate some help. Thanks

    I just updated my Mac Mini to latest software, tried updating GarageBand. It downloaded but now it gets stuck downloading the 'essential sounds and loops'. It always worked fine before I updated and would really appreciate some help. Thanks

    I just updated my Mac Mini to latest software
    You mean, MacOS X 10.9.2 and GarageBand 10.0.2?
    How far does the download proceed? Do you get an error message?
    Try to resume the download as described here:  http://support.apple.com/kb/HT4485

  • How do i add more sounds and loops  the link is grey and won't let me select it

    how do i buy more loops and sounds on my garage band 11 the link is grey and wont let me select it

    the link is grey and wont let me select it
    What is your GarageBand version? In GarageBand 10.0 you can buy more sounds by an in-app purchase. If this link is greyed out, you either already bought it and should see "Restore Purchase" instead, or you are in a a country, where you cannot update GarageBand, because you bought it in a differnet country.
    To check, if you already have installed the in-app purchase, select a Drummer track and open the Library panel. If you have more than the one drummer "socal", you already have the in-app purchase installed.
    Another way to get more sounds and loops is to buy MainStage. This will give you the loops and sounds that come with the Jam Packs, plus many Logic sounds.

  • Is there any way to have a COMPLETE list of all samples and loops ( Logic 8

    I'm sure it's been posted previously, but anyway, I'm looking to buy new Apple Loops libraries and I have faced the fact , that many of the sounds and loops produced by third parties manufacturers have been already included in Logic installation discs.
    I have a list of Apple Loops DVD's that have been included with Logic somewhere, the problem is, Apple didn't post ( I believe) the credits of all 3rd party manufacturers that have produced these libraries that are included with Logic or Garage band. Is there any way to have a COMPLETE list of all samples and loops that are included with Apple DAW's so I wouldn't duplicate anything ? I'm pretty much positive that Apple had other companies to sound design and sample all libraries for them, so is there also a way to have a list of those manufacturers? Again, the objection is to start upgrading the sound library without any possible duplication?
    Thanks in advance!

    Chris, I certainly don't mind additional questions and postings.
    I believe there are many issues with Apple Loops and Logic that need to be resolved and people need to be aware of that. Unfortunately, in opposite to the old "german" version of Logic , there's no lifetime tech support, you can't even call and ask the question after 60 days , which isn't right for a professional software of this level, especially considering the fact that many things still remain vague in Logic even for developers and tech support people!( believe me, I've called and asked!)
    Issues like that need to be resolved over the phone with the company, period!
    One thing I also learned over the years as a Mac OSX user, if something doesn't work, don't mess with it. Delete your drive and re-install everything. This is very frustrating , I know, but unfortunately this is the only way to deal with OSX issues, if you got a problem with your system, don't try to fix it. It's never gonna be the same again. I know , it's off the topic a little bit, but if your content is missing from the system files, before installing your new Logic, back up your important files, wipe up your drive and clean install Mac OSX , run updates and then install the Logic. Most likely , everything will be in it's place, at least 90% or more. I gave up trying to make two system in my house to be compatible 100% , but it's OK if they're 90% or more identical. I spent enormous amount of time trying to find out what's missing and where, I visited most of the forums and there's no clean answer.
    Message was edited by: Moderator

  • Resetting a for loop counter and restarting the computation

    I have a while loop nested inside a for loop to do a calculation of a model. 
    Lets say I am on the for loop counter 4. Suppose I wanted to keep track of the number of iterations on one the while loop, and if it exceeded a certain number say 100, exit the while loop.  I am doing this to avoid my model calculation being stuck at a spot due to optimization issues. I now want to restart the calculations of for loop counter 4. 
    Is there a way to do this in labview? 
    Solved!
    Go to Solution.

    Well first of all, if you are going to restart the loop with the same program inside it after it got stuck is it not just going to get stuck again creating a permanent loop in the code? Would you not just want to move on and have some sort of identifier that one of the for-loops got stuck?
    But I would recommend simply nesting your while-loop inside of another while loop, then connect the exit for the out while-loop to some variable from the inner while-loop, so if the optimization did not occur properly then it simply repeats the inner while-loop.
    Although I stick by my thoughts that you will just end up in a permanent loop if the optimization fails the first time.

  • I just bought 15' Mac book pro. as i work a lot on Garageband. I even downloaded all the drummers and loops to update the new Garageband 10.0.1 now my problem is that all my past work which i did on older version on GB, has missing sounds in it.

    I just bought 15' Mac book pro. as i work a lot on Garageband. I even downloaded all the drummers and loops to update the new Garageband 10.0.1
    now my problem is that all my past work which i did on older version on GB, has missing sounds in it. so here are my questions
    1. DO i have to install JAMPACKS on my new Macbook pro?
    2. Are JAMPACKS still compatable with the new GB?
    3. There is an UPDATE on the new GB on Appstore and once i click it, it goes to billing no detail is provided what this update is for so help!
    thanks

    3. There is an UPDATE on the new GB on Appstore and once i click it, it goes to billing no detail is provided what this update is for so help!
    See: This document explains what the in-App purchase is about.
    Expanding GarageBand for Mac (v10.0) content with an in-app purchase
    Do you still have your old Mac?
    How did you migrate from the old Mac to the new Mac? Did you transfer your old software and documents using Setup Assistant? Then your old GarageBand '11 version should have been migrated, and all your instruments.
    if you did  not migrate GarageBand '11, copy your old Instruments Library and Loop Library over from the old mac. Copy the following folders to a thumbsdrive and merge the missing dontents into the corresponding folders on your new mac:  (from the system library - the top level library folder on your Macintosh HD):
    /Library/Application Support/GarageBand/
    /Library/Audio/Apple Loops/
    And if you would like to continue to use GarageBand '11 for access to missing features, copy also /Applications/GarageBand over, but to a subfolder of Applications. I recommend, to install the old GarageBand as well. It can be used in parallel to GB 10.0, and will come in handy, if your old projects are having problems.
    1. DO i have to install JAMPACKS on my new Macbook pro?
    2. Are JAMPACKS still compatable with the new GB?
    The JamPacks are nice to have, a terrific collection of instruments and loops, but if you did not have them previously, that will not help with your missing instruments. You can instll them by buying Mainstage 3. They work well with GarageBand 10.0
    -- Léonie

  • When I play videos on itunes for my PC, a black screen comes up and there's sound for a few seconds, but it stops and the counter skips to 11-

    When I play videos or TV shows on itunes for my PC, a black screen comes up and there's sound for a few seconds, but it stops and the counter skips to -11...

    Welcome to Apple Discussions!
    Does this happen with all videos?
    Do purchased songs play fine on your iPod?
    Does the sample video here (for the iPod) work?
    Quicktime: Sample Files
    Is the software on your computer and iPod up to date?
    iTunes
    iPod Updater
    Update iPod's Software
    Have you tried the Five Rs
    btabz

  • How can I stop a sound from looping so it plays only once each time the up key is pressed?

    Hi there here is my code, the basis is it is playing a mp3 from my library.
    Basically as the topic suggests I only want the sound to play once each time the UP arrow key is pressed. At the moment when you hold the up arrow down the sound keeps triggering and looping and gets really loud and noisy.
    Here is my code for my game:
    package com.chasegame.components
              import flash.display.MovieClip;
              import flash.display.Stage;
              import flash.events.Event;
              import com.tech.utils.KeyObject;
              import flash.ui.Keyboard;
              import flash.media.Sound;
              import flash.media.SoundChannel;
              public class SpaceShip extends MovieClip
                        private var key:KeyObject;
                        private var speed:Number = 0.3;
                        private var rotateSpeed:Number = 5;
                        private var vx:Number = 0;
                        private var vy:Number = 0;
                        private var friction:Number = 0.95;
                        private var shipSound:roar = new roar();
                        private var shipSoundChannel:SoundChannel = new SoundChannel();
                        public function SpaceShip () : void
                                            key = new KeyObject(stage);
                                            addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
                        public function loop(e:Event) : void
                                            if (key.isDown(Keyboard.UP))
                                                           vy += Math.sin(degreesToRadians(rotation)) * speed;
                                                           vx += Math.cos(degreesToRadians(rotation)) * speed;
                                                           shipSoundChannel = shipSound.play();
                             else
                                                           vy *= friction;
                                                           vx *= friction;
                                  if (key.isDown(Keyboard.RIGHT))
                                            rotation += rotateSpeed;
                                  else if (key.isDown(Keyboard.LEFT))
                                            rotation -= rotateSpeed;
                                  y += vy;
                                  x += vx;
                                  if (x > stage.stageWidth)
                                            x = 0;
                                  else if (x < 0)
                                            x = stage.stageWidth;
                                  if (y > stage.stageHeight)
                                            y = 0;
                                  else if (y < 0)
                                            y = stage.stageHeight;
                        public function degreesToRadians(degrees:Number) : Number
                                  return degrees * Math.PI / 180;

    If you want the sound to only play once when the key is pressed then you don't want to have it in the ENTER_FRAME event handler like you have it.  It is starting new sounds at the frame rate of your file the way you have it now.
    Try having an event listener dedicated to a KeyboardEvent.KEY_DOWN event where you detect when the UP key gets pressed and use that to trigger playing the sound.

  • How to get the table_name and its count(*) in a SQL

    Hi,
    Can anybody tell me how to write a sql to get the table_name and its count(*) in a SQL:
    Output should be:
    table_name count(*)
    XXX 261723
    YYY 3343
    Regards,
    G. Rajakumar.

    hello
    there r a lot ways
    i'll suggest u two of them
    1) the following dynamic sql procedure
    DECLARE
    TYPE array_type IS TABLE OF VARCHAR(30);
    TYPE cur_typ IS REF CURSOR;
    c1 cur_typ;
    count1 integer;
    tab_arr array_type;
    querystr varchar2(200);
    begin
    SELECT table_name bulk collect into tab_arr FROM sys.all_all_tables ;
    FOR I IN tab_arr.first..tab_arr.last LOOP
    DBMS_OUTPUT.PUT(TAB_ARR(I));
    querystr := 'select count(*) from ' ||TAB_ARR(I);
    open c1 for querystr;
    fetch c1 into count1;
    EXIT WHEN c1%NOTFOUND;
    dbms_output.put_line(count1);
    END LOOP;
    close c1;
    END;
    2) or use ANALYZE to analyze the tables and get the number of rows in the NUM_ROW column of DBA_TABLES view.
    if u still have any problem mail me at [email protected]
    shalini

  • How to place a sound and player in dreamweaver?

    After a while I make a website again and I forgot what the
    best way is to place a soundfile (MP3) in a webpage in dreamweaver.
    Important is that the sound can loop and that there is a player in
    the page to turn the sound off.
    I tried 'insert flash video' in dreamweaver after I encode
    the soundfile/ a song in Flash encoder.
    Afterwards I insert it in the page in Dreamweaver and I chose
    the Corona skin 1. By testing the page in firefox I heard the sound
    but I didn't see the player. What's wrong?
    Is there a better way to put a soundfile in a page than
    flash? It doesn't have to be flash, as long as the sound plays and
    there is a player to turn it off

    Have a look at Wimpy audio player or the Wimpy Button. This
    will work well
    even if visitor doesn't have an mp3 audio player installed on
    their system.
    http://www.wimpyplayer.com/affiliates/idevaffiliate.php?id=836
    --Nancy O.
    Alt-Web Design & Publishing
    www.alt-web.com
    "sjoerdrietman" <[email protected]> wrote in
    message
    news:gd4duq$fi2$[email protected]..
    > After a while I make a website again and I forgot what
    the best way is to
    place
    > a soundfile (MP3) in a webpage in dreamweaver. Important
    is that the sound
    can
    > loop and that there is a player in the page to turn the
    sound off.
    >
    > I tried 'insert flash video' in dreamweaver after I
    encode the soundfile/
    a
    > song in Flash encoder.
    > Afterwards I insert it in the page in Dreamweaver and I
    chose the Corona
    skin
    > 1. By testing the page in firefox I heard the sound but
    I didn't see the
    > player. What's wrong?
    >
    > Is there a better way to put a soundfile in a page than
    flash? It doesn't
    have
    > to be flash, as long as the sound plays and there is a
    player to turn it
    off
    >

  • LabVIEW 6.1 If For Loop count terminal is zero then value going through the loop is not passed on to the output of the loop

    Hello, one of our customers just encountered an execution error in a vi running under LabVIEW 6.1, which doesn't exist under LabVIEW 5.1 or 6.01. I have a simple vi that has two encapsulated For Loops. Two string arrays go in, one goes out of the outer loop. Inside the outer loop the first array is indexed. The string which results from this indexing is compared with all other strings from the second string array in the inner loop. If it matches one of the strings of the second array, it is not outputted, otherwise this string goes through the inner For Loop to the output of the inner loop and from there to the output of the outer loop. The count
    terminal of the outer/inner loop is connected to the Array Size of the first/second string array. If the second array is empty, that means that the element in test from the first arry cannot match anything from the second array, so the element in test is send to the output of the inner loop and from there to the output of the outer loop. This works fine in LabVIEW 5.1 and 6.01, but NOT in LabVIEW 6.1. In LabVIEW 6.1 the inner loop is never executed if the count value is zero (which is correct), but the data line running through the loop is not executed either, which is different to what LabVIEW 5.1 and 6.01 do. There, the input string is sent to the output of the inner loop correctly even if the loop counter is zero. The solution is easy - I just have to connect the output of the outer loop to the data line BEFORE it enters the inner loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is supposed to be a feature, but it brings some incompatibility in programming between the
    different LabVIEW versions.
    Best regards,
    Gabsi

    Hi,
    When a for-loop runs zero times, all outputs are 'undefined' (and should
    be).
    Besides, how would LV know what the output of a not executed routine should
    be?
    It might be handled differently in LV5 and LV6, which is unfortunate. In
    both cases, the result is undefined.
    It's not a bug. It's just something that should be avoided in any LV
    version.
    > The solution is easy - I just have to connect the
    > output of the outer loop to the data line BEFORE it enters the inner
    > loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is
    In some cases this does the trick. But if the data is changed in the inner
    loop, this will effect the results if the N is not zero.
    Technically, I think the output in this construction is also 'undefined'.
    But LV handles this as expected / desired.
    Another solution is to use a shift register. If N is zero, the input is
    directly passed through to the output.
    Regards,
    Wiebe.
    "Gabs" wrote in message
    news:[email protected]...
    > LabVIEW 6.1 If For Loop count terminal is zero then value going
    > through the loop is not passed on to the output of the loop
    >
    > Hello, one of our customers just encountered an execution error in a
    > vi running under LabVIEW 6.1, which doesn't exist under LabVIEW 5.1 or
    > 6.01. I have a simple vi that has two encapsulated For Loops. Two
    > string arrays go in, one goes out of the outer loop. Inside the outer
    > loop the first array is indexed. The string which results from this
    > indexing is compared with all other strings from the second string
    > array in the inner loop. If it matches one of the strings of the
    > second array, it is not outputted, otherwise this string goes through
    > the inner For Loop to the output of the inner loop and from there to
    > the output of the outer loop. The count terminal of the outer/inner
    > loop is connected to the Array Size of the first/second string array.
    > If the second array is empty, that means that the element in test from
    > the first arry cannot match anything from the second array, so the
    > element in test is send to the output of the inner loop and from there
    > to the output of the outer loop. This works fine in LabVIEW 5.1 and
    > 6.01, but NOT in LabVIEW 6.1. In LabVIEW 6.1 the inner loop is never
    > executed if the count value is zero (which is correct), but the data
    > line running through the loop is not executed either, which is
    > different to what LabVIEW 5.1 and 6.01 do. There, the input string is
    > sent to the output of the inner loop correctly even if the loop
    > counter is zero. The solution is easy - I just have to connect the
    > output of the outer loop to the data line BEFORE it enters the inner
    > loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is
    > supposed to be a feature, but it brings some incompatibility in
    > programming between the different LabVIEW versions.
    > Best regards,
    > Gabsi

  • Using FOR .. LOOP counter in handling of PL/SQL procedures with nest. table

    Hi all!
    I'm learning PL/SQL on Steve Bobrovsky's book (specified below sample is from it) and I've a question.
    In the procedure of specified below program used an integer variable currentElement to get reference to the row of nested table of %ROWTYPE datatype.
    Meanwhile, the program itself uses a common FOR .. LOOP counter i.
    DECLARE
    TYPE partsTable IS TABLE OF parts%ROWTYPE;
    tempParts partsTable := partsTable();
    CURSOR selectedParts IS
      SELECT * FROM parts ORDER BY id;
    currentPart selectedParts%ROWTYPE;
    currentElement INTEGER;
    PROCEDURE printParts(p_title IN VARCHAR2, p_collection IN partsTable) IS
      BEGIN
       DBMS_OUTPUT.PUT_LINE(' ');
       DBMS_OUTPUT.PUT_LINE(p_title || ' elements: ' || p_collection.COUNT);
       currentElement := p_collection.FIRST;
       FOR i IN 1 .. p_collection.COUNT
       LOOP
        DBMS_OUTPUT.PUT('Element #' || currentElement || ' is ');
         IF tempParts(currentElement).id IS NULL THEN DBMS_OUTPUT.PUT_LINE('an empty element.');
         ELSE DBMS_OUTPUT.PUT_LINE('ID: ' || tempParts(currentElement).id || ' DESCRIPTION: ' || tempParts(currentElement).description);
         END IF;
        currentElement := p_collection.NEXT(currentElement);
       END LOOP;
    END printParts;
    BEGIN
    FOR currentPart IN selectedParts
    LOOP
      tempParts.EXTEND(2);
      tempParts(tempParts.LAST) := currentPart;
    END LOOP;
    printParts('Densely populated', tempParts);
    FOR i IN 1 .. tempParts.COUNT
    LOOP
      IF tempParts(i).id is NULL THEN tempParts.DELETE(i);
      END IF;
    END LOOP;
    FOR i IN 1 .. 50
    LOOP
      DBMS_OUTPUT.PUT('-');
    END LOOP;
    printParts('Sparsely populated', tempParts);
    END;
    /When I've substituted an INTEGER global variable with such FOR .. LOOP counter, an APEX have returned an error "ORA-01403: no data found".
    DECLARE
    TYPE partsTable IS TABLE OF parts%ROWTYPE;
    tempParts partsTable := partsTable();
    CURSOR selectedParts IS
      SELECT * FROM parts ORDER BY id;
    currentPart selectedParts%ROWTYPE;
    PROCEDURE printParts(p_title IN VARCHAR2, p_collection IN partsTable) IS
      BEGIN
       DBMS_OUTPUT.PUT_LINE(' ');
       DBMS_OUTPUT.PUT_LINE(p_title || ' elements: ' || p_collection.COUNT);
       FOR i IN 1 .. p_collection.COUNT
       LOOP
        DBMS_OUTPUT.PUT('Element is ');
         IF tempParts(i).id IS NULL THEN DBMS_OUTPUT.PUT_LINE('an empty element.');
         ELSE DBMS_OUTPUT.PUT_LINE('ID: ' || tempParts(i).id || ' DESCRIPTION: ' || tempParts(i).description);
         END IF;
       END LOOP;
    END printParts;
    BEGIN
    FOR currentPart IN selectedParts
    LOOP
      tempParts.EXTEND(2);
      tempParts(tempParts.LAST) := currentPart;
    END LOOP;
    printParts('Densely populated', tempParts);
    FOR i IN 1 .. tempParts.COUNT
    LOOP
      IF tempParts(i).id is NULL THEN tempParts.DELETE(i);
      END IF;
    END LOOP;
    FOR i IN 1 .. 50
    LOOP
      DBMS_OUTPUT.PUT('-');
    END LOOP;
    printParts('Sparsely populated', tempParts);
    END;
    /When I've tried to handle this code in SQL*Plus, the following picture have appeared:
    Densely populated elements: 10
    Element is an empty element.
    Element is ID: 1 DESCRIPTION: Fax Machine
    Element is an empty element.
    Element is ID: 2 DESCRIPTION: Copy Machine
    Element is an empty element.
    Element is ID: 3 DESCRIPTION: Laptop PC
    Element is an empty element.
    Element is ID: 4 DESCRIPTION: Desktop PC
    Element is an empty element.
    Element is ID: 5 DESCRIPTION: Scanner
    Sparsely populated elements: 5
    DECLARE
    ERROR at line 1:                                 
    ORA-01403: no data found                         
    ORA-06512: at line 14                            
    ORA-06512: at line 35What's wrong in code(or what I have not understood)? Help please!

    942736 wrote:
    What's wrong in code(or what I have not understood)? Help please!First code. You have collection of 10 elements:
    1 - null
    2 - populated
    3 - null
    4 - populated
    5 - null
    6 - populated
    7 - null
    8 - populated
    9 - null
    10 - populated
    Then you delete null elements and have 5 element collection
    2 - populated
    4 - populated
    6 - populated
    8 - populated
    10 - populated
    Now you execute:
    printParts('Sparsely populated', tempParts);Inside procedure you execute:
    currentElement := p_collection.FIRST;
    This assingns currentElement value 2. Then procedure loops 5 times (collection element count is 5). Element 2 exists. Inside loop procedure executes:
    currentElement := p_collection.NEXT(currentElement);
    which assigns currentElement values 4,6,8,10 - all existing elements.
    Now second code. Everything is OK until you delete null elements. Again we have:
    2 - populated
    4 - populated
    6 - populated
    8 - populated
    10 - populated
    Again you execute:
    printParts('Sparsely populated', tempParts);Now procedure loops 5 times (i values are 1,2,3,4,5):
    FOR i IN 1 .. p_collection.COUNT
    Very first iteration assingns i value 1. And since collection has no element with substript 1 procedure raises no data found.
    SY.

  • Synchronizing sound and image for splash screen.

    Hello all,
    I have a peculiar request. ...
    I have a sound file (about 137KB) and an animated gif (about 134KB).
    I would like to use this as my splash window before my app starts up.
    I know how to load these 2 to a screen but my problem is how do I synchronize the sound to go along with the image when it starts up? (Its a gunshot sound, whcih is looped with the animated image showing the bullet holes ;-)
    I've been investigating using the Timer class but no success to date.
    Currently, the sound file loads up, starts and then a few seconds later the image..
    So.... How do I:
    1. Load the sound first.
    2. Load the image.
    3. Start both of them synchronized.

    This is actually pretty involved...
    Are you using java.applet.AudioClip to play the sound? Are you loading the animated gif as a JLabel or something using ImageIcon?
    If you are using AudioClip for the audio, I suggest that you cache the sound and image before playing the sound... otherwise you'll probably hear pops or the sound will pause. To cache the sound, do this:
    AudioClip clip = Applet.newAudioClip("somefile");
    Unfortunately, java really sucks at handling animated gifs. On slower computers, I've seen it take about 15-20 seconds to load an animated gif that's around 90k in size... totally unacceptable! If you have a gif that just plays a once (or a few times) and then stops, you'll have to flush the graphic to restart the image. This will reload the file and cause the long delay every time you need to replay the gif.
    It seems like the best thing to do is to break up the animated gif into frames (either put each frame in its own file, or place each frame into one large image file and use clip rectangles to retrieve frames) and handle the animation yourself with your own thread. Alternatively, you can use the GifDecoder utility available at http://www.fmsware.com/stuff/gif.html, but be careful when using GifDecoder, it eats up a lot of memory for larger Gif files. When you handle the animation yourself, things should work properly. Again, make sure to cache the images by doing something like:
    ImageIcon ii = new ImageIcon("somefile");
    Once everything is preloaded, things should be pretty much synchronized if you play the sound and then show the image.
    To have more control, you may have to use an object with synchronized methods... like if you want a sound to play on the 3rd and 10th frame of animation. Another option is to use Quicktime for Java.
    If you need more info, let me know!

  • Screensaver, system sounds and itunes problem

    I did all the updates and even used migration assistant so my computer has been through allot already. I do not know which update affected my screen saver and optical audio but my screen saver is having the same issue with two monitors. My VGA monitor displays photos when the screen saver kicks in but my macbook just says looking for pictures. I tried reseting pram, repairing permissions and "safe boot" but nothing works. My optical audio somehow messes with my system sounds and iTunes on first song or podcast played. Sometimes the progress bar will freeze and I can't move it.(the time counter for a track in iTunes). The system sound works off and on when I use optical audio out to my stereo receiver. I talked to apple care and the genius bar and they said I might need to archive and install from the recovery discs that came with my computer. I think if I did that and did all the updates then the problem would return because I think it is a firmware or software update problem and not third party software interacting with the system.

    iTunes shouldn't do that. Normally when iTunes finds that it would like to move/rename a file after download or a tag edit, and the filename it wants to use is already in use, it adds a " 1" or " 2" to the end of the filename. It does not overwrite the original file. In fact if it had reused the filename then there would be two entries in your library, which would both have the same information and content. Is this the case? How exactly is the title of the film spelt?
    File & folder names are limited to 40 characters in Windows so I would expect (judging by the titles given in the store) to find the movies in a folder called:
    Harry Potter and the Deathly Hallows - P
    and to be called
    Harry Potter and the Deathly Hallows.m4v and
    Harry Potter and the Deathly Hallo 1.m4v
    Hopefully you have a backup of the missing file as, in principle, you are only allowed to create one copy using the redemption code.
    tt2

  • Error in sql query as "loop has run more times than expected (Loop Counter went negative)"

    Hello,
    When I run the query as below
    DECLARE @LoopCount int
    SET @LoopCount = (SELECT Count(*) FROM KC_PaymentTransactionIDConversion with (nolock) Where KC_Transaction_ID is NULL and TransactionYear is NOT NULL)
    WHILE (
        SELECT Count(*)
        FROM KC_PaymentTransactionIDConversion with (nolock)
        Where KC_Transaction_ID is NULL
        and TransactionYear is NOT NULL
    ) > 0
    BEGIN
        IF @LoopCount < 0
            RAISERROR ('Issue with data in KC_PaymentTransactionIDConversion, loop has run more times than expected (Loop Counter went negative).', -- Message text.
                   16, -- Severity.
                   1 -- State.
    SET @LoopCount = @LoopCount - 1
    end
    I am getting error as "loop has run more times than expected (Loop Counter went negative)"
    Could any one help on this issue ASAP.
    Thanks ,
    Vinay

    Hi Vinay,
    According to your code above, the error message make sense. Because once the value returned by “SELECT Count(*)  FROM KC_PaymentTransactionIDConversion with (nolock) Where KC_Transaction_ID is NULL and TransactionYear is NOT NULL” is bigger than 0,
    then decrease @LoopCount. Without changing the table data, the returned value always bigger than 0, always decrease @LoopCount until it's negative and raise the error.
    To fix this issue with the current information, we should make the following modification:
    Change the code
    WHILE (
    SELECT Count(*)
    FROM KC_PaymentTransactionIDConversion with (nolock)
    Where KC_Transaction_ID is NULL
    and TransactionYear is NOT NULL
    ) > 0
    To
    WHILE @LoopCount > 0
    Besides, since the current query is senseless, please modify the query based on your requirement.
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for

  • How to clear open posting change notices (Movt type 309)

    Hi, I want to clear the open PCN's created with mov type 309 (Posting change, general) being shown in LL01. All these posting change quantity are positive. I am not able to nullify them because there is no stock of those materials. Whenever I try to

  • CME and user services

    Can someone please tell me if CME allows users to configure their own speed dials and services using a url like on the CCM? If possible, can you please let me know what I would have to configure to allow this functionality? Thank you.

  • Strange Battery Malfunction

    Here is my situation... Recently my 3 1/2 year old powerbook G4 17 inch battery went out. When I would plug it in the plug adapter light would turn green then orange immediately. If i press the power button (just on quick press) it would turn green,

  • How to remove an app from my printer

    How to remove an app from my hp5510 printer

  • Why can't I read this ZipFile?

    hi, this code looks right to me, but it will not read anything. I have a zipfile, called 'cdtemp.001' which has only 1 zip entry, called 'cdtemp.x001', which i am trying to read some bytes from. Here is the code:                byte temp[] = new byte