Slaughter of BG sound with another class please help!

Hey hope someone can shine a light on this for me, been stuggling with that for awhile now.

I had a background sound to play, which is in a separate category codes:

Class: screen_Control

public function randonizer_SND (): void

{

var r: int = Math.floor (Math.random () * 17);

if (r == 1)

{

currentBG_SND = snd1_BG;

}

if (r == 2)

{

currentBG_SND = snd2_BG;

}

if (r == 3)

{

currentBG_SND = snd3_BG;

}

if (r == 4)

{

currentBG_SND = snd4_BG;

}

if (r == 5)

{

currentBG_SND = snd5_BG;

}

if (r == 6)

{

currentBG_SND = snd6_BG;

}

if (r == 7)

{

currentBG_SND = snd7_BG;

}

if (r == 8)

{

currentBG_SND = snd8_BG;

}

if (r == 9)

{

currentBG_SND = snd9_BG;

}

if (r == 10)

{

currentBG_SND = snd10_BG;

}

if (r == 11)

{

currentBG_SND = snd11_BG;

}

if (r == 12)

{

currentBG_SND = snd12_BG;

}

if (r == 13)

{

currentBG_SND = snd13_BG;

}

if (r == 14)

{

currentBG_SND = snd14_BG;

}

if (r == 15)

{

currentBG_SND = snd15_BG;

}

if (r == 16)

{

currentBG_SND = snd16_BG;

}

playSND();

}

public function playSND (): void

{

snd_BG_Channel = currentBG_SND.play (0,1);

snd_BG_Transform.volume = 1;

snd_BG_Channel.soundTransform = snd_BG_Transform;

snd_BG_Channel.addEventListener (Event.SOUND_COMPLETE, nextSnd);

}

nextSnd(event:Event):void of the public service

{

randonizer_SND();

}

Is what I try to achieve this sound to stop playing when a "button" is linked and then start playing again back in the main screen.

The "button" is controlled in a different category, and when I try to put a stop function there is to the sound I have the following error:

1119: access of property may be undefined snd_BG_Channel through a reference with static type class.

This is the code I use to try to stop the channel:

screen_Control.snd_BG_Channel.stop ();

If you have an idea of what I'm doing wrong please help!

THX pavel

Did you check this line? public var snd_BG_Channel:SoundChannel;

Must be:

public static var snd_BG_Channel:SoundChannel;

Tags: Adobe Animate

