Play a sound mousing in a canvas html in Flash CC document

Hello

I looked for a while to do something that I'm sure is simple, but I can't find the answer. I'm sorry if I missed it, but I appreciate any help anyone can provide.

I have a simple button in flash that I am converting a document to html canvas so I can put like html in my Web site, with animation and its passage of the mouse. I had the animation works as I want, when I publish to HTML, but using Actionscript 3, I got a noise that played when the user said above the button. I want it continue to play a sound when the mouse user in my HTML file also, canvas top but I did not have success with the conversion of my Actionscript to Javascript and am not an expert by any means of javascript. I also have several formats of audio file linked in the code for all browsers that do not work with mp3 files. I can convert the audio file without problem but do not know how this code... I found some general tutorials on this, but have not been able to get it to work with anything I've tried so far.

Here is the Actionscript code I had which works very well in my original document when I export a .swf file.

Stop();

import flash.media.Sound;

import flash.net.URLRequest;

import flash.events.Event;

sprayGunbtn.addEventListener (MouseEvent.MOUSE_OVER, playSound);

var myExternalSound:Sound = new Sound();

var req:URLRequest = new URLRequest ("ShortSpray.mp3");

myExternalSound.load (req);

function playSound(event:Event) {}

myExternalSound.play ();

}

If someone could help me to convert it into Javascript so that it does not work when I publish my .fla to HTML file, I would be very happy. Thank you very much in advance for your time...

You can follow the steps below to easily play a sound when running - as on mouseover.

1 make sure that your audio is imported into the library and has a specified binding name.

2. open the Windows Menu-> Panel Code fragments, code and develop HTML5 Canvas-> managers section of events.

3. Select your button on stage and apply the Code snippets MouseOver event.

4. in the function MouseOverHandler add the line below and the test film:

playSound ('audio_linkage_name');

If you are still having problems let me know.

In addition, you can go through the documentation for SoundJS for control with HTML5 Audio.

Tags: Adobe Animate

