Play multiple sound files in different frames from library in flash

My assessment task for college is to create a webpage of my work.  So far it runs brilliantly except for this.  I only need this to be working in like 2 days!  Help!
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Carolyns_Media_Portfolio_Scene1_fla::MainTimeline/frame5()
at flash.display::MovieClip/gotoAndStop()
Trying to be able to play sound clips from the library with the option to play and stop the sound file. Each sound has its own frame, with stop and play buttons. I can run the first sound file perfectly being able to start and stop it but when trying to play the next sound it creates the above error on output. I have dead buttons as well on the second sound.
The top buttons take you to each scene
The script runs from frame 5.
import flash.events.MouseEvent;
**buTrivia.addEventListener(MouseEvent.CLICK,clickListener7);
function clickListener7(event:MouseEvent):void {
SoundMixer.stopAll()
gotoAndStop("trivia");
buToyRA.addEventListener(MouseEvent.CLICK,clickListener8);
function clickListener8(event:MouseEvent):void {
SoundMixer.stopAll()
gotoAndStop("toyminatorRA");
buCaroline.addEventListener(MouseEvent.CLICK,clickListener9);
function clickListener9(event:MouseEvent):void {
SoundMixer.stopAll()
gotoAndStop("caroline");
buServerDown.addEventListener(MouseEvent.CLICK,clickListener10);
function clickListener10(event:MouseEvent):void {
SoundMixer.stopAll()
gotoAndStop("serverdown");
This was the script I found and edited.  Only Trivia works
stop();
var triviaSound:trivia = new trivia()
var triviaChannel:SoundChannel = new SoundChannel();
buplay1.addEventListener(MouseEvent.CLICK, playSound1);
buStop1.addEventListener(MouseEvent.CLICK, stopSound1)
function playSound1(event:MouseEvent):void
triviaSound.play();
function stopSound1(event:MouseEvent):void
SoundMixer.stopAll()
gotoAndStop("trivia");
/*buplay2.addEventListener(MouseEvent.CLICK, playSound2);
bustop2.addEventListener(MouseEvent.CLICK, stopSound2)
var toysSound:toys = new toys();
var toysChannel:SoundChannel = new SoundChannel();
function playSound2(event:MouseEvent):void
toysSound.play();
function stopSound2(event:MouseEvent):void
SoundMixer.stopAll()
gotoAndStop("toyminatorRA");
Basically I want to play all the sounds, from the library, individually in different frames using the option to play and stop that sound.  I found the above script but only works for one sound.  I am new at scripting in flash so any help or even a better script option would be awesome.  Thank you

The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....
- is declared but not instantiated
- doesn't have an instance name (or the instance name is mispelled)
- does not exist in the frame where that code is trying to talk to it
- is animated into place but is not assigned instance names in every keyframe for it
- is one of two or more consecutive keyframes of the same objects with no name assigned in the preceding frame(s).
If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

Similar Messages

  • Playing Multiple sound file simultanyoustly

    Is there a Professional audio product that could fit my needs ? I want to have a soundcard that can play a lot of soundfile at the same time. Maybe 10 to 20 wave or mp3 at the same time.
    Shidewa

    Shidewa wrote:
    Is there a Professional audio product that could fit my needs ? I want to have a soundcard that can play a lot of soundfile at the same time. Maybe 10 to 20 wave or mp3 at the same time.
    Shidewa
    You should have wrote little more specific what are you going to do but I assume you're going to make your own music (record different instruments etc.).
    So, you mean multitracker/sequencer, products like Cakewalk Sonar and Steinberg Cubase.
    These I mentioned can play 'unlimited' amount of audio files (all depends on your system capabilities). These can handle MIDI files too.
    If you are going to buy a Creative Pro (E-MU) line product you get LE (limited edition) version of some of this type of recording/mixing/mastering software bundled with the card. I don't know the full capabilities of these stricted applications but I suppose they can fit into your requirements.
    Go to
    E-MU
    site and take a closer look of the cards.
    Specifications for
    Sonar LECubase LE
    which are bundled with E-MU sound cards. See more from Software section on E-MU card sheets on their site.
    If you meant to output frome those 10 - 20 analog (stereo) sources simultaenously and individually then, (almost) every card can handle them internally, but you need atleast two or more soundcards with each having lots of stereo output channels available to get all that sound out (all sources individually, without interferencig with each other). I would recommend then 1 or two PCI cards with external box (like E-MU 1820) and/or types of FireWire (like RME FireFace 800) or USB cards then.
    You can ofcourse split one analog 6.1 output system (eg. 3 output ports) to three stereo output channels using ASIO drivers, but you need then an ASIO compatible player (!! ASIO is not always multiclient driver so there may be restrictions if same model sound cards are used) (i.e. Audigy 2 is a 6.1 card --> I can get 3 separate stereo output channels into use by using ASIO drivers with two of the three players --> I can therefore output from 3 different sources simultaenously to 3 different outputs without they mixes with each other)
    .jtp
    Message Edited by jutapa on 09-18-2005 11:39 PM

  • Create multiple pdf files in different sizes from psd

    I have large psd files created from photos with borders, i now need to create pdf's in three sizes to be downloaded and printed from an online album.
    Size 1) will be able to be printed upto A1 with no loss of quality but the file needs to be as small a file as possible - other sizes of the same prints will be A4 and post card. I need to automate this process as there is hundreds of files. any info greatly recieved.
    Attached is a sample of my psd's
    Ash

    Make an action for save as pdf. After export, open one pdf in Acrobat and insert all the pdfs by select all option. then save as new multiple pages pdf.

  • Lost the ability to play multiple sounds!

    Since switching to archlinux, the only problem that I am unable solve is the inablity to play multiple sounds.. i had this problem when i first installed archlinux. back then i tried installing pulseaudio and found that cumbersome. eventually went back to alsa and found magically i could play sounds at once..
    now again it has reoccurred ever since the module init tools upgrade. i have tried reconfiguring alsa with alsaconf with no avail.
    on trying to play sound file from the 2nd app i get a knotif saying
    The audio playback device HDA Intel (ALC880 Analog) does not work
    Falling back to .
    some of the conf files i have:
    [$]> grep MODULES /etc/rc.conf
    # MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
    # NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
    MODULES=(e100 mii slhc snd-hda-intel snd-mixer-oss snd-pcm-oss snd-hwdep snd-page-alloc snd-pcm snd-timer snd soundcore !snd-pcsp)
    [$]> grep DAEMONS /etc/rc.conf
    # DAEMONS
    DAEMONS=(syslog-ng dbus @network netfs crond alsa hal cups @openntpd)
    [$]> cat /etc/modprobe.d/modprobe.conf
    # /etc/modprobe.d/modprobe.conf (for v2.6 kernels)
    [$]> cat /etc/modprobe.d/sound.conf
    alias snd-card-0 snd-hda-intel
    alias sound-slot-0 snd-hda-intel
    [$]> cat /etc/libao.conf
    default_driver=alsa10
    [$]> lspci | grep -i audio
    00:1b.0 Audio device: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller (rev 03)

    djszapi wrote:It seems to good. Did you try pulseaudio now too ?
    no i dont want to. it doesn't seem right with kde

  • Loading and Playing Multiple Sounds

    I have written a loadSound function which handles loading and playing multiple sounds. This function works fine when I call this function in another keyframe i.e. the frame in which the function is not written. But when I call the function on the same frame in which the function is written the sounds gets mixed up. For example the function is written in 1st keyframe. If I call this function in 2nd, 3rd and 4th keyframe (with different sounds) it works fine. But when i call the same function in 1st, 2nd and 3rd keyframe it all gets messed up.
    In 1st keyframe the sound plays properly. When I move to 2nd Keyframe the 2nd sound plays. But when I move back to the 1st keyframe the 2nd and 1st keyframe sounds all get mixed up. This doesn't happen when I call the function in 2nd, 3rd and 4th keyframes.
    Below is my function:
    import flash.events.Event;
    import flash.media.Sound;
    import flash.net.URLRequest;
    import flash.events.ProgressEvent;
    import flash.events.IOErrorEvent;
    import flash.errors.IOError;
    import flash.media.SoundChannel;
    import flash.media.SoundMixer;
    import flash.events.TimerEvent;
    import flash.utils.Timer;
    import flash.display.MovieClip;
    import flash.media.SoundTransform;
    stop();
    var s:Sound;
    var localSound:SoundChannel = new SoundChannel();
    var req:URLRequest;
    var loadedPct:uint;
    var currentFrameArr:Array = ["One","Two","Three"];
    var urlArr:Array = ["sound/m01_t01_s01.mp3","sound/m01_t01_s02.mp3","sound/page10_11.mp3"];
    function loadSnd(currentFrm:String)
    s = new Sound();
    s.addEventListener(ProgressEvent.PROGRESS, onSoundProgress);
    s.addEventListener(Event.COMPLETE, onSoundLoaded);
    s.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
    localSound.stop();
    for (var i:uint=0; i<currentFrameArr.length; i++)
      if (currentFrm == currentFrameArr[i])
       req = new URLRequest(urlArr[i]);
    s.load(req);
    function onSoundProgress(evt:ProgressEvent):void
      loadedPct = Math.round(100 * (evt.bytesLoaded / evt.bytesTotal));
      trace("The sound is " + loadedPct + " % loaded");
    function onSoundLoaded(evt:Event):void
      localSound = s.play();
    function onIOError(evt:IOErrorEvent):void
      trace("The sound could not be loaded: " + evt.text);
    Call to this function in different frames:
    loadSnd("One");
    loadSnd("Two");
    etc
    If I pass the parameter 'One' in loadSnd it plays the 1st element in urlArray, 'Two' 2nd element and so on.
    I have been scratching my head since long over this.
    Can anybody please pinpoint the error.

    Got the solution. The SoundMixer.stopAll(); statement did the trick. The complete workable function is pasted below:
    import flash.events.Event;
    import flash.media.Sound;
    import flash.net.URLRequest;
    import flash.events.ProgressEvent;
    import flash.events.IOErrorEvent;
    import flash.errors.IOError;
    import flash.media.SoundChannel;
    import flash.media.SoundMixer;
    import flash.events.TimerEvent;
    import flash.utils.Timer;
    import flash.display.MovieClip;
    import flash.media.SoundTransform;
    stop();
    var s:Sound;
    var localSound:SoundChannel = new SoundChannel();
    var req:URLRequest;
    var loadedPct:uint;
    var currentFrameArr:Array = ["One","Two","Three"];
    var urlArr:Array = ["sound/m01_t01_s01.mp3","sound/m01_t01_s02.mp3","sound/page10_11.mp3"];
    function loadSnd(currentFrm:String)
      s = new Sound();
      s.addEventListener(ProgressEvent.PROGRESS, onSoundProgress);
      s.addEventListener(Event.COMPLETE, onSoundLoaded);
      s.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
      SoundMixer.stopAll();
      localSound.stop();
      for (var i:uint=0; i<currentFrameArr.length; i++)
      if (currentFrm == currentFrameArr[i])
      req = new URLRequest(urlArr[i]);
      break;
      s.load(req);
    function onSoundProgress(evt:ProgressEvent):void
      loadedPct = Math.round(100 * (evt.bytesLoaded / evt.bytesTotal));
      trace("The sound is " + loadedPct + " % loaded");
    function onSoundLoaded(evt:Event):void
      localSound = s.play();
    function onIOError(evt:IOErrorEvent):void
      trace("The sound could not be loaded: " + evt.text);
    Calling the function
    loadSnd("One");
    loadSnd("Two"); etc

  • InfoPackage to load multiple flat file for different plant

    Hi
    There is a requirements to load the data from multiple flat files by different plant into BI which source data is coming from other system. Each flat file has it own naming convention.
    As data has to load via infopackage into the targeted cube. Then I have to create multiple infopackage in order to load the data according to the number of flat files that provided. However, new plant will be created due to expansion of bussiness. If that is the case, additional infopackage is required to create as and when there is a new plant. 
    Is there a way to create a infopackage to load the data from flat file by plant? Your advice is much appreciated.
    Thanks and regards
    Kang Ring

    Hi,
    The best way I can suggest is....
    1. Create a folder in AL11 for your requirements.
    2. In InfoPackage under Extraxction Tab you can have File Name , just side of this you can fine ABAP Routines ICon there you click on that and asks Name give some and then it will takes to your into ABAP Code there you can access the AL11 and then write code in such way that to take file irrespective of the File name, whatever the file is there in that Folder it ahoud take from that AL11 Folder path.
    3. Load the Data using PC.
    4.At the end of the PC Delete the File in AL11 folder , becasue we don't need it for next load.
    Else
    See the thread
    Re: Automation of load from application server
    Thanks
    Reddy
    Edited by: Surendra Reddy on Jun 4, 2010 11:03 AM

  • SSIS project - read multiple flat files with different formats

    hi all,
    i need to import multiple flat files with different formats into different tables of the sql server database and not able to figure out the best way out in ssis to do so...
    please advise the possible methods in ssis to do so and if possible the process which can be dynamic as file names or columns might change in future.

    Hi AK1987,
    To import flat files with dynamic columns, we can use Script Task inside a Foreach Loop Container to parse the first row of the flat file to get the columns names and save them into a .NET variable, then, we can create “Create Table” script based on this
    variable, and then store the script into a SSIS package variable. After that, we create a staging table based on the package variable, load the flat file data to the staging table. Eventually, we load data from the staging table to the destination table. For
    the detail steps, please walk through the following blog:
    http://www.citagus.com/citagus/blog/importing-from-flat-file-with-dynamic-columns/ 
    Regards,
    Mike Yin
    TechNet Community Support

  • How do i play two sound file one after another

    Hi All,
    How do i play two sound file one after another using single AudioClip Component?.
    Advance in thanks
    Manivel

    AudioClip gives you very little control over what happens to the sound, it also isn't capable of playing long clips or waiting until a clip ends. It will play multiple clips over top of each other.
    To do what you want you should use the facilities of javax.sound. Here's a post with an example: http://forum.java.sun.com/thread.jspa?forumID=513&threadID=450768
    There is also a tutorial, but its example fails for long clips.

  • Installed Ensoniq AudioPCI SB32 - now I cannot play multiple sounds simultaneou

    I started with an el-cheapo on-board sound card (SiS 708). I just installed a Creative Ensoniq AudioPCI SB32 and can no longer play multiple sounds simultaneously.
    For example: if I am playing an MP3, WAV, or otherwise an audio file that uses the sound card's WAV output, other sounds such as the Windows event sounds or sounds assigned in my FTP application. I *could* do this without a problem using the SiS 708 card.
    More info:
    - I did leave the SiS 708 installed. Could this be conflicting?
    - I set the default I/O sound devices to the Creative Ensoniq in the control panel
    How can I play multiple simultaneous audio again?Message Edited by epp_b on 0-07-2006 07:48 PM

    I have tried the following things:
    - Uninstalling and disabling the onboard sound
    - Installing the latest version of DirectX
    I can't think of anything else (there are no updated Creative drivers that I can find)

  • How to load and unload more than one external swf files in different frames?

    I do not have much experience on Adobe Flash or Action Script 3, but I know the basics.
    I am Arabic language teacher, and I design an application to teach Arabic, I just would like to learn how to load and unload more than one external swf files in different frames.
    Thanks

    Look into using the Loader class to load the swf files.  If you want to have it happen in different frames then you can put the code into the different frames.

  • Play multiple sounds

    Hello!
    How can I play multiple sounds at once please?
    I tried with 2 separate soundChannel vars but they still override eachother.
    Thanks

    play both sounds through the same sound channel? eg:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:Script>
            <![CDATA[
                private var sound:Sound;                       
                private var soundChannel:SoundChannel;   
                private function play1():void
                    sound = new Sound();
                    sound.load(new URLRequest("sounds/1.mp3"));
                    sound.addEventListener(Event.COMPLETE, songLoaded);
                private function play2():void
                    sound = new Sound();
                    sound.load(new URLRequest("sounds/2.mp3"));
                    sound.addEventListener(Event.COMPLETE, songLoaded);
                private function songLoaded(e:Event):void
                    try
                        sound.removeEventListener(Event.COMPLETE, songLoaded);   
                        soundChannel = sound.play(0);
                    catch(err:Error)
                        trace(err)
            ]]>
        </mx:Script>
        <mx:Button x="140" y="313" label="Play sound 1" click="play1()"/>
        <mx:Button x="229" y="326" label="Play sound 2" click="play2()"/>
    </mx:Application>

  • I recorded audio with Quicktime player and the sound files won't disappear from the desktop no matter how I try to put them in the trash...

    I recorded audio with Quicktime player and the sound files won't disappear from the desktop no matter how I try to put them in the trash...tried xing out the red x, putting them in the trash...right clicking to make them disappear...nothing works...

    Just got rid of them... I closed Quicktime and was asked to delete. So I deleted them. Problem solved.

  • Play multiple published files

    I had been using Jesse Wardens's excellent Captivate Player ver 1.2 for quite a while to play multiple published files. Now that I upgraded to CP5 the player no longer works - I'm sure because of the action script version change.
    Does anyone know of a similar player that will allow the student to basically navigate multiple published .swf files like Jesse's?
    Regards,
    Kevin

    Hi kmarty,
    did you try the Captivate own Aggregator file creator.
    File > New > Aggregator Project
    Add several files and play them.
    If you set in the first of the imported files the TOC to overlay, it will be available for all files.
    Plus the names in the Aggregator list can be changed and these are shown in the TOC too.
    Best
    TD

  • Help playing a sound file please...

    i am trying to play a sound file everytime a button is clicked. the sound will play the first time the button is clicked but wont play after that. how can i get the sound file to play everytime the button is clicked?? here's how i play the sound file...
    InputStream in = new FileInputStream(sound.wav);
    AudioStream as = new AudioStream(in);
    // in the button action event...
    AudioPlayer.player.start(as);
    i tried adding this line... AudioPlayer.player.stop(as);...before the...AudioPlayer.player.start(as); -- the sound file still only plays once
    any help appreciated...thanks

    Hi there,
    Is there a class AudioPlayer in the API or is it yours. Anyway, your class must implement AudioClip interface. Then call yourClass.play(as); You dont need to stop, each time you call play(), it restarts. Try and let me know.
    cheers

  • How do i play multiple audio files simultaneously using AudioQueue?

    I've basically gutted what I don't need from the "Speakhere" sample app and I'm left with something I can use to play audio files. I converted wav files to aiff and then renamed the aiff to caf (Just in case this matters). I even tried shortening the files to 10 seconds long, but no difference. I am able to play files singly, but am unable to play more than one file at the same time. When I try to play multiple files, the first one plays correctly but the second will play a horrible long beeping sound. Sounds almost like a buzzer and sometimes will sound like a high pitched beep. My code has all the audio components like the speakhere app (AudioQueueObject, AudioPlayer, AudioViewController). I've changed the AudioViewController to be just my "AudioController" class where when I initialize, I pass in the name of the file and it replaces this line of code:
    CFStringRef fileString = (CFStringRef) [NSString stringWithFormat: @"%@/Recording.caf", self.recordingDirectory];
    with this:
    CFStringRef fileString = (CFStringRef) [NSString stringWithFormat: fileName, self.recordingDirectory];
    Any suggestions? I've been yanking my hair out trying to figure this out and I simply can't. I'm about ready to pull an "Office Space" but instead of beating up a printer, I'm going to destroy my macbook.
    *NOTE: I have only tried this in the simulator, but I'm assuming it will do this on the real thing so I haven't bothered to try.

    Unless I'm mistaken, you need one AudioQueue object for each audio file you want to play. In one of my apps, I basically copied the code provided in the [AudioQueue programming guide|http://developer.apple.com/iphone/library/documentation/MusicAudio/Concep tual/AudioQueueProgrammingGuide/AQPlayback/chapter4_section_1.html#//appleref/doc/uid/TP40005343-CH3-SW1] and made a wrapper object for playback. So then you can do something like this:
    MyAudioManager *manager1 = [[MyAudioManager alloc] initWithFile:@"file1.caf"];
    [manager1 play];
    MyAudioManager *manager2 = [[MyAudioManager alloc] initWithFile:@"file2.caf"];
    [manager2 play];
    // etc...
    If you want to play short files (~10s or less), you can use the simpler AudioServices functions along with SystemSoundID's. It will work fine if you have playback from AudioQueue and AudioServices at the same time.

Maybe you are looking for