Change the Volume using the Slider component

I am using the slider (aSlider) to control the volume for mySound, which is a class called PlaySound. Created an addEventListener for aSlider with an execution of a function called changeVolume SlideEvent.CHANGE. All other works, but I can't get the cursor to control the volume for mySound. Need help. Here's the current code. TY in advance.


import flash.events.Event;
Import fl.controls.Slider;
Import fl.events.SliderEvent;
Import fl.controls.Label;

var mySound:PlaySound = new PlaySound;

stage.addEventListener (Event.ENTER_FRAME, clock);

var OFF: Boolean = true;

function clock(event:Event):void
{
var currentdate:Date = new Date();

arc_mc. Visible = false;
secondHand_mc.rotation = currentdate.seconds * 6;
minuteHand_mc.rotation = currentdate.minutes * currentdate.seconds + 6 / 10;
hourHand_mc.rotation = currentdate.hours * 30 + currentdate.minutes / 2;

If (secondHand_mc.rotation >-60 & & secondHand_mc.rotation < 0)
{
arc_mc. Visible = true;
If (OFF)
{
OFF = false;
mySound.play ();
}

}
on the other
{
arc_mc. Visible = false;
SoundMixer.stopAll ();
OFF = true;

}


}


aSlider.addEventListener (SliderEvent.CHANGE, changeVolume);

function changeVolume(event:SliderEvent):void
{
var volumeLevel:Number = 5;
volumeLevel = event.target.value / 100;
valueLabel.text = event.target.value + 'percent';
}

you follow all the instructions.  use:

import flash.events.Event;
Import fl.controls.Slider;
Import fl.events.SliderEvent;
Import fl.controls.Label;
import flash.media.SoundTransform;

import flash.media.SoundChannel;

var mySound:PlaySound = new PlaySound();

var mySoundChannel:SoundChannel;

stage.addEventListener (Event.ENTER_FRAME, clock);

var OFF: Boolean = true;

function clock(event:Event):void
{
var currentdate:Date = new Date();

arc_mc. Visible = false;
secondHand_mc.rotation = currentdate.seconds * 6;
minuteHand_mc.rotation = currentdate.minutes * currentdate.seconds + 6 / 10;
hourHand_mc.rotation = currentdate.hours * 30 + currentdate.minutes / 2;

If (secondHand_mc.rotation >-60 & secondHand_mc.rotation)<>
{
arc_mc. Visible = true;

If (OFF)
{
OFF = false;
mySoundChannel = mySound.play ();  delcare mySoundChannel outside all functions
mySound.play ();
}
}
on the other
{
arc_mc. Visible = false;
SoundMixer.stopAll ();
OFF = true;
}
}

aSlider.addEventListener (SliderEvent.CHANGE, changeVolume);

function changeVolume(event:SliderEvent):void
{
valueLabel.text = event.target.value + 'percent';
var st:SoundTransform = mySoundChannel.soundTransform;
St.volume =(event.target.value-event.target.minimum) / (event.target.maximum - event.target.minimum);
mySoundChannel.soundTransform = m;
}

TX 1 million

Tags: Adobe Animate

