Accessing Sound on Timeline in AS3

I have a very simple fla consisting of a picture and a sound on separate timelines. In AS3, I want to determine the sound is complete and go to another URL. I have the code for changing URLs working in a separate function. What I can't figure out is how to get the soundComplete to work when I'm not playing the sound with ActionScript. I'm sure this is something simple I'm missing and I'd appreciate any help.

I think I have a serious case of 'operator error' going on...
import flash.events.*;
this.addEventListener(Event.ENTER_FRAME, newPage);
function newPage(event:Event):void
if (currentFrame == 1325)
  navigateToURL(new URLRequest("whatever","_parent");
  this.removeEventListener(Event.ENTER_FRAME, newPage);
It's throwing an error that makes no sense:
The class or interface 'Event' could not be loaded
It targets the function statement. I added the import statement in a vain attempt to fix this.

Similar Messages

  • Just installed lollipop. Now I cannot access sounds and notifications. Says" Unfortunately, Settings has stopped". Anyone else have this problem?

    Installed lollipop. Cannot access sounds and notifications in settings. Says, "Unfortunately, settings has stopped". Do not have problems accessing other display. wallpaper, etc. New update says installed successfully. Anyone else have this problem after updating?

    Same here. Any help appreciated

  • Access Edge animation timeline in iframe

    I'm sure there's a way to do this easily, but I'm new to javascript. How can I access the animation timeline inside an iFrame? For example, if I want a button on a page to play the timeline from a label in an Edge animation in an iframe.
    Any ideas?

    Here is a example .Click the button to play movie in iframe
    In this I get access to  composition using the iframe's contentwindow api and call play movie.
    iframeEx.zip - Google Drive

  • Accessing the main timeline

    Hello,
    I have multiple instances of a movieclip (a1) within the main timeline.  These instances move around via tweening within the main timeline.  The instances also appear (are added) and disappear (are removed) while the main timeline is playing.
    Within the movieclip is this actionscript:
    (code)
    addEventListener(Event.ENTER_FRAME, ef);
    function ef(evt:Event):void
         trace(MovieClip(parent).currentFrame);
    (end code)
    As soon as an instance disappears... I get this typeError:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at test13_fla::a1_1/ef()
    The question then is - How can I access the main timeline from each instance (even when it is not currently on stage)?  Is this possible?  Any suggestions on how I can keep all of my code within the movieclip?
    Thanks in advance!
    -Jake

    Throughout the timeline the instances are in a motiontween followed by a blank keyframe. 
    To remove the event listener when it does dissappear I could do a addEventListener(Event.Removed, removeEventListenerFn);.... but I need a way to keep it.
    In my real project, each instance draws itself via drawRect and then put into a sprite and added to the main timeline.  Then within the event function (where it traces the maintimelines current frame)  I need all of the sprites to be removed when the main timeline gets to a certain frame#.  I know... confusing...
    I just need to find a way to access the main timeline while the instance is removed from the stage.
    If, for example, I did this...
    (code)
    addEventListener(Event.REMOVED, ef);
    var ccc:Number = 1;
    function ef(evt:Event):void
         trace("First Removed: " + MovieClip(root).currentFrame);
         addEventListener(Event.ENTER_FRAME, eg);
    function eg(evt:Event):void
         if(ccc < 10)
              trace("I am now removed");
         ccc++;
    (end code)
    ... I do not get any errors and I would get this in the output window:
    First Removed: 59
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed

  • Problem accessing sounds in jar file

    Hi,
    I have made a program and packed it to a jar file.
    Everything works fine in the IDE, so this is purely a matter of jar access.
    The jar has 6 folders.
    framework (which is one of my packages)
    META-INF
    sound (also my package)
    sounds (my wav files for the program)
    sprite (another package)
    sprites (my graphics for the program).
    I access the graphics in sprites, from a class in sprite and have no problem with it.
    try {               
                   URL url = this.getClass().getClassLoader().getResource(ref);               
                   if (url == null) {
                        fail("Kan ikke finde ref: "+ref);
                   sourceImage = ImageIO.read(url);
              } catch (IOException e) {
                   fail("fejl ved load: "+ref);
              }The problem is accessing the wav file in the sounds folder from a class in the sound folder.
    try{
                   AudioInputStream stream = AudioSystem.getAudioInputStream(new File("Sounds/1999.wav"));
                   AudioFormat format = stream.getFormat();
                   DataLine.Info info = new DataLine.Info(Clip.class, stream.getFormat(),
                             ((int)stream.getFrameLength()*format.getFrameSize()));
                   clip = (Clip) AudioSystem.getLine(info);
                   clip.open(stream);
              }I have tried to use the class loader like this (instead of AudioSystem.getAudioInputStream) :
    AudioInputStream stream = (AudioInputStream) this.getClass().getClassLoader().getResourceAsStream("sounds/1999.wav");          
    but it didnt help.
    Does anyone have any suggestione?
    Please, if all you can do, is paste a link to the java API, save your energy. I have already looked and it was no help, as im still only a student of java.
    I would like an actual suggestion, so i can see it work, then i can make work my way through the API from there.
    Edited by: Mondariz on May 7, 2008 8:26 AM

    Don't try to use a File object to access resources from the jar. You have a working process for accessing the sprites, just use the same process to access the sounds. Only not quite the same method, there's one method which returns a URL and a very similar method which returns an InputStream. I would post the link to the documentation but you asked for us to not do that. Anyway you seem to know where it is.

  • Accessing sounds in the Roland VDrum module

    I'd like to be able to access the Roland module sounds in Logic Studio. So far, I've only been able to trigger the Logic sounds w/the Roland pads. I followed the manual pg. 451 and have gotten signal but no audio. ( I'm getting signal (note name and velocity), I can record MIDI (green) but no playback audio.) Any ideas? Thanks.
    PS - Do you recommend recording from the Roland as MIDI or audio? I've heard recommendations both ways.

    I have the V-Drums module set up as a regular MIDI, or multi-instrument in Logic, and can sequence/edit the MIDI parts just like a other MIDI instrument.
    When I'm ready to move to audio, I will either print the V-Drums parts down to audio, or reassign the MIDI parts to play samples instead.
    So I suggest setting up a V-Drums instrument object which you can assign to MIDI tracks and sequence, and do most of the stuff that way first - this gives you the power to edit if necessary. When you are happy with your drum parts, you can then just record them to an audio track, either as a combined mix, or record the drums individually to different tracks for better mix flexibility.

  • Dynamic Sound vs Timeline

    Howdy all,
    We have a project which involves creating numerous
    presentation based SWFs. These SWFs are loaded into a Flex based
    player. In order to have the audio respond to the stop() command, I
    have extended the document class (MovieClip) and added a
    soundManager object that loads audio from the library.
    Here's the rub. They time the frames to the audio on the
    timeline, then remove the timeline audio and use the actionscript
    calls to load the sounds. The timeline SWFs run fine and in sync.
    However, the dynamically loaded ones grow further and further out
    of sync the longer the timeline (the audio gets AHEAD of the
    frames).
    The only thing I can think of is that for some reason, when
    they are using my document class, it is using a different (slower)
    framerate? But I haven't manually changed that. Any ideas?
    JJ

    If this is still a problem, be sure to make sure that you've granted the app microphone permissions, which started being required in iOS 7. Otherwise, recorded audio will sound like a "chipmunk" voice when played back.

  • No sound in Timeline (only)

    I just got a new copy of FCP X from the Apple Store. My clips sound good in the event library but not when transferred to the Timeline, eventhough I see the sound track, which is strange.

    I have narrow down the issue to my Logitech microphone/headphone set. If I start the application with the internal microphone and speakers set up, the problem dissapears. Unfortunately, I need to use the headphones, as I share my office space. I have set up my Logitech headset in the systems preferences, but I cannot anything from which to choose my sound preferences from within FCP X.
    Thanks for the help.

  • No Sound From Timeline

    I upgraded to the 2014 version and now my sound does not play back from the timeline. I can see a waveform, but nothing plays back and there is no level showing in the meter.
    [Please choose only a short description for the thread title.]
    Message was edited by: Jim Simon

    Check your audio outputs are mapped correctly. Edit > Preferences > Audio Hardware.

  • No sound on timeline

    Have used Final Cut for many years--however, just re-installed. Now I cannot get any audio on the timeline. When I log & Capture, I can listen to the audio directly from the clip that has been captured and sound is great. As soon as I save it or drag it to the timeline, no audio.
    All audio beyond the timeline works great in any program. I can see the audio/peaks and the equalizer appears to have audio, but no sound is coming out!
    I have checked all the Final Cut settings that I know of.

    Make sure your VIEW External Video is set to ALL FRAMES...
    But more importantly - make sure your audio is following your video correctly. Down there at the bottom of the VIEW menu... either set Audio to FOLLOW VIDEO (which, if you have your deck hooked up will go to the deck) or keep it INTERNAL... which - if you are monitoring your video on an external monitor you will have latency issues.
    So - if indeed you want it to follow video AND you are monitoring your video externally (via the deck) make sure your speakers are hooked up thru the deck. I use a little mixing board (ok, actually an old tuner) to control which audio source is being set to the speakers... the Deck is hooked up to AUX and the computer is hooked up to CD - then I just switch between the two on the tuner.
    CaptM

  • Remote access & sound

    I'm not sure this is possible but is there any way to hear what is playing on the computer I am connecting to remotely via timbuktu? I have only mac's at home and am connecting to a windows machine at work, I need to do some online training that will only run on windows, but need to hear the audio. Do I have any options with my remote connection? I have an Intel iMac in the house that I could run bootcamp on but that is my least fav option, since that's primarily my kids and I really don't want them having access to windows.

    hi,
    i guess to hear the sound from a remote machine you need some kind of sound streaming on the remote machine.
    so:
    a) view via remote connection /vnc, ard, timbuktu or whatever)
    b) get sound via streaming service
    both together --> your solution
    helpful ?
    best regards
    fidel

  • Premerie Pro CC - have sound on timeline, yet when I export file i am missing sound in one tiny clip. Can I be related to working with Merged clips?

    Hello Premerie Pro CC community,
    I need help, I am working with merged clips (the video footage shoot with a DSLR and different audio recorders). I have a timeline in premerie with sound all finished. Everything was fine until I when and fine tuned some of the audio, just added key frames to correct and now when I export my sequence I am missing sound in one little clip of the entire mov.
    Does it have to do with sound and editing with a merged clip?
    I have tried to export in several different settings and still the same result, and when I look at my timeline the sound is all there.
    I have until the end of Monday to figure what I have done incorrect
    thanks
    -DragonFly

    In case it is a phase problem, try adding fill left effect to the faulty clip.

  • No sound in timeline

    I sarted a new project. I get sound from all other panels except for the timeline. I can see the UV meters working. I hear sound from the source panel and the project panel. Drag a clip nto the folder icon that will start a new timeline in it's matching native format and no sound in the timeline. I can see the all the levels are up, activity in the UV meters, but no sound - truly stumped...
    I opened up several other projects and not having this problem - only with this one project. Even a reboot didn't help - MOST bizzarre...

    There are several places to address Audio in PrPro. This ARTICLE covers many of them, and provides a starting "checklist," of things to look at.
    Good luck,
    Hunt

  • CS5: Sound on timeline

    Hi all,
    I am making website which is one flash file having whole contents putting in time line with each frame label.
    I put contents opening sound at the beginning frame of each contents, but however for the first access of this site("Home" content) only this sound plays twice as loud.
    When I goto another content and go back to "Home" again, it plays in same volume as others, and its no longer plays in loud.
    Anyone knows any solution? Any help may appreciated, thanks.

    I stumbled upon the solution myself. To get it to work, I reduced the fps to 16 down from 24. Then everything synchronized. In case anyone wants to know.

  • Control sound in timeline

    Hy,
    I've some mc called, one a time, with attachMovie named
    mcTarget, each of
    this has one speaker track sincronized with the animation on
    the stage. For
    this reason sound is put directly in timeline in stream mode
    (proprieties>>Sincr: stream). But now I cant control
    the volume of these
    sounds. I'll tryed to do this:
    //on main root
    mySound = new Sound(); //no specify target to refer a "global
    sound"
    function Volume(val){
    mySound.setVolume(val);
    trace(val);
    // in another place
    Volume(50);
    This works only with a sound placed in main root but does
    nothing if the
    sound is placed on a nested mc (my case).
    Someone have an idea or a alternative way to do this?
    Thanks
    Roger

    "sneakyimp" <[email protected]> ha scritto
    nel messaggio
    news:e1kumu$sv6$[email protected]..
    > mySound cannot be defined as an empty sound object. it
    has to refer to
    > the
    > soundclip in question.
    This is the "canonic way", but you can use that code to do a
    something near
    at "global sound"
    you can see it also in at
    http://www.kennybellew.com/tutorial/globally.htm.
    >
    > // NO
    > // mySound is attempting to refer to *one specific
    sound*
    > // *not* a global sound setting
    > mySound = new Sound();
    > mySound.setVolume(50);
    >
    > // YES
    > // this is referring to one particular sound
    > this.MySound1.setVolume(50);
    >
    > I'm not sure how this relates to sounds added to the
    timeline. i think
    > you
    > have to use the flash authoring interface controls to do
    it. i *don't*
    > think
    > you can control sounds added this way with actionscript
    unless you can
    > determine what their target path is.
    Sure, it's works with sound put in a root timeline..
    > this may or may not be helpful:
    Thanks, but I didn't find the solution for my case...
    >
    http://www.kennybellew.com/tutorial/multiple_scenes.htm
    many thanks for the answer.

Maybe you are looking for