As3 sound help

hey folks,
I'm an older as2 guy, making the switch to full as3. Now I want to do as much as I can in as3. My last obstacle is sound. I can get sound to play but I cannot add a delay to the sound. So when I pick the item up to drag, it lifts up and I have a delay using a caurina tween to make it appear more life like. I'd like to delay the sound play for the duration of the item set down. I've attached the section of code. Any ideas would be great. I know I could add blank sound space to the mp3 itself but over the scope of my project that'd be crazy.
var me:Object;
function grabMe(e:MouseEvent):void{
me = e.currentTarget;
me.removeEventListener(MouseEvent.MOUSE_DOWN, grabMe);
me.startDrag();
e.target.parent.addChild(e.target)
var tweeny:Tween = new Tween(me, "y", Regular.easeIn, me.y, me.y-75, .04, true);
var scaley:Tween = new Tween(me, "scaleY", Regular.easeIn, me.scaleY, 1.3, .09, true);
var scalex:Tween = new Tween(me, "scaleX", Regular.easeIn, me.scaleX, 1.3, .09, true);
var my_shadow:DropShadowFilter = new DropShadowFilter();   
my_shadow.color = 0x000000; 
my_shadow.blurY = 3; 
my_shadow.blurX = 3; 
my_shadow.angle = 90;   
my_shadow.alpha = .2; 
my_shadow.quality = 15;
my_shadow.distance = 75;  
var filtersArray:Array = new Array(my_shadow); 
me.filters = filtersArray;
stage.addEventListener(MouseEvent.MOUSE_MOVE, dragMe);
stage.addEventListener(MouseEvent.MOUSE_UP, dropMe);
function dropMe(e:MouseEvent):void {
stage.removeEventListener(MouseEvent.MOUSE_UP, dropMe);
stage.removeEventListener(MouseEvent.MOUSE_MOVE, dragMe);
me.stopDrag();
me.filters=undefined;
var tweenydown:Tween = new Tween(me, "y", Regular.easeIn, me.y, me.y+90, .4, true);
var scaley:Tween = new Tween(me, "scaleY", Regular.easeOut, me.scaleY, 1, .9, true);
var scalex:Tween = new Tween(me, "scaleX", Regular.easeOut, me.scaleX, 1, .9, true);
me.addEventListener(MouseEvent.MOUSE_DOWN, grabMe);
my_channel = my_sound.play()
function dragMe(e:MouseEvent):void {
e.updateAfterEvent();

Hi there,
I have looked into tweenlite but this will be part of a funded project. Even though we see no money according to tweenlite I'd have to get a corp licence which is crazy. Those are regular tweens, but I use a timed drop to appear more realistic. But due to slowing down the animation the sound plays immediatley. I need to find a command to postpone the sound playing for 1 second upon mouse release. Make sense?

Similar Messages

  • New to Flash AS3, Need help with some weird issues, have .fla link attached...

    Basically, the buttons are not visible when siteplan_mc is replayeed after floorplan closes, but they still work. Most things are only working on double click for soe reason, tho I have them to function on click. and the back button only woorks on unit 1 floorplan, tho the code it the same for all floorplans. I have a feeling it has something to do with levels... but I really have no idea... hopefully someone can help!
    thanks in advance,
    Sarah
    http://www.30eastroosevelt.com/RRHA_SITE.fla

    There are at least two things you're doing wrong. You can't go to a frame where something exists for the first time, and immediately do something to it. Like in your playunit functios for example:
    gotoAndStop("unit1")
    unit1_mc.alpha = 1
    unit1_mc hasn't yet drawn itself on stage to have its alpha set, and so there's an error. That is something that was improved in Flash 10, so if you had set the Flash to publish for Flash 10 and not Flash 9, then the floor plans and the back buttons appears ok. It would sometimes work with double clicks because by the second time you clicked, the movieclip now existed. You might be able to do what you want by having all of the room units on frame 1 of the siteplan_mc, and then set their visible to true or false as you need them, instead of doing the gotoAndStop().
    The other problem is that you're trying to set listeners on the Back buttons that don't yet exist. Wait until you're on the frame where the buttons exists, and then set its listener for the mouse click.
    Other things you're doing could be improved too, but really you might want to get together with someone who has done more AS3, to help you become more familiar with how it works.

  • Hi just converted avi file to mp4 the film will play but there is no sound help please

    hi
       Just converted avi file to mp4 the film will play but there is no sound help please.
    Thanking you

    First repair your QuickTime from Control Panel and see if it helps.
    If not, refer to this article to troubleshoot:
    Troubleshooting iTunes for Windows Vista or Windows 7 video playback performance issues
    http://support.apple.com/kb/TS1718
    iTunes and QuickTime for Windows: Audio does not play or plays incorrectly
    http://support.apple.com/kb/TS1362

  • AS3 need help converting

    Hello everyone,
    i have a site im working on that uses as2 but i need to
    change it to as3, any help would be much appreciated.
    Thanks

    Hi again, so I'm still having a few issues, your help is much
    appreciated. The snippet you gave me for the movieclip buttons
    works great but there is no hand when you rollover the button ( i
    can probably figure that out ). Pretty much the swf is a navbar for
    an html site, when one of the movieclip buttons is pressed i need
    it to go to say "work.html" but I also need it to tell the SWF to
    go to a certain frame label for the down state of the button. Here
    is my website under construction
    www.lafrancemedia.com . and
    here is the code up to date:

  • I don't have any sound coming from my computer. I checked all the speakers but i still don't have any sound. help!

    I don't have any sound coming from my computer. I checked all the speakers but i still don't have any sound. help!

    Do you have sound coming from the audio output port using headphones?  If so, when the plug is pulled out, is there a red light?
    You may need a PRAM reset:
    http://support.apple.com/kb/HT1379
    Ciao.

  • Stop all sounds as3? Help

    When the game starts. I have toggle button. I can play a sound or stop sound. When i play the sound, of course its not muted so even if i go to the next page. I can reason out that the sounds will still play.
    But if i press the no sound,so it means it must be muted.. on the first screen, the sound stops. But when I go the next frames and to others. The sounds are playing. The sound on the starting screen
    was like
    var test:Sound = new NameOfSound();
    but in the next frames.. the sound is in the frame itself.. no declaring like the first screen..
    and also some sounds is playing when something happens or for example if the bullet hits the target collsion..sound play..
    i tried to have solution like on the first screen if for example it is muted.. ill set it to trueStop.. then on the next frames.. i would put:
    if(trueStop == true){
         SoundMixer.stopAll();
    that way the frame sounds stopped and working.. but the sounds attach to the function when like i said if a collision happens,, the sound is still playing.. arrgghh i cant explain clearly.. i hope you understand my problem..
    any ideas?

    if you need to stop individual sounds, assign a soundchannel to the instance returned by your play method and apply a stop method to that soundchannel.
    for example:
    var s1:Sound=new S1();
    var sc1:SoundChannel=s1.play();
    // now at any time you can use:
    sc1.stop();  // to stop s1 only.

  • Need to get rid of persistent images created with as3 - pls help

    I have used the following as3 code, courtesy of Jody Hall at theflashconnection.com .  It's a drag and drop that works great. Problem is the drag and drop images persist when I move on to other frames. How do I clear the images when finished so they don't appear in subsequent frames? Thank you in advance.
    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    var sndExplode:explode_sound;
    var sndExplodeChannel:SoundChannel;
    var dragArray:Array = [host1, agent1, physical1, social1, host2, agent2, physical2, social2, host3, agent3, physical3, social3];
    var matchArray:Array = [targethost1, targetagent1, targetphysical1, targetsocial1, targethost2, targetagent2, targetphysical2, targetsocial2, targethost3, targetagent3, targetphysical3, targetsocial3];
    var currentClip:MovieClip;
    var startX:Number;
    var startY:Number;
    for(var i:int = 0; i < dragArray.length; i++) {
        dragArray[i].buttonMode = true;
        dragArray[i].addEventListener(MouseEvent.MOUSE_DOWN, item_onMouseDown);
        matchArray[i].alpha = 0.2;
    function item_onMouseDown(event:MouseEvent):void {
        currentClip = MovieClip(event.currentTarget);
        startX = currentClip.x;
        startY = currentClip.y;
        addChild(currentClip); //bring to the front
        currentClip.startDrag();
        stage.addEventListener(MouseEvent.MOUSE_UP, stage_onMouseUp);
    function stage_onMouseUp(event:MouseEvent):void {
        stage.removeEventListener(MouseEvent.MOUSE_UP, stage_onMouseUp);
        currentClip.stopDrag();
        var index:int = dragArray.indexOf(currentClip);
        var matchClip:MovieClip = MovieClip(matchArray[index]);
        if(matchClip.hitTestPoint(currentClip.x, currentClip.y, true)) {
            //a match was made! position the clip on the matching clip:
            currentClip.x = matchClip.x;
            currentClip.y = matchClip.y;
            //make it not draggable anymore:
            currentClip.removeEventListener(MouseEvent.MOUSE_DOWN, item_onMouseDown);
            currentClip.buttonMode = false;
            sndExplode=new explode_sound();
            sndExplodeChannel=sndExplode.play();
        } else {
            //match was not made, so send the clip back where it started:
            currentClip.x = startX;
            currentClip.y = startY;
    DRAG AND DROP (I JUST DID THE LAST FOUR FOR THIS EXAMPLE)
    MOVING ON TO NEXT FRAME, YOU STILL SEE THE RECTANGLES.

    Thank you SO muchNed Murphy
    I'm a newbie to AS3 and I was trying to figure it out for past 2 weeks that why did swapChildren or setChildIndex or addChild, all of these made my Target Movieclip remain/duplicate/persist on the stage even after the layer containing the Target Movieclip has blank keyframes. I surfed so many forums and tutorials for the answer but turns out it was my lack of knowledge of basic concepts. I remember checking out this specific forum as well past week but due to it being "Not Answered" I skipped it. This should be marked as a "Correct Answer", The Empty MovieClip did the trick!
    I needed this solution for a Drag and Drop game, so that the current item that is being dragged is above all other graphic layers. And when all items are dropped on their correct targets, there is gotoAndPlay to Success frame label.
    I created a movieclip on the top layer with the same dimensions as the stage and put it at x=0 y=0 position. Instance name: emptymc
    And deleted the emptymc from the timeline during the Success frame label.
    Here is some code I used,
    1. MovieClip.prototype.bringToFront = function():void {
       emptymc.addChild(this);
    2.  function startDragging(event:MouseEvent):void {
      event.currentTarget.startDrag();
      event.currentTarget.bringToFront();
    I didn't know how to put the addChild and refer to the currentTarget in the startDragging function itself, for example
    emptymc.addChild(event.currentTarget);
    - This one didn't work inside the startDragging function "emptymc.addChild(this); "
    Is there a correct way I could have done it properly?
    Thanks,
    Dipak.

  • I get the picture BUT NO SOUND - HELP!!!

    Hello all,
    I need help just bought apple tv and connected to my flatscreen samsung 1080p to the tv hdmi4 and i get picture but NO SOUND!! Am I missing a cable?? Do I need something else?? What do i do ???

    I'm not familiar with your Denon specifically, but my Onkyo A/V amp has a settings menu for each input. Check the settings for the HDMI input you have the ATV connected to and make sure they are correct for your TV.
    Also, as I mentioned previously, you could connect your ATV back to your TV directly with the HDMI cable, then connect the optical audio output on the ATV to an optical audio input on your Denon, then make sure it is selected when you watch the ATV to get digital sound.

  • AS3 Sound Problem...

    It's pretty simple really. I'm loading an swf into another.
    The child swf is playing audio. But when I remove it ( using
    removeChildAt( 0 ) ) , the sound keeps playing. I can't get it to
    stop. Everything else is gone. Just not the music.
    I'm sure it's something easy. It always is.
    Thank you in advance for any help.

    Are you coding your sound utility in a separate package/class
    or is it inside your fla? Either way, sound like you just need to
    terminate the sound prior to removing the DisplayObject containing
    the sound. I believe the sound class has it's own set of rules that
    don't follow those that the rest of the display object classes do.
    You'll need to look at the help for more information but I've
    always killed all my sounds before killing the parent clip.

  • Macbook to 42" Olevia Sound Help Please..

    I just bought my olevia and hooked it up with my macbook
    by mini dvi to dvi to hdmi and it looks amazing!
    But how do I get sound to come from the tv? Like the clicking
    and music from itunes to come out of the tv speakers so i can watch movies?
    Any help is appreciated!
    Thanks.

    You'll have to run a separate audio cable from the Mac to the TV. DVI doesn't carry audio. Or you can connect a set of powered speakers to your Mac.

  • Surround Sound Help

    Hello all!
    Always fancied doing some surround sound editing - and now I can in FCP X - but how?
    What do I need to edit Surround sound in Final Cut Pro X on my Mac Mini? I want to mix the surround sound 'on the fly' so that I can hear how it will sound - and play with the postioning of sound / music etc. Any help on this matter would be much appreciated. Thanks in advance!

    My iMac is on the way so I've been also thinking about getting a good surround sound system to accompany this beautiful computer. Since I don't have an A/V receiver I'd need a system with optical in and decoding capabilities for DD and DTS. I've had my eye for a while now on Logitech Z-5500 Digital, but they're quite old. Also, I'm aware of the stereo sound when connected with digital cable from non-multichannel sources like MP3's, but if there's a feature like Dolby Pro Logic or DTS Neo:6 on a speaker system, will there be sound rear speakers too?
    Any suggestions? Thanks.

  • Movies stop then spped up to catch up with sound help me

    movie picture keep stoping then speeds up to catch up with the sound while im watching movies on itunes. help!!!!

    Hey davey145,
    Depending on what version of Windows you're using, you'll want to follow the troubleshooting help in one of the following articles:
    Troubleshooting iTunes for Windows Vista or Windows 7 video playback performance issues
    http://support.apple.com/kb/TS1718
    iTunes for Windows XP: Troubleshooting video playback
    http://support.apple.com/kb/TS1386
    Have a great day,
    Delgadoh

  • IMac + Sound = Help Me!

    So I got a new 24" Aluminum High-End iMac 2 weeks ago. It doesn't freeze like other people have reported, but I have some another problems.
    Sometimes when playing songs (mainly in iTunes) the music will be automatically paused for no reason. If I hit play/pause it continues where it left of... This I think is just a bug in iTunes + Leopard, but I would like to know if you guys think it's anything else.
    My second problem is also sound related. When playing Civilization 4: Warlords I have been starting to hear a buzz coming from my left speaker (and only my left speaker). When I increase the volume, the buzz grows larger, when I mute the volume, the buzz also stops. The buzz goes away if I quit the game... it also goes away by it self after a few minutes. Is this a hardware problem or a software problem?
    I should also state that I didn't have this buzzing problem until I used DivX Player to open a file and a LOUD buzzing sound came out of my speaker (both of them) when I tried to play the file Volume control's didn't help to lower the volume of the buzzing, although pausing did stop it. I have used DivX before (both on this iMac and others) but I have never gotten this problem. I have stopped using DivX Player for now, but this problem does exist. I would have to say that this is most probably a software problem because VLC can play all the files with not one hitch yet. But could this loud buzzing sound (that happened a with a few files in DivX) have damaged my speaker(s)?
    Thanks for your help in advance!

    I have a similar problem with DivX. I am convinced it is a software conflict.
    I tested DivX files that I compressed myself (with a licensed version of the DivX Pro codec) on multiple machines. I played the files with VLC and DivX Player without any trouble. However, on my machine there is a horrible buzzing sound when I playback with the DivX Player. VLC is fine. I have reinstalled the entire DivX Pro package to no avail. So far this hasn't infected anything else.
    [EDIT]
    In addition, the DivX Web Player is unaffected. I can play streaming videos from stage6 without any trouble at all.
    Message was edited by: stkelly

  • Connecting IPOD video to surround sound HELP PLEASE!

    Hi!
    I have been trying to connect my ipod to my surrond sound system at home, but everytime I plug it in all it says is "Do not disconnect" and won't let me go to my menu to play songs. Any suggestions?
    Thanks!

    I tried that but it didn't work... I need to get my ipod to not say "do not disconnect" in order to play from the menu.... does that make sense? It's plugged in correctly and is a brand new ipod so I'm not sure why it isn't working. I called apple, but since my surround sound is an RCA and not an apple device they can't help me....

  • Recording Sound HELP!!!

    I got Creative MediaSource, Sound Blaster Audigy Advanced MB, and Voice Center. How can I record a song that from the web? Please help me step by step. Thanks!!
    by the way I have a 2006 Dell, and I don't see "What U hear"
    This product is disappointing me...
    SOMEONE HELP ME!!!

    That sites got all demo versions...Even if I tried to download the full version from somewwhere.. I will still not know how to use it.... HELP~~~

Maybe you are looking for

  • Is GarageBand iOS 2.0.1 compatible with Logic Pro 9.1.8?

    I run Logic Pro 9.1.8 on a Mac Pro 1,1 (Snow Leopard 10.6.8) and GarageBand 2.0.1/ iOS (7) on the iPad2. The songs are built on the iPad, then opened in Logic on the Mac. This worked like a charm until recently when the iPad was updated w/ the new GB

  • DVD Problems/Possible Exchange?

    My DVD player in my new iMac G5 wasn't reading my DVD's a couple of nights ago, and it had been working before. I was just wondering if, once I looked into it more, I found out it was broken, could I get it exchanged? I would think I could b/c I have

  • Invoice report currency wise

    Hi, I need a report that shows who and what we have invoiced in euros and who and what we have invoiced in gbp.....  i.e. a list of euros receivables and a list of gbp receivables. Is there a report already on sap that provides this information? Than

  • How to analyze result of SXMI_XMB_SYSLOG_READ?

    Hello Experts, I'm trying to write a parser to retrieve system log contents of SAP system using SXMI_XMB_SYSLOG_READ for system monitoring purpose.  I wrote a parser analyzing couple of the actual result, but I could not find any specification docume

  • HT4623 how do i sync my contacts in iPhone4S into gmail contacts?

    How do I sync my contact in iPhone4S into gmail contacts?