Similar Questions

  • Remove the Slider component framework

    Hello

    I have a digital Slider component on my application as a progress bar. All goes well until he arrives at the end (of load) and a red box appears around the component. No idea how to get rid of this? Probably a simple solution,

    but can't seem to find the good attrribute in the library.

    I tried the ATTR_FRAME_COLOR attribute, but no luck.

    Very much appreciated.

    This red box is there as a warning to the user that the value of the control is outside its boundaries.

    You must change the values of the max/min control or disable range checking.

    Refer to the figure:

  • Film strip does not change the slide

    Hello

    The film does not match the slide I am edition.

    filmstriperror.fw.png

    I'm on 8.0.1.242

    I did NOT remove online learning of resource files to be updated (according to the instructions of update - that of course person reads really :-)) but have done since.

    I saved and reopened the file some time without success.

    Slides were copied back to a question pool a couple of times.

    That question is on several slides.  I can live with that, but worry that it could lead to greater things (not better).

    Interestingly, the film dressing is BLUE while a post here, said that only BLACK is possible

    Thank you

    Andy

    After having tried many things before posting, I finally hit the solution.

    Film change of medium to large, and vice versa.

    No, a feature that I had never used before...

    Andy

    -Learn something new every day...

  • Change the slide background

    I captured a demo of online software. After that, the company in which I captured it for a was purchased. Here is the challenge.

    To instead re - enter the whole process, I was easily able to just copy the groundswell, put it in photoshop, color adjustment (the only thing that has changed with the new brand) and paste as a new background of the slide. Painful, Yes... but would take a lot less time... taking the rhythm and the voice edition on.

    That worked perfectly with the exception of the slide when he types or a mouse, click. It also appears that Captivate catpures horizontal bitmaps for these actions, which show the colors 'elders '. You don't see these elements in the timeline in Captivate, even though I know they exist because I imprted in flash and saw the elements.

    Does anyone know how to disable these items or modify them so that I can make it coherent with color changes?

    Thanks in advance.

    Hi chrisbk, Richard and Rick,.
    Great that you have thought a work-around, chrisbk! By reading this thread, something kept niggling at me until just now. The head of the Captivate team, Silke Fleischer, offered a "fix" for the text typed a few months ago. It is just a small vewry SWF fijle, but works very well. I don't remember if she did Flash content itself, or if she passed along what someone else had done, but the task of replacing mistakenly typed text can be done by inserting the small top SWF file. If someone wants it, let me know privately and I will it track down and send it to you along.

    In addition, somewhere around here is an SDK to create your own animation text - I think. Rick said that he thinks that a developer would be just 5 minutes to create this typed text effect, so if you speak fluently with Flash or know someone who is, you will need the same 5 minutes to build what would be the development team, who have bigger fish to fry. And to take this logic a little further, there are probably two reasons animating text 'text typing' has not been skipped over earlier as a "must be" by the development team: 1) Macromedia gave us the means to do it ourselves, and 2) it is a simple 5 minutes work...

    I can't find it right now, but maybe if you look for Macromedia 'RoboDemo' and 'SDK '... If it is really important to you and you cannot find it, let me know and I'll try to do some research for you... the link may be dead now, and in any case, I'm sure I'll look in my "Favorites" on a machine that I don't use anymore, but I'd be happy to try.

  • change the slide show's settings in windows 8

    Tried for hours to find out how to adapt images to display in the slide show Windows 8.

    Display images in actual size (I think), resulting in only a part of every photo that appears on the screen.
    Would appreciate any help you can give.

    You nailed it! No doubt caused by changing the size setting in the display properties.

    Just for fun, I checked if Windows 7 has this problem: it does not work. Images display correctly when set to 100 or 150%.

    I would call this a bug because it makes the slide show viewer is pretty useless in anything else than the scaling to 100%. Maybe we can get it fixed the 8.1?

    At least I know a work-around, if I don't really need now. Thank you!

  • Is it possible to set up the video so that it does not automatically change the slide master?

    Hello everyone. Is it possible to not have the video of Captivate automatically running but to manually edit slides, better with buttons? I could not find how do. This is because I would like to use interactions and if the video works as ususal, when the time of the slide is expired are therefore possible to click on the buttons of interactions and, on the contrary, if we want to ignore the slide before that time that is expired, they must click on the next button, and then the play button too complicated! So the best way would be to have an installer of the manula transition. Could you help me with this? Thank you very much. Maurizio

    No, it seems to me it's OK

  • Why a slide doesn't let me change the slide duration?

    I have slides with the audio, and I want the slide lasting only a few seconds longer than the slide audio so time reflects on how long the lesson is in fact. Most of them is right from 400 to 500 seconds now, whereas they should be much less.

    They have buttons that make a break for you move between slides. I tried to cut a wide blade or two seconds after the blade stops editing the slide properties and changing the time. It worked on my first 3 slides, but on my 3 last he does not accept the least time and jump just to some amount of time, it was before. For example, I want to slide 5 to 36 seconds in length, but it is currently at 453.3 seconds, and whenever I try to change it, it returns immediately.

    Calculate the calendar of the legend is not on, and nothing new appears on the timeline, after the blade stops at 34 seconds.

    Thank you!

    There is an element of the Clipboard which is 453.3.seconds. You cannot change the length of the blade to nothing less than the duration for which a element that is configured to display.

  • Import Power Point presentation to 9 Captivate (mac user).  Cannot change the slides. Please notify.

    On a Mac, I imported a Power Point presentation to 9 Captivate.  I would like to edit and add effects.  At this stage I can't edit any PPT Slides.   Could someone advise me. Thank you.

    That depends: do you need to publish projects responsive or normal?

    A theme in Captivate is made (and I recommend this sequence) of all the styles object (including settings of default styles, the States of the buttons and the form buttons, settings for views of breakpoint in the case of projects of reactive), master slides (which will use object styles) and skin. Each theme can also switch to another palette of theme colors. I just blogged about the color scheme, which can also be used in different training Interactions. Most of the books/training just touch this topic very sparingly or omit, that I do not understand. I have printing is bound to have a book out very quickly, and the writers/trainers are not not developers.

  • How can I change the slider (claret)?

    The cursor (claret, caret) is barely visible light vertical line for these tired eyes. How can I chage it to a flashing block?

    Firefox supports two prefs to control the appearance of the caret.

    • ui.caretWidth (integer)
    • ui.caretBlinkTime (Integer, milliseconds; use 0 to disable the flashing)

    Preferences do not exist by default, so you need to create whole new prefs via the context menu.

  • change the display time of all slides massively

    Greetings,

    CP 5.5

    I found account, is a simulation training and evaluation where the timing of the slides is set to 3 seconds of post-production: I want to change ALL of the timing of slides to 2 sec.

    I know I should have done this in the global Prefs by default prior to registration. Will the preferences and try to change the Slide duration post-production does not work.

    Is it possible to do without having to change each slide individually?

    Thank you very much!

    k

    No, I do not know such a flow of work and also think that this would probably cause a lot of questions. If you have interactive objects, change the slide duration will change active/inactive parts, if you have any effects, the duration will be changed relatively, if you have audio, it will cut off etc...

    Is there a particular reason why you want to do this? Maybe for a little little the size of the file? Most oppose default timeline will no doubt also be 3secs, to reduce the duration of the slide that you will first have to decrease the times of the object or attach them to the end of the slide (CTRL-E). If there is no real staggering into objects that will be the fastest way (but always slide/slide):

    • finding items of each type/style and define his script in 2 seconds, you can use the small curved arrow top right of the accordion of Timing to apply to all objects of that style/type
    • then slide/slide select the chronology of the slide and use the shortcut CTRL-SHIFT-LEFT to decrease the length with 1 sec

    Lilybiri

  • How to specify the JRE (component Pack)

    When I created my project, he asked me what JRE to use and I said 4.6.  Now, I want to change to 4.5 (and change to my taste and so forth).  When I go to "Windows-> preferences-> Java-> Installed JREs", I can see all the components, as I should, and I can choose what I want, which makes it the default for newly created projects.  When I right click on my project and go to 'Properties-> Blackberry project-> View/Edit Application Descriptor', there are all my JREs (and so I guess these are the component packs) under the heading "Preprocessor Directives", which doesn't seem to have anything to do with JRE or component.  In addition, they are all greyed out and I can't select another than one marked 'BlackBerrySDK4.6.0', even if I can see all others grayed.

    I'm in the right place to change the JRE/component Pack I want to build for and, if so, how do the selections not gray?

    Or, if not, is there a file I can edit somewhere that tells what JRE to use Eclipse/Blackberry?

    Thank you

    Allen

    You should see JRE System Library in your project in your package Explorer.

    Right-click it, and then click Properties to change your target OS.

    The preprocessor directives change each time you change the JRE to use preprocessor to strip the code that is not compatible with a certain operating system.

  • Replace the slide Shutter Muse click to hover

    I need to change the Slide Show of Muse with a click trigger a hover.  I know it can be done with a Composition, but for various reasons, I want to use a slide show.  Is it possible within the Muse?  If necessary, a hack for the javascript would be acceptable.

    Muse allows 3 party widgets... Take a look at what a slider Gallery - Adobe Muse models

    Demo = Demo

  • How can I change the appearance of the cursor of the mouse on the Board animate when it is over a link?

    I want to change the appearance of the mouse cursor when the end user place it above a link to e-mail and site Web - how do I do this?

    Add the following code in the step/compositionReady:

    SYM. $('texte') .bind (' mouseenter', function() {} ")

    SYM.$('text'). CSS({'cursor':'pointer'});)

    });

    Don't forget to change the name of the item to your.

    You can use the click or the mouseenter and mouseover.

    or if you want just in general, select the item and change the slider in the UI.

  • Change the cursor

    How can I change the slider in Photoshop Elements 8?  When I use a tool, I get triple sliders.  How can I change the cursor?

    Usually, if your on a windows system, then scaling the dpi is set to other than default.

    Even if below organizing says the steps to fix the problem are the same as for the triple slider:

    http://helpx.Adobe.com/Photoshop-elements/KB/menus-missing-elements-8-9.html

  • Cannot change the image of the library in Photoshop =)

    I just installed Captivate 2

    After recording my first demo, I tried to change the slide (the image of 'background' in the library by using the command EDIT in. This command opens MSPaint (gahh! what a horrible program!). There is no way I can see to tell him to open Photoshop.

    Furthermore, in the tutorial on the edition of your program that comes with the program, the film shows Photoshop being opened.

    In this Online Article , there is a "note" that the external program is defined during installation, but offered no such configuration.

    Please, help me make my editor PHOTSHOP. Thank you! = D

    Hi Monoxylon,

    I'll jump here where Rick is offline. You need to right click on the name of the image in the library, not the button Edit with. Once you do a right click on the name in the library, you will see a menu option "Edit with...". ».

    IHTH

    Best,
    Aaron

Maybe you are looking for

  • iPhone 7 - Audio issues?

    With the iPhone 7, how someone listens to music and recharge at the same time? Obviously, the work around is to use the buttons wireless, but the latter only 5 hours. I think of flying long air or plug in your phone when you listen to music. Somethin

  • What is the black bar in my dock under the application icons?

    I know small black dots indicate that an application is open.  But there is a larger black bar located under 2 icons that are not open. It does not matter that I put top is soft.  It is always in the same place.  And it appears only when the dock is

  • I can not activate save passwords!

    When I go to tools, options, security, save password option is not put out and work. He has worked in the past, but now is not allowing me to enable the option.

  • Satellite A - new battery not detected

    Changed battery from PA3534U-1BRS 4000mAh to PA3534U-1BRS 4400mAh. What new battery installed message "no battery detected.I tried to turn off the machine etc. and remove, then reinstall the new battery, but it makes no difference. Any advice?

  • HP r203tx: driver graphic Hp intel

    I recently installed windows 7 64-bit OS in computer laptop hp-15 r203tx. But I can't seem to find the right drivers for Intel Graphics Driver. Please help me find the necessary drivers. Thanks in advance.