Similar Questions

  • Using Google font on canvas HTML in Flash CC

    I'm new to working with HTML5 Canvas format. I work with some Google fonts (Raleway / Roboto) and I was wondering if there was a way to declare the necessary link for these fonts script
    for example within the CC Flash?

    < link href =' http://fonts.googleapis.com/css?family=Raleway:400, 700 | Roboto:400, 700"rel ="stylesheet"type =" text/css"> "

    Currently, I have to open the HTML file after publication and insert this script in the HEAD section, which works, but this should be done whenever the file is published and is not appropriate in cases where other people can ask him to update these assets.

    Is it possible to call this script, possibly using Javascript, so I can put it in image1 or something else?

    Please excuse my massive noobishness.

    Hi all

    Google Web fonts are now available for the HTML5 canvas documents in the last update to animate CC (15.2.1)

    See here: new feature summary (June and August 2016)

    By using the Google fonts to animate CC

    Download the latest version of CC animate using CC app to try it!

  • Satellite M100-221: Solution Possible BSOD / sound + mouse problem

    Hi all!

    Recently my Satellite M100-221 started crashing and freezing, so I reinstalled Windows XP.
    However, some problems are still recurring.
    First, before posting that, I browsed all the forum and found a few questions from people who are experiencing a BSOD (blue screen).

    I solved this problem by removing HWSetup programe of PC (because, as he wrote on the blue screen, its driver was causing a problem).
    All who have this problem should consider all the software Toshiba, because maybe this is the reason.

    However, I have 2 questions.
    First of all, which is my mouse (and touchpad too) just occasionally freezes for a second.
    I tried different mouse - but it's the same thing. (It may not be the connected with the performance of the CPU, because before the re - install XP, I didn't have the problem).

    And secondly is connected with sound - noise from time to time (whether it be the music play or simply 'click' sound effect) freezes just - which makes the periodical "trtrtrttrtr" - like sound))) that the two problems are so boring - because you just can't help the note!

    I've got drivers provided by Toshiba - maybe the problem is with them?
    So should what drivers I expect?

    Please, someone, help!

    I solved the problems and it took almost two days to determine what the problem is.
    Well, I read a lot of discussion on the failures of sounds, mouse freeze and so on. But there is always only one advice: updating drivers, BIOS, etc, etc. After two days, I have updated all the drivers on my laptop, updated the BIOS and fact repeatedly - but all that was * _completely useless_ *.
    I've got Intel Centrino Duo processor - so I started to experiment with a single core enabled - play music and watch videos and watch to the works of the processor. According to the process manager, got processor loaded at 50-60% of its power every 2-4 dry. And it turns out to be Hotkey.exe! Toshiba utility! This means that software of Toshiba's just unnecessary powerful processors, because this software is completely unprofessional. I have nothing against Toshiba - laptops are one of the best, but they should at least try their own software before distributing it with their PC.
    So I guess some problems with your laptop, mates, can be solved by turning off unnecessary all software and utilities Toshiba - just them clear in the automatic boot menu.
    Good luck!

  • Windows Media Player only plays the sound of a dvd.

    When I put a dvd in my computer, it only plays the sound. No image appears.  How can I fix?

    If you hear the audio but not see the video, you are missing one of the codecs needed to play the file. For more information, see Codecs: frequently asked questions

    You can download and install ffdshow and check again: -.

    http://sourceforge.NET/projects/ffdshow-Tryout/

    or, try VLC Player: -.

    http://www.videolan.org/VLC/download-Windows.html

  • Play a sound to a page with MP3s

    Hi all

    I have problems with playback of MP3s from a Web page. I'm working on a Web page showing the names indigenous nyungar for items and a link to an audio file for the pronunciation of the word.

    I have the following choices:

    1. download as a media - streaming mp3 download

    Disadvantage is that a new Web page to read the article, and I want the user to hear the audio file and stay on the web page. I got to chat and they said that the downloading of media requires its own Web page to play, so you can only choose to open in target _blank or replace the current Web page. This is not a good user experience for my client.

    2 embed the audio file with this code:

    < embed height = "50" width = "100" src = "soundfile.mp3" >

    < object height = "50" width = "100" data = "soundfile.mp3" > < / object >

    Downside, reads the audio file as soon as the page loads and I want the user to click the sound file to play when they choose to hear it.

    3 HTML 5 code as follows:

    < audio controls = "orders" >

    < src = "source Song1.ogg" type = "audio/ogg" / > "

    < src = "source Song1.mp3" type = "audio/mp3" / > "

    Your browser does not support the audio tag.

    < / audio >

    Will play a sound at the same time, but has a large image of a sound control panel. I also download each mp3 AND Ogg format audio file, such as Firefox reads only the ogg files using this code HTML5.

    I also found jplayer but it is HTML5 as well and also need the mp3 and ogg files.

    If anyone has any other suggestions to play sounds from Web pages?

    Thank you very much

    Mary

    Hi Mary, the good news on playback of mp3s with SoundManager 2 is that you don't need all the audio formats as you would if you just use HTML5 audio.

    SoundManager can tell if your browser does not support the mp3 (like Firefox) and will substitute for a Flash Player to play the file in these browsers.  If OGG conversion is not that attractive, then don't.

    Here is an article titled great by the developer of the SoundManager 2 on the oddities of the audio on the web: http://24ways.org/2010/the-state-of-html5-audio/

    I think that SoundManager 2 is the best way to get the most flexible mp3 player without having to convert audio files in ogg.  It is quite easy to make links to the MP3 files online players:

    1. Download SoundManager and unzip and publish your Site of BC (it's usually in a folder called "soundmanager2")
    2. Update your link (A) items to include the class "sm2_link" to the CSS file in the next step to apply styles to your link.
    3. If your links are linking directly to a .mp3 file, then you are done with the markup, but if you use the module of literature to view links mp3 then you need to add an extra class to your links called "inline-playable.
    4. Download this CSS stylesheet for your players online style and upload it to your site and reference it in the HEAD of your page or template in British Colombia.
    5. In the HEAD of your page or your model includes the script reference in the soundmanager file:
    6. Download this script creates the online players from your markup.  Reference this script after the reference soundmanager we created above in the HEAD of your page or model.
    7. If you want to try to work around a Flash blocker in case it uses a flash drive to play your audio file then just download and reference the CSS file in the HEAD of your doc as well.

    You should be all set after these steps. If all goes well a time or two, perhaps to everything you need to set up and test it.

  • From itunes to an mp3 CD burned on a macbook OSX 10.7.5. The cd plays a sound skreechy in the wave cd player. How can I fix it?

    Burned a cd from itunes to an mp3 on a macbook OSX 10.7.5. The cd plays a sound skreechy in the wave cd player. How can I fix it? The cd will play the mp3 in the macbook. He play the cd or access my itunes music? I burn on CD documents successfully. But I've never burned audio successfully. Please notify. Thank you.

    For problems of audio on a CD (as opposed to combustion problems do not at all), you can often clear up by re-burning at a lower speed.  Use 2 x.  This setting is available in the dialog box burn the disc.

  • Is it possible to play different sounds for the emails and instant messages?

    Hello

    I was wondering if it was possible to play different sounds for the emails and instant messages. I use Thunderbird quite often with emails and instant messages imported from Gtalk.

    I think it would be very convenient to be able to distinguish the two sounds, because they do not involve the same things.

    Thank you very much.

    Olivier Hubert.

    There are only six modules of cat, three of them are on notifications. Choose the one you think will do the job for you. https://addons.Mozilla.org/en-us/Thunderbird/Extensions/chat/?sort=popular

  • could we have a * filter * option to play a sound?

    I'm bored of Eudora. I had a sound for each of my clients, so I knew that to get up and come to answer them. I know that we have a framework to play a sound when * any * message arrives, and I have this job very well.
    But if I had a filter option, as I had in eudora, then, as I say, I could play different sounds for the email addresses that come in. It allows me to be better serving the customer to my clients, because I hear and come to the computer to take care of them.

    ToneQuilla

  • My Apple TV is only to play a sound on my iPad but will not show the film?

    My Apple TV is only to play a sound on my iPad but will not show the film?

    Welcome to the Jennifer Apple community.

    Some content providers don't block the video portion working with AirPlay, have you checked to see if AirPlay is supported by this provider.

    If it is supported

    these steps, check to see if things work after each step if necessary, before you try the next.

    1. Check AirPlay is on the Apple TV (turn market if it already is)
    2. Check that both devices are on the same network (settings > Wifi on the mobile device and the settings > General > network, on the Apple TV).
    3. Restart the Apple TV (settings > general > restart).
    4. Restart the Apple TV by removing ALL cables for 30 seconds.
    5. Restart your router. (Also try to remove the power cord for at least 30 seconds)
    6. Restart your mobile device.

    If you're still having problems, the following article can help you.

    Troubleshooting AirPlay

    Troubleshooting connections and Wi - Fi networks

    Recommended Wi - Fi settings

    WiFi Diagnostic Software (for Mac users)

    You will also find help on this page, where I have collected some of the more unusual solutions for network problems.

    When you make adjustments to your network for better optimization, you can find some of the points mentioned onthis page useful.

  • Satellite P30 ceased to play any sound

    All of a sudden my satellite p30 collapsed to play any sound... what should I do?

    Hello

    Check Device Manager if there is no yellow exclamation next to the sound card. In addition, you should try reinstalling the audio driver.
    Furthermore, please check the audio settings in Control Panel under sound and audio devices. Check if the 'secret' is not enabled.

    Did you also check the volume control on the side of the laptop? Do it!

  • Satellite L300 play any sound on my speakers

    my laptop is not playing a sound on my speakers even if my laptop says it works fine, I get the sound with headphones, but not without them in, can someone help me please?

    Thank you very much

    Martin.

    Hello

    Sounds like speaker issue.
    What cell phone do you have exactly?
    Have you tried reinstalling the audio driver?

    You have a Realtek HD audio Manager in the control panel?
    If Yes, check the advanced options in the upper right corner.

  • Equium A100-306: built-in speakers do not play certain sounds

    I got my A100-306 for 2 weeks, and my speakers do not play certain sounds. This problem appeared only in recent days. When I go in the speaker settings control panel it says that there are no speakers.

    Can someone tell me what to do to fix this?

    Very strange
    I think you should check several possibilities:

    -Plug the headphones and check if you can hear the sound through the headset.

    S ' Please check the Device Manager. Do you see any yellow exclamation?
    Try to remove the sound card and remove the audio driver.
    After restarting again try to reinstall the driver of its new.

    -On the laptop the Realtek HD sound effects Manager must be installed.
    Please check the settings there.

  • How to play image sound and moving of AVI file

    Hello

    I'm using LabVIEW 2010 and making the program to play image sound and moving to AVI file at the same time.

    I could play animated image of AVI file using "AVI OPEN.vi".

    However I couldn't play the sound file to AVI.

    Please give me an opinion on this issue.

    Hi yosuke

    If am not wrong you can do with the Windows Media Player ActiveX control.

  • Media Player. I have a few movies on memory stick, but when I open the media player it only plays the sound track without video. Can help you!

    Media Player. I have a few movies on memory stick, but when I open the media player it only plays the sound track without video. Can help you!

    Hi Jim,.

    1. What is the operating system installed on your computer?

    2. What is the format of the file you are trying to play?

    3. it worked earlier?

    I suggest you to follow the steps and check if it helps.

    Installation of the Codec and check if it helps.

    Codecs: Frequently asked questions for Windows 7

    Codecs: Frequently asked questions for Windows Vista

    Warning: using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

  • Windows Media Player does not play with sound .m2ts.

    WMP does not play with sound .m2ts.  used for, it is no more.  I tried the ms fix the thing did not help the cause.  What can I do to fix this?

    Hello

    1. which version of the Windows operating system is installed on your computer?

    2 have you made changes on the computer before this problem?

    3. what version of Windows Media Player do you use?

    4. are you able to play .m2ts files to other players?

    5. what exactly happens when you try to play the file?

    I suggest you try to install Codecs and see if it helps.

    Codecs: Frequently asked questions:

    http://Windows.Microsoft.com/en-us/Windows7/codecs-frequently-asked-questions

    Warning: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    See the following article from Microsoft to check the version of Windows Media Player.

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

    Hope the information is useful.

Maybe you are looking for

  • Limited to 1 TB of storage to iCloud

    Why am I not able to get more than 1 TB of storage iCloud? I have well over 1 TB of photos I took over the years and I wish I could use iCloud backup when you use Photos.app, but I can't, since space max, I am allowed to buy with iCloud is 1 TB.

  • Cannot open in another tab

    I used to be able to right-click on a link and ask so that it can be opened in another tab. This option is in the context menu, but nothing happens. I use Windows XP, Firefox 36.04

  • Synaptics pointing device does not work on my Satellite L50

    Hello I have a Toshiba Satellite L50, only bought 3 weeks ago, the touchpad has virtually stopped working. I can only move the mouse briefly when I first turn it on, and then it stops working. Scroll still work and selecting, but I can't move the poi

  • Qosmio G20-139: error creating DVD with MCE

    Hello I'm having a problem DVD creation with MCE. I followed all the links, trying to save my recorded TV progs. I get on well, until it starts to create a DVD. It only happens to 1%, then he rushes up to 100% and after about 30 seconds it says "dvd

  • HP Officejet6700: at startup I get 'HPStatusBL.dll' is not found.

    Recently, I uninstalled my Officejet 6700 upgrade to 8715 Officejet on my laptop (Dell) 64-bit.  Now, at the start, I get the following error message: "C:\Program HP HP officejet 6700\bin\HPStatusBL.dll be found" 8715 installation works very well. Th