Similar Questions

  • How do I know if a class LV object has a relationship of 'is - a' with another class?

    Hi all

    I have a question LVOOP.

    Let's say I have a class object. The class of the object, it's that I have developed. Now, I would like to know if the object has a relationship of 'is - a' with another class.

    How can I do?

    One solution I have is to use "more specific class ' and check the status of the error. But I thought that there is a better way that I don't know.

    Thank you

    TailOfGon wrote:

    One solution I have is to use "more specific class ' and check the status of the error. But I thought that there is a better way that I don't know.

    It is the right solution. What dislikes on this subject?

  • I use xport 360 and I can't put my save game back on the program profile it shows a circle with a cross please help me

    I use xport 360 and I can't put my save game back on the program profile it shows a circle with a cross please help me

    Hello

    If you try to recover the gamer tag, then I suggest you follow the steps from the link below: http://support.xbox.com/en-us/pages/xbox-live/how-to/xbox-live-account-management/gamer-profile.aspx

    If this does not work then I recommend you to ask your question here: http://forums.xbox.com/xbox_forums/xbox_support/default.aspx

    Hope this information is useful.

  • master password bios for hp mini 1151 with code 2MC92472WZ please help. THX

    master password bios for hp mini 1151 with code 2MC92472WZ please help. THX

    Hello

    Try to enter: 74eo7vx7d0

    Kind regards

    DP - K

  • I just joined the cloud and can't find another download, please help?

    I just joined the cloud and can't find another download, please help?

    Above is part of the installation of the first Pro so just install Premier Pro family for the reminder on your machine.

  • Compaq presario c795tu driver needed sound... Please help me...

    Please help me... I need driver sound conexant HD smart audio 221...

    In fact, I reinstalled the XP and came to know that the sound is not...

    When I checked it... sound driver was missing some files like AUDSYS.exe and UIU32A.exe etc.

    By mistake, my friend has been uninstalled the audio driver. Then, the problem has been brought...

    2 days back I went to local compaq shop... they installed a few audio driver that works but at the same time

    Phone head and speaker that both are working constantly... means if u want to hear via head phone... pregnant also work with head phone...

    sound is through two devices...

    Please help me with this... and give me presario c795tu audio driver...

    Hello
  • my audio/sound is not working, please help

    my laptop audio (or audio) has suddenly stopped working even though I got my laptop, which is a Toshiba, in September. its doing this for awhile to calm now. I turned on my laptop so when I go on YouTube don't play sound. I noticed that there is a white "x" on a red background near the speaker. Click above to see wants wrong with it, then something is displayed with so-called "Reinstall device driver. There is a problem with the driver for the device high definition audio. "Reinstall the driver may solve the problem" so I click on 'apply patch' . When I click on that, it then says ' troubleshooting is complete. Troubleshooting failed to automatically solve all problems. you will find more details below. problems were high definition Audio device has a driver problem '. I don't know what to do and its really annoying me. I only got it for three months and already

    their something wrong with it.
    PLEASE HELP AND ANSWER ASAP PLEASE!

    ALSO, my laptop is a window running on 8.
    Most often when a device does not work, it is because the driver is damaged. Re-install a new copy should help

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly? SignedIn = 1

  • Problem with clips nested, please help!

    Help, please!

    I have a movieclip symbol, let's say, a ball that bounces with a stop(); action on frame 14.

    And I have another movieclip symbol which has a text that cross the screen with a stop(); action on the frame of 10.

    The main time line, I would like to that ball to start bouncing on frame 2 and stop frame 15, so I placed it on its own layer with a keyframe on frame 2.

    I want, the symbol of the text to start on frame 6 and stop on frame 15 also, so I placed it on its own layer with a keyframe on frame 6.

    It does not work.

    When I play it back, the Visual jump wildly back and forth between the symbols.

    What should I do?

    I work in Adobe Flash CS3. ActionScript 3.0, 30 frames per second, Player 9 (not sure if this is relevant, but just in case).

    Please help me, I'm desperate, I can't understand it.

    Thank you!

    Hello

    I'm so clear with what you're saying...

    You have a movieclip that has its own animation of scenario of a bouncing ball and it stop on chassis 14? Even with text movieclip - he has his own animation of script for simple horizontal interpolation that ends on the frame of 10?
    And you placed these clips on the stage, put them on their own layers and moved the mc of ball to frame 2 and the text in the box 6 mc?

    Are there blank keyframes before the frame 2 on image 6 of the text layer and layer of ball? If not, then select frame 1 layer on the ball and press F7 to make an empty keyframe. Do the same on the text layer but select images 1-5 and click F7 to make them blank keyframes.
    What you don't want to do, is show the movieclip before the beginning of their animation. Therefore, you get the wild flashing.

    Also extended these layers to frame of 15 images? Otherwise, click on frame 15 (for the two layers) and press F5 to add frames.

    And you order stop() on plot of 15? Otherwise, create a new layer, call it actions and put a stop() on frame 15 command.

    Sure that your movie will play correctly now.

    NOTE: Just out of curiosity - why don't simply animate you everything on the main timeline?

  • weird problem with new screen, please help

    Hello people,

    I hope someone can help. I am using windows 7 Home premium and I hope it is a simple solution that someone has met before. It's just that I don't know how to describe it so can't type into google to find an answer.

    This happens in all programs, Firefox, ms word Opera, basically any window I opened. The bar menu at the top of the screen is a transparent white color and everything works well, but after 50 or 60 seconds, it turns into a transparent, I can still read the Word editing, display etc. file. This is where the scroll wheel on the mouse and what I'm typing stops working. When I type something with the mounted volume, all I hear is a single beep whenever I tap on a button, but nothing is actually typed. Now, all I have to do is click anywhere in the window and it works again, but only for 50-60 seconds. I had to click on the screen twice since I started typing this because when I look at the screen, everything I typed is not there because the menu bar's transparent again while I was typing. Its driving me crazy.

    I don't remember what is a problem before, if it was I would have surely noticed. The only thing that has changed is I had been using my 32 LCD TV as a screen for a long time, but I moved and did not bring my TV with me, so I use the PC came with the computer screen. It's a PC I bought my sister a few years ago so I never used the PC screen that comes with it so don't know if it happened when she or what, she has, she can remember either. I have a updated driver, did not work. Changes the settings in customize and cannot do it helped either.

    Monitor: monitor LCD Compaq CQ1859

    Do I something pressed or clicked on something by accident?

    Is there a setting some part that I forgot?

    I plan to cast the spell by the window, its really annoying.

    Please help guys and ladies.

    Hello salamander.

    Please contact Microsoft Community.

    I can understand the inconvenience caused, be assured that we are here to help with your concern.

    1. What is the model of the computer and do ?
    2. Do you see an error message when the menu bar is transparent?

    Please follow the link below and include a screenshot in your post,

    http://answers.Microsoft.com/en-us/Windows/wiki/windows_other-windows_programs/how-to-include-a-screenshot-in-your-post/2594b08e-32a3-476A-85A6-b021181be7e4

    I suggest you follow the methods below to see if it helps.

    Method 1:

    Clean boot: to help troubleshoot error messages and other issues, you can start Windows by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.  Here is the link for your reference perform the clean boot.

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

    Important: please go through the section: How to reset the computer to start as usual after a clean boot troubleshooting section of Kb to start the computer to a normal startup after you fix the problem.

    Note: If the problem persists, continue with method 2

    Method 2:

    Check the problem by disabling the Aero transparency feature. Please follow the steps below to disable the Aero transparency feature.

    1. Right-click on a vacuum of space on the desktop and click on personalize.
    2. Click on the link to the color of the window at the bottom of the window.
    3. Uncheck the check box enable transparency to disable transparency and check the issue.

    For more information, aero feature please refer to the link below.

    http://Windows.Microsoft.com/en-us/Windows7/what-is-the-Aero-desktop-experience

    Note: If the problem persists, continue with method 3

    Method 3:

    A Malware - scanner The Microsoft Security Scanner is a downloadable security tool for free which allows analysis at the application and helps remove viruses, spyware and other malware. It works with your current antivirus software. Please follow the steps below to use the scan to Microsoft Security.

    • Run the scanner from Microsoft from the link below:

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    • Click on download now and click Run.
    • Choose complete system scan and wait for the full analysis.

    Important: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    The above information was hoping to get useful, please return it to us if you need additional assistance.

  • Card problems or video driver with a N200, please help!

    I have a lenovo 3000 N200, that's really cool, works even at games very well, including the most recent.

    But, is it normal that the pilot program display for freeze-out in Warcraft 3? He always does that when you access the list of cards in the game and after 3-5 minutes during a real game. It defines the resolution up to 640 X 480 (from 1280 X 800) and in 16 colors. I have to reset it to get it to work. Also, it does the same thing in Spore - if after seeing the pilot written for Spore installed, (that I downloaded from the lenovo site) I have not encountered this problem far. In addition, Second Life stops - Fortunately it does not freeze the drivers. I understand that the model I have is not designed for the game, but if it can run Warhammer 40 k: Soulstorm with graphics settings meduim (on the widescreen) without a lagg I do not understand why it would not be able to manage warcraft 3 - even a m200 express ATi can manage. I mean that a X 3100 to Intel must be much more powerful. (ATi said card lagg with older games like Unreal Tournament)

    I have the latest version of the - official - driver and a Win Xp pro Sp2. I always keep my system updated - register for Essilor, but until this driver has not need sp3 - and cleaned viruses.

    Please help me?

    Ooh, it seems that I was right, my problems stems from the incompatibility of the software.

    Namely the based opengl driver (this igfx something of the file that is in the rror reports I receive).

    I solved the problem with Warcraft 3, you have to click with the right button on the icon of warcraft 3 and type the destination line (just after the second "")-opengl or - swtnl. (or - d3d, nota bene, who has not worked for me)

    Although even now it's not as pretty as on my table top pc, it works fine and farily good graphics.

    I think your problem is similar to mine and is amplified - sort of - by Vista somehow, it seems to cause a more severe software incompatibility.

  • MuseJSAssert:Error calls the function selection: TypeError: cannot get the "init" reference to undefined property or no, I am a beginner and not able to solve this problem with my website, please help...

    Everytime I open my site I get this error "MuseJSAssert: Errot calling function selection: TypeError: cannot get the"init"reference to undefined property or null" and I was a newbie am not able to solve this problem.

    error.png

    I did take all measures please help.

    Hello

    Can try you it on another browser that the problem does not come up on top of our end.?

    Kind regards

    Akshay

  • positioning or test the mouse on the listener in a class please help!

    Hey,.

    Im tring to redo most of my projects I created of up to class and packages, but this seems to be a mission... stuck like every small step.

    I have the gameMain_Controls class which is the linkaged of the FLA in fact.

    Then I have a custom cursor class and a class of tank

    the gameMain_Controls pulls objects in the scene as children of the fron the tank class background.

    now my problem is to get the cursor to mouse over hittest and make at least a trace out put:

    code im trying right now

    which is also in a different class... called the rollOver_Controls:

    If (flap_Control.flap.hitTestObject (Dino_Control.layla))

    {

    trace ("all hit");

    }

    on the other

    {

    trace ("NO hit");

    }

    but the hittest occurs just never im guessing the problem which is the location of the object, the container, I mean... .but when I try to link this way I have more problems

    Please help sumone

    THX pavel

    You are welcome.

  • Error Code 43 with Nvidea GTX650, please help

    Hello, I currently just bought a Nvidea GTX650 graphics card, I installed all the drivers according to the instructions to however I am unable to access all the games. I explored this further and entered my Manager device and found that my Nvidea GTX650 has an error code 43 for him. I tried the uninstall/install/upgrade to update all the drivers but no luck, please help :)), here are my system specs.

    map of mother Foxconn h61mxl-k

    Nvidea EVGA Gtx650 2 GB GPU

    4 gb ddr3 RAM

    650ub ATX powersupply

    Processor Intel Pentium G620 2.60 GHz

    Windows 7 operating system

    any help would be appreciated thanks.

    Hello

    As you have tried all possible steps and still the problem persists, I would say to contact Nvidia support team check what they have to say on this issue.

    You can also view Code 43: Windows has stopped this device because it has reported problems

    It will be useful.

  • Card ATI Radeon 4570 - NO SOUND in my monitor: Please help!

    Hello

    I use Sony Vaio NW160 and have been using my HDMI cable to connect to my samsung TV and it works fine.
    I bought a new monitor (LG 235V) HDMI... and I am unable to get any video sound is fine. I currently have Windows Vista.
    1. the HDMI cable is fine as I tested it with my TV again
    2. the port monitor works great as my other laptop with HDMI out works fine with this monitor.
    3. the current driver ATI Radeon 4570. I tried the upgrade of the driver by using the Device Manager but I received a message saying that it is up-to-date.
    I don't see any support site that talks about information about updated drivers.
    Help, please! Thank you in advance!

    You have HDMI on the list:

    Start-> Control Panel-> Sound-> reading tab?

    If Yes, is it defined as default playback device (must be).

    Try to download and install the latest graphics driver package from the manufacturer of your PC or, Alternatively, than ATi/AMD (rather than using the Device Manager directly to day).

  • W3202C help w / wall mount - Question has not been answered to another user please help!

    I bought a widescreen Ergotron TM tilting wall mount model 60-572 for my Dell 3202MH.  I purchased through Dell on the phone and said that it would be compatible with my LCD TV 32 '' flat screen.  I searched the manual and all messages in the forum.  I have yet found an answer and one more question asking the same thing.

    How to mount to the wall.  I can't find the screw holes on the back which does not seem to allow that it be mounted.  I don't want to start removing the rear panels to see if they're hiding.  Someone help me please. My service tag is not found in a single cheque, then another, they said it was purchased outside of the United States and got a link back to the same place.  Really, I don't want to talk to another sales who is not knowledgeable and put me on hold 10 times.


Maybe you are looking for