ActionScript to activate sound/music/on

What I want to do:

Use a single Clip to activate the sounds or music works by using Actions. I also want the clip to fade on rolling upwards and downwards in slowing.

What I have:

A flash file with a clip in the first keyframe. The keyframe has a stop action and the button frame has the following actions:

var SND = new Sound();
snd.attachSound ("musicsample");

On the sample of music in the library, I've added the link identifier "musicsample" export for ActionScript.

The button itself, I have these Actions:

{run}
this.gotoAndPlay ("btnup");
}
{We (Rollout)}
this.gotoAndPlay ("btndown");
}
on (release) {}
Toggle a flag between TRUE and FALSE:
IamActive = not IamActive;
Do different things according to the current state of the indicator:
If {(IamActive)
different actions to perform for 'on' the State of the button
_root.snd.start (0, 1);
else {}
}
different actions to perform for the State of the button 'off '.
_Global. Behaviors.Sound.music.stop ("music");
}

}

Here is the Flash file, I work with: http://www.designmx.com/temp/buttonfademusic.fla

Please help: Maybe this isn't the best way and if there is a better way please let me know, but otherwise please help me understand why it works well.

Thanks for your help!
-James

Hi James,
Some problems of syntax.

{run}
this.gotoAndPlay ("btnup");
}

{We (Rollout)}
this.gotoAndPlay ("btndown");
}

on (release) {}
Do different things according to the current state of the indicator:
If (!.) IamActive)
{
IamActive = true;
different actions to perform for 'on' the State of the button
_root.snd.start (0, 1);
}
on the other
{
IamActive = false;
different actions to perform for the State of the button 'off '.
_root.snd.stop ();
}
}

--
Kind regards
Erick Souza | ericksouza.com

Tags: Adobe Animate

Similar Questions

  • How re - activate management music manually after the upgrade of the OS

    I'm upgrading my computer Windows Windows 10 and since then I can not check the button to manually manage music and videos without telling iTunes to erase the content of my iPhone to activate this option.

    This if the first time that I had an operating system upgraded since getting my iPhone - if I agree to the guest of iTunes, iTunes will erase the music and videos currently loaded on the iPhone? What happened to my ringtones?

    See recover your iTunes from your iPod or an iOS device. As long as everything you want on your device is in your library, then it can back on the device if it is deleted. A restore of backup, as new device, restore backup cycle may be the best approach, once you got all the media.

    TT2

  • Sounds (music and sounds efects) but no speech in sound of DVD playback. Vista

    Real Player doesn't work at all with DVD

    Windows Media Player does not load even

    Windows Media Center plays a DVD with sound effects and music, but no speeches.

    I have tried different DVD including the new ones, all with the same result.

    Hi, you can read the article and check. Solve problems in Windows Media Player http://windows.microsoft.com/en-us/windows-vista/Troubleshoot-problems-in-Windows-Media-Player

  • How to activate sound alerts for mail (incoming or outgoing)

    I recently bought a new iPad but when I send an e-mail or receive an e-mail there is no sound notification. The volume is on. Any ideas how to turn the notifications please? Thank you.

    Have you checked the settings in settings > general > Sound AND settings > Notifications > Mail? Other sounds work?

  • don't sound/music

    the music keeps playing from in online games, I play in the last 2 days unless I shut down the computer. I've changed anything on my computer. any ideas, anyone?

    Hi terrierk,

    Can you play these games in your browser, or are they installed in your system?
  • How can I activate the Music Tools tab in Win Movie Maker?

    I see that video tools. Help! :(

    Whenever I'm editing a video no sound will pop up. :(

    Green Hello Panda,

    The best place to ask your question of Windows Movie Maker is inside Windows Live help forums. The experts he specialize in all things, Windows Live and I would be happy to help you with your questions:

  • How to manually activate LowerField music videos in progressive video clips -?

    Hi all

    I have my music videos lined up on my pasteboard AdobePremElement13, they are all in the lower field (and Pal 25f/s (!) 4:3)

    I need to have returned them in a (uncompressed) Avi output in progressive instead.

    (Elements13 does, ok, but I'm not sure on the quality of the connection securing: my editor will compress the avi file on a DVD Pal subsequently, and also as a file to be read on computer and that is why they prefer gradual-).

    Rendering automatically re-encode the file down field in a Progressive file, or there are losses to be expected? or am I limited otherwise to maintain order at LowerField, due to my video clips being LowerField originally?  The problem with LowerField its DVD is Pal, so it seems it should be UpperField (!).

    It was decided that he would develop progressive (non interlaced) as well as the film be read anywhere, but is it possible? and is it possible with Elements13?

    == > why I ask:

    -Of course I specify rendering of time 'progressive' settings, but I want to be sure that I don't have to recode manually each clips video (I have 77 of them) of LowerField to progressive. Should be, how on Elements13? I don't see the device to operate this initial transformation.

    (you can see there are two questions in one, as I am a bit confused by the problem in which I am)

    Much thanks yous!

    Dewey.

    If your original video is interlaced (bottom field first) and your project settings Premiere Elements perfectly with the specifications of your video, then all you need to do is exit your video with a gradual adjustment and it comes out gradually. Without interlacing.

    I don't know how that will affect NTSC to PAL conversion, given that other factors to consider also (frame rate).

    What is the original source of your video? It comes from a camcorder?

    What is the resolution and speed of the video?

  • I can't activate my library of music to icloud. I got a new phone and it won't let me turn the music I had in my previous phone

    I just got a new phone and can not activate my icloud music library. I get a message saying that I can't turn on my music. What can I do?

    Welcome Vikyr,

    I know how it is important to get your iCloud music library running. I'll be more than happy to help you resolve it.

    Start with the basics. Please go to settings > iCloud on your iPhone and log on to iCloud. Once done, reboot the iPhone using this article: restart your iPhone, iPad or iPod touch - Apple Support

    Once finished, go ahead and sign in iCloud and try to activate iCloud music library again.

    See you soon

  • My laptop HP Pavilion will not record any sound at all - please help

    Dear all

    My laptop Hp Pavilion is not allow me to record all sounds - not in the built-in microphone and not through any plug microphone I have.

    -J' already checked that my microphone is not muted
    -J' already checked that my microphone is set to the default device
    -J' already checked that my burning software (Audacity) has selected as the device microphone to take his
    -I think I have the latest drivers for my microphone, but I'm not 100% sure

    Can someone please help me with this? I would be very grateful.

    Thanks in advance

    Hello

    Method 1:

    I suggest you to visit the links below and check if it works.

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-audio-recording-problems
    http://Windows.Microsoft.com/en-us/Windows-Vista/record-sound

    Method 2:

    You can also refer to the steps below:

    a. Open Sound by clicking on the Start button, then Control Panel. In the search box, type sound, and then click sound.
    b. click on the recording tab, click on Microphone and then click Properties.
    c. click the levels tab and make sure the mute button is enabled, if off to click on it to activate sound for this connection and then click on apply.
    d. click on the Advanced tab, click to clear applications to allow him to take exclusive control of this peripheral checkbox and then click OK.

    See the link below:

    http://Windows.Microsoft.com/en-us/Windows-Vista/connect-a-microphone-music-player-or-other-audio-device-to-your-computer

  • No sound when using webcam

    Im trying to talk on the webcam I have can be seen but not heard all my tests seem ok nothing is on mute, I had this laptop about 3 years

    I seem to have lost my microphone on my laptop there is nothing on mute and I tried everything

    Hi James

     

    1. What is the brand and model of the computer you're using?
    2. what applications do you use to make the call?
    3 have you tried to use another application to check the microphone?

    4. the audio device works correctly for other purposes like playing music?


    Verify that the default sound device is set correctly and other options are also needed. You can use the following steps and make sure the default audio device is correct-

    a. Open Sound by clicking on the Start button, then Control Panel. In the search box, type sound, and then click sound.
    b. click on the recording tab, click on Microphoneand then click Properties.
    c. click the levels tab and make sure the Mute button is on, if off to click on it to activate sound for this connection and then click apply.
    d. click on the Advanced tab, clear the checkbox allow applications to take exclusive instrument control and then click OK.

    Check the link for assistance on the question below
    http://Windows.Microsoft.com/en-us/Windows-Vista/connect-a-microphone-music-player-or-other-audio-device-to-your-computer

     

    I hope this helps.

  • Drivers works fine, but I cannot listen to or hear any sound (when starting, I hear windows start sound / tone)

    I ve realtek speakers. The symbol of the speaker does not have a cross. I hear the windows starting sound/music, when starting. I looked in the playback options and drivers who are working very well. Only problem is the computer is not detecting my headphones or speakers, I m using Windows Vista Home premium. My speakers are on and was running at full volume, but when I go in the playback devices it says that speakers are not connected. The drivers work well, but I cannot listen to or hear any sound.
    Please help me about this

    Somehow, the speaker jack is disabled on your machine.

    1. Open its in control Panel.
    2. On the read tab, highlight the icon speakers
    3. Click on the Properties button
    4. The box of the use of the device can be set to "disable this device.

    Otherwise, I disable it, apply and activate, apply the setting.

    Messages rating helps other users

    Mark L. Ferguson MS - MVP

  • How can I control the volume of a voice in a video + background music

    I would like to control the volume of a person speaking in a video and the volume of the background music independently of each other with two volume bars. The problem seems to control the voice of the video.

    What I can do... but not really wanted to do:
    (1) control the volume on voice and music at the same time (but not independently)
    (2) control the music but no voice

    Here is the actionscript code that controls music. The ActionScript of voices is considered as being almost totally similar.

    I use Flash 8. (Any flv) video name is LD

    bgSound2 = new Sound (this);
    bgSound2.attachSound ("Guitar");
    bgSound2.start (0, 99);
    bgSound2.setVolume (0);
    playB.enabled = false;
    slider2.slideBar2._x = 20;
    slider2.slideBar2.onEnterFrame = function() {}
    bgSound2.setVolume (0-(this._x));
    };
    slider2.slideBar2.onPress = function() {}
    startDrag (this, false, 280, this ._y, 0, this ._y);
    };
    slider2.slideBar2.onRelease = slider2.slideBar2.onReleaseOutside = function () {}
    stopDrag();
    };
    stopB.onRelease = function() {}
    bgSound2.stop ();
    playB.enabled = true;
    stopB.enabled = false;
    gotoAndStop ("playB");
    };
    playB.onRelease = function() {}
    bgSound2.start (0, 99);
    playB.enabled = false;
    stopB.enabled = true;
    } ; stop();

    Thank you
    Jens

    Thanks A.Arun,

    Here's what I did
    My "quick" fix was to place the two sounds, actionscripts to _root, using the video voice for first script sound and music in the second. I deleted the break buttons (because you can still lower level 0) and for the first script, I used:
    bgSound1 = new Sound();

    Now, I can turn the volume on the two sounds independently to the bottom to the top.

    Sincerely
    Jens

  • Keyboard sounds

    Is there a a way to activate sounds clicking when you type on the keyboard, without going through the notification sounds (as well as do not disturb)?

    Click on the default keyboard.

    If the mute button is defined, which disables clicks.

    If this is not the case, reset the iPhone.  Press and hold the power and home together for 10 seconds until the Apple logo appears.

  • my music disappeared from my iPhone 6 s

    music from iPhone 6s disappeared. How can I find it?

    Can you tell us more?

    Was the music synced from iTunes, content purchased, shared the content of the family, sharing a subscription music Apple or iTunes game music?

    You activate the music library to iCloud and write what you already might have on the device?

    We need to learn more.

    Oh and you have music elsewhere? iTunes library?

  • Decline in music Apple lock my Apple ID

    My Apple ID has been locked by the system after that I refused to use the Apple music in the 'Music' application

    In fact, I rarely buy or listen to music through this application. But I found that all my iDevices is unable to access the App Store for app updates after I refused to use the Apple's music. I tried to reset the password of the Apple ID but I can't always sign in to the account using one of my iDevices (but using iTunes in my office all right).

    I contacted support and they told me that I must save and reset all my iDevices so that I could access my account for the purchased applications and updates. I found it very disappointing. I don't know why my account has to be locked by the drop just to use a service that I don't really need. Also, Apple does me not with any alternative ways to solve the problem (couldn't they just unblock my account?), but keep telling me to rest all my iDevices. Don't they know that it may take a week to do? It seems to me it's the "penalty" to not use their additional paid services. I think that this way, Apple has turned itself a brand that improves the productivity of one who exploit every penny of their Customer/Subscriber.

    Anybody know that all have ideas on another way to solve this problem? Thank you!

    I have never, ever heard of this issue. Personally, I doesn't activate Apple Music and have no problem at all.

    Pls try a simple Reset: hold down the Home and Power buttons until you see the Apple logo (15 to 20 seconds).

Maybe you are looking for