Error #1009 when sound inside game, a movie clip that is called to the scene with child add method

What is supposed to happen

I have a clip that is called when the user clicks a button. When moving clip appears music is expected to play. When the user clicks the close button the music stops and the clip is removed from the scene.

But then I get an error

When I test the movie I get the following error:

TypeError: Error #1009: cannot access a property or method of a null object reference.

to mc_playSong / frame2 () [mc_playSong::frame2:6]

This is the code that calls the clip on the stage (no problem here):

Call the video clip with the song played on stage

stage.addEventListener (MouseEvent.MOUSE_DOWN, goButtons);

function goButtons(event:MouseEvent):void

{

If (event.target is song_bnt)

{

SoundMixer.stopAll ();

addChild (myPlaySong);

myPlaySong.x = 558;

myPlaySong.y = 384;

Event.stopImmediatePropagation;

}

The following code inside the clip is called to the scene. The music is meant to play:

Stop();

Variables for listening to music

var RJPlaySong:RJSong = new RJSong();

var RJPlaySongChannel:SoundChannel;

Music for plays

stage.addEventListener (Event.ENTER_FRAME, startRJSong); (I think that the error in the code is in this function. When I comment on him I don't get error.)

function startRJSong(event:Event):void

{

RJPlaySongChannel = RJPlaySong.play ();

}

Stop all sounds, sets variables to null and calls a send event that removes the clip of the scene.

bnt_closeSong.addEventListener (MouseEvent.MOUSE_DOWN, closeCreditSongScreen);

function closeCreditSongScreen(event:MouseEvent):void

{

SoundMixer.stopAll ();

RJPlaySong = null;

RJPlaySongChannel = null;

dispatchEvent (new Event ("RemoveMCsong"));

}

Someone at - it ideas? This seems to be a pretty simple question, but I can't understand it.

I meant that you have quoted just to be taken literally.  If it's still not clear what I say or what did your code, try the following in order to demonstrate the IT change... This code to be...

stage.addEventListener (Event.ENTER_FRAME, startRJSong);

function startRJSong(event:Event):void {}

trace ("I can do this all day");

}

After doing this, you can see why you want to only call the function once, and you could eliminate most of it and just put...

RJPlaySongChannel = RJPlaySong.play ();

Instead, or as I said originally, you can change it to be...

function startRJSong (): void

{

RJPlaySongChannel = RJPlaySong.play ();

}

startRJSong();

Tags: Adobe Animate

Similar Questions

  • Error occurs when you use SQL Server 2012 assessment vs window detail of the object in window 7 - KERNELBASE.dll exception 0xe0434352

    Hello

    Error occurs when you use SQL Server 2012 assessment vs window detail of the object in window 7.  I use the window of the object but the detail of the objects window arrives and immediately SQL Server stops with the error below and then opens again.  I didn't find any help with this specific error is but suspect there is a problem between SLQ Server 2012 et.NET Framework 4.  Unfortunately, I do not know what it takes in this regard.

    Thanks, Deb

    Event ID: 1000
    Task category: (100)
    Level: error
    Keywords: Classic
    User: n/a
    Computer: Deb - HP
    Description:
    Name of the failing application: Ssms.exe, version: 2011.110.3000.0, time stamp: 0x5081c1cd
    Name of the failed module: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b83c8a
    Exception code: 0xe0434352
    Offset: 0x0000c41f
    ID of the process failed: 0x13a8
    Start time of application vulnerabilities: 0x01ce609a6d3db991
    The failing application path: C:\tempSQLWOW\110\Tools\Binn\ManagementStudio\Ssms.exe
    Path of the failing module: C:\Windows\syswow64\KERNELBASE.dll
    Report ID: 1fb1cbfb-cc8e-11e2-b436-abd2bebb3f17

    Hi Claude,.

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the link below.

    http://social.technet.Microsoft.com/forums/en-us/category/SQLServer

    Good day!

    Answer please if you face concerns.

  • Converter does not have "an error occurred when opening a virtual disk. Verify that the Converter server and source running machines have network access to the ESX/ESXi hosts source and destination. »

    Hi all

    I'm having some trouble converting server physical windows using autonomous vConverter 5.5.

    error message:

    "An error occurred when opening a virtual disk. Verify that the Converter server and source running machines have network access to the ESX/ESXi hosts source and destination. "

    I have attached the bundle newspapers. Please notify.

    See you soon...

    Your error is:

    2014-11 - 04T 18: 27:27.587 - 08:00 [01236 info "Default"] GetManagedDiskName: Get disklib file name as vpxa-nfcssl: / / [a0110-vmgt70-001] WIN-MOVRCVCSITG/WIN-MOVRCVCSITG.vmdk@a0110tesxhyp01.datacenter.telenorservices.com: 902! 2 b 52 87 75 03 03 ff 49-67 2f 3 a 61 76 and 00 cd e1

    2014-11 - 04T 18: 27:27.587 - 08:00 [01236 WARNING 'Default'] [, 0] NfcNewAuthdConnectionEx [NFC ERROR]: unable to connect to peer. Error: Failed to search for host for a0110tesxhyp01.datacenter.telenorservices.com server address: the requested name is valid, but no data of the requested type was found

    2014-11 - 04T 18: 27:27.587 - 08:00 [01236 info "Default"] Sysimgbase_DiskLib_OpenWithPassPhrase failed with 'NBD_ERR_NETWORK_CONNECT' (error code: 2338)

    Check the manual on the required ports.

    HTH

  • When you open a new session and after a decline in all the video files in the content area (the sound and the video is very good). After you have chosen a selection of clip the first clip that I post on the time line is equipped with sound. then the next

    When you open a new session and after a decline in all the video files in the content area (the sound and the video is very good). After choosing a selection of clip, the first clip that I post on the time line is equipped with sound. then the next clip, I chose (not dose issue)
    will have no sound. (but in the contact box everything its fine) Why is this?

    Why is this?

    Because you forgot to patch source audio track.

  • When I connect to secure Web sites (that is to say the National Bank aust) it says not a trusted site and certificate not valid?

    When I connect to secure Web sites (that is to say the National Bank aust) a message pops up saying not approved Web site and the security certificate is not valid? I can also book flights on qantas and Virgin site? Help, please. I could do all this 24 hours but now can not do something like this.

    Try to upgrade to a newer version of Firefox 3.6.x or 6.0.x.

    Your current version of Firefox 3.0.19 can exceeded SSL certificate expired.

    Also check the date and time of the clock on your computer: (double) click on the clock icon in the Windows taskbar.

  • Why my MBP retina nine come with only 100 GB against 120 GB as shown. (He says 20 GB has been used, but I just bought the laptop) is enough space of 100 GB. I'm not a gamer or anything like that. Just need the computer for College

    Why my MBP retina nine come with only 100 GB against 120 GB as shown. (He says 20 GB has been used, but I just bought the laptop) is enough space of 100 GB. I'm not a gamer or anything like that. Just need the computer for College

    How to report the storage capacity - Support Apple OS X and iOS

    If you bought the Apple MBP, you have 14 days to swap for a most appropriate mac.

    If bought from a different dealer, you will need to contact them about the Exchange / return policy.

  • TypeError: Error #1009: when communicating to a button in a MovieClip

    I get the following error:

    [SWF] ProjectZ_iOS.swf - 12154544 bytes after decompression

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    at ProjectZ_iOS_fla::MainTimeline/goButtons() [ProjectZ_iOS_fla. MainTimel ine::frame71:54]

    By trial and error, I have reduced this problem down (line 54) of an 'if' statement (and all the other instructions) that communicate to a button in a movie clip (PopUp_GetMore.bnt_MoreRemixesGoHome). When the user clicks this button I want to delete the movieclip on the stage and turn the visibility of the other buttons to true. I get this error for every query that communicates to a button in the movieclip. I have several conditions in the service, but for example I am love, only include the declaration for a button below:

    Variables

    var PopUp_GetMore:MainMoreRemixes_mc = new MainMoreRemixes_mc();

    //******************************Stage buttons**************************************

    stage.addEventListener (MouseEvent.MOUSE_DOWN, goButtons);

    function goButtons(event:MouseEvent):void

    {

    Add the movieclip on the stage

    if(Event.Target == bnt_GetMore)

    {

    addChild (PopUp_GetMore);

    PopUp_GetMore.x = stage.stageWidth/2;

    PopUp_GetMore.y = stage.stageHeight/2;

    bnt_Behind.visible = false;

    bnt_GetMore.visible = false;

    bnt_Facts.visible = false;

    bnt_AuthorIllustrator.visible = false;

    }

    Deletes the clip of the scene

    If (event.target is PopUp_GetMore.bnt_MoreRemixesGoHome)

    {

    removeChild (PopUp_GetMore);

    bnt_Behind.Visible = true;

    bnt_GetMore.Visible = true;

    bnt_Facts.Visible = true;

    bnt_AuthorIllustrator.Visible = true;

    }

    }

    What I am doing wrong? If the declarations as communcate with the buttons inside the movieclip appear in another function?

    1009 error indicates that one of the objects targeted by your code are out of reach.  This may mean that the object...

    -is declared but not instantiated

    n ' is not have an instance name (or the name of the instance is misspelled)

    n ' is not in the frame where this code tries to talk to her

    -is animated in place, but is not assigned the name of the instances of each keyframe for her

    -is one of the two or more consecutive keyframes of the same objects without a name assigned in the image previous (s).

    If you go to your section to publish the Flash settings and select permit debugging option, your error message should have a suite of line number the number of the frame that will help you to isolate the object that is involved.

    And just in case it might be a misspelling... If it is a button would not name more likely include "btn" rather than "bnt".

  • Error #1009 in my platform game! Help, please!

    My game of base platform that I have a "hero" who can walk and jump on the 'ground '. There is also a door to the next scene, which is the next level. The first scene works very well, but "TypeError: Error #1006: value is not a function." to Charles3_fla::MainTimeline/frame1()"appears once in the output. This works however, and I'm not worried about it. The second, I'm going through the door but, scene 2 opens, and then starts flashing as "TypeError: Error #1009: cannot access a property or method of a null object reference." to Charles3_fla::MainTimeline/onenter()"appears a LOT in the output. I don't know how to solve this problem and I would like to help. P.S. I use Adobe CS5 with actionscript 3

    Here is the code for stage 1:

    hero.gotoAndStop ('still');

    var key: KeyObject = new KeyObject (internship);

    var vy:Number = 0;

    var gravity: number = 2;

    var jumped: Boolean = false;

    stage.addEventListener (Event.ENTER_FRAME, onenter) (true);

    function onenter(e:Event):void {}

    Vy += gravity;

    If (! ground.hitTestPoint (hero.x, hero.y, true)) {}
    Hero.y + vy;
    }
    If(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {}
    Hero.x-= 13;
    }
    If(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {}
    Hero.x += 13;
    }

    If (vy > 10) {}
    Vy = 10;
    }
    for (var i: int = 0; i < 10; i ++) {}
    If (ground.hitTestPoint (hero.x, hero.y, true)) {}
    Hero.y-;
    Vy = 6;
    jumped = true;
    }
    }
    {if (Door.hitTestObject (Hero))}
    gotoAndPlay (1, "scene 2");
    }
    if(Hero.y>300) {}

    Vy = 6;
    jumped = true;

    }

    If (Key.isDown (Key.up) & & jumped) {}

    Vy = - 13;
    jumping = false;

    }

    Hero.y += vy;

    {if (Key.isDown (Key.Right))}
    Hero.x += 10;
    hero.scaleX = 1;
    hero.gotoAndStop ('walking');
    } else {if (Key.isDown (Key.LEFT))
    Hero.x-= 10;
    hero.scaleX =-1;
    hero.gotoAndStop ('walking');
    } else {}
    hero.gotoAndStop ('still');

    }

    }

    And for scene 2...

    hero.gotoAndStop ('still');

    var Key1:KeyObject = KeyObject (internship);

    var vy1:Number = 0;

    var gravity1:Number = 2;

    var jumped1:Boolean = false;

    stage.addEventListener (Event.ENTER_FRAME, onenter1) (true);

    function onenter1(e:Event):void {}

    VY1 += gravity;

    If (! ground.hitTestPoint (hero.x, hero.y, true)) {}
    Hero.y + vy;
    }
    If(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {}
    Hero.x-= 13;
    }
    If(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {}
    Hero.x += 13;
    }

    If (vy1 > 10) {}
    VY1 = 10;
    }
    for (var i: int = 0; i < 10; i ++) {}
    If (ground.hitTestPoint (hero.x, hero.y, true)) {}
    Hero.y-;
    VY1 = 6;
    jumped1 = true;
    }
    }
    {if (Door.hitTestObject (Hero))}
    gotoAndPlay (1, "scene 2");
    }
    if(Hero.y>300) {}

    VY1 = 6;
    jumped1 = true;

    }

    If (Key.isDown (Key.up) & & jumped1) {}

    VY1 = - 13;
    jumped1 = false;

    }

    Hero.y += vy;

    {if (Key.isDown (Key.Right))}
    Hero.x += 10;
    hero.scaleX = 1;
    hero.gotoAndStop ('walking');
    } else {if (Key.isDown (Key.LEFT))
    Hero.x-= 10;
    hero.scaleX =-1;
    hero.gotoAndStop ('walking');
    } else {}
    hero.gotoAndStop ('still');

    }

    }

    Please answer as soon as possible and thank you for your time

    swiatekalex555

    the idea was to stop your main timeline to move forward because it was a problem that you mentioned in a previous message.

    Anyway, this thread has answered a long time ago and is now unrelated to error # 1009.  Please mark this thread as answered and start a new thread.

  • Error codeN8151 when you try to get movies on Netflix

    original title: difficulty of error codeN8151

    Netflix sends notices of error code when I try to access moviesN8151

    Hello

    1 did you change on your computer before this problem?

    2. this issue involved a particular movie?

    3. what operating system is installed on your computer?

    What version of the operating system Windows am I running?

    http://Windows.Microsoft.com/en-us/Windows7/help/which-version-of-the-Windows-operating-system-am-i-running

    You can uninstall and reinstall Silverlight and check.

    Download Microsoft Silverlight

    http://www.Microsoft.com/getSilverlight/get-started/install/default.aspx

    See also:

    Uninstall or change a program http://windows.microsoft.com/en-us/windows7/Uninstall-or-change-a-program

    Known issues and limitations of Netflix in Windows Media Center for computers that are running Windows 7

    http://support.Microsoft.com/kb/977116

  • Error message when launching simple games

    When I try to run a simple game, I get an error message "Attempt to access an invalid address." This happens to most, but not all of my games.

    I tried to reinstall one of the games and got the same error message when I launched the setup.exe file.  It's never happened before.  These are old, simple games such as Solitaire and Jezzball.  What does the error message mean and how can I solve this problem?

    System - Windows XP Home edition with Service Pack 3.

    Mike,

    Thanks for the help.  Just as you were posting, I found a solution.  I, too, suspect Spyware, but a Virus scan and Spyware scan revealed nothing.

    A week ago, I had the help of my provider of security in the removal of a virus (PC Defender).  During the session, the technician ran a freeware program called Cleanup to remove the 'useless' my hard drive files.  I suspect that some of the deleted files were not so useless.  I ran a restore of the system back about 2 weeks.  This seems to have solved the problem.

    Again, thank you for having responded to my problem.

  • Netflix app error: W8158 when you try to watch movies

    I recently downloaded the NETFLIX app on my DELL XPS ONE 27.  When I try to watch a movie, I get the error code following 'W8158 '.   What is - this and how to fix it?

    Hello Martin Bennet,.

    Yes, I am able to play videos in other applications.  I was actually able to solve my problem earlier this morning.  I went and downloaded a driver update and that seemed to do the trick.  Thank you very much and I hope you have a nice day!
    Kind regards
    hreyes82
  • Error #1009 when loading SWF with Document class

    Hello

    I have two sovereigns, racingPreloader.swf and racingTrack1.swf funds, the other has a class of documents 'hands. RaceMain ".

    racingPreloader.swf is a preloader for racingTrack1.swf, but it does not work. Instead, I get the result:

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    sector: RaceMain()

    I tried to enable debugging on both files and test it with Shift + Ctrl + Enter, but the result is substantially the same; It does not give me a specific line where is the problem.

    Try to launch and connect to player using URL H:\Swifter\racingPreloader.swf

    [SWF] H:\Swifter\racingPreloader.swf - 16102 bytes after decompression

    [SWF] H:\Swifter\racingTrack1.swf - 41869 bytes after decompression

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    sector: RaceMain()

    Cannot view the source code at this location


    This is very similar to what happened to this topic, but I couldn't solve my problem after not finding a solution in it.


    Here's the code to frame 1 of the racingPreloader.swf:


    var loader: Loader = new Loader();

    Loader.Load (new URLRequest ("racingTrack1.swf"));

    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, openSWF);

    function openSWF(e:Event) {}

    addChild (loader)

    }

    And this is a part of the code to the sector. RacingMain class. I have omitted most of the code because I believe that these lines are the source of the problem:

    the packet network {}

    import flash.display.MovieClip;

    //... More import clausses

    SerializableAttribute public class RaceMain extends MovieClip {}

    public void RaceMain() {}

    if(stage==null)

    this.addEventListener (Event.ADDED_TO_STAGE, main);

    on the other

    hand (null);

    }

    private void main(e:Event):void {}

    start the game

    }

    }

    }


    Thank you.

    I just figured out that I was loading an old version of racingTrack1.swf with an unfixed food version. RaceMain class of document. I changed to the version with this fix and finally managed to do work.

  • Audio Codec error box when I try to watch a clip in Edit Box

    Just started trying to use 7 E Pr. Vista

    I get the media since an external hard drive, drag it to the area of the timeline. When I try to 'play', I get a

    "Adobe by default Windows Sound Device" box that says:

    Feature: IDT High Definition Audio CODEC

    Error code: FFA-8-000 D (80040154)

    Info:

    Failed to read

    The audio system does not appear to meet.

    Maybe the card does not support full duplex mode.

    The funny this is the clip that I'm playing is not any audio in there.

    Any ideas would be appreciated.

    Well, depending on how the video has been encoded, it just might, if she can well be quiet. G - Spot will tell you for sure, and it's free.

    Now, the first thing I would do would be to download and install the latest Realtek or similar, pilot.

    This ARTICLE can also be useful and guide you in the areas where your Audio settings.

    Good luck

    Hunt

  • When I try to open a chanel online, it seems to me the message: Microsoft Visual C++ Run time Library Error.Google Chrome and to view a chanel online that I use and the IE toolbar.

    original title: Hello!

    Hey, I have a question. When I try to open a chanel online seems to me the message: Microsoft Visual C++ Run time library error made in Google Chrome and to view a chanel in line that I use and IE toolbar. I'm waiting for a response. Thank you!

    Hello

    1. is this problem only occurs in Internet Explorer?
    2 may I know which version of IE are you using?

    Method 1:   
    If the problem occurs on Internet Explorer, try the link below.
    http://support.Microsoft.com/kb/822521

    Method 2 If on Chrome, I suggest you get contact with Chrome Forums.
    http://www.Google.com/support/forum/p/chrome

    Hope this information helps you.

  • 0 x 80070035 and 0X80004005 error codes when you try to connect to other computers and devices on the same network - unable to connect to the shared devices.

    I have a network consisting of Windows 7 laptop computers, an XP laptop and a Wireless Linksys (Cisco) WRT610 N + N with storage attached to it via its USB port.  Your PC Windows 7 has, since I can see and access to other computers and devices on storage.  Since Windows 7 PC B I can not connect (via the file manager) to A PC or NAS storage network.  Get such as 0 x 80070035 and 0X80004005 error codes when you try to connect to the IP address on the device name.  When I ping the devices of PC B I have no trouble to achieve.

    I turned off all firewalls, added the LMHOST file entries and a myriad of other tests and still cannot connect to PC B devices.  I can surf the net fine and do everything else - simply cannot connect to other devices even if these other devices can connect to me.

    I was in there for 22 years and has worked as an engineer on major networks and the network I stem - anyone got any idead. I checked all the basics such as Netbios, file sharing etc etc.

    It took a reinstall (upgrade) to get actually it works again.

Maybe you are looking for