How to play a soud at specific frame?

I have the loading audio file at frame one. However, I want to play the audio only at specific frame or frame lable. How do I do that? Below are my codes:
//start of sound section is for sound
var soundReq:URLRequest = new URLRequest("FlashFiles/audioFiles/mySoundmp3");
var sound:Sound = new Sound();
sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, onComplete);
//end of sound section
function onComplete(event:Event):void
    sound.play();
The above plays the sound as soon as the .swf file is loaded. But I want to play at certain point in time, say frame number or frame lable.

Okay, here are my code in frame one:
//start of sound section is for sound
var soundReq:URLRequest = new URLRequest("FlashFiles/audioFiles/Alma Mater plus roc.mp3");
var sound:Sound = new Sound();
sound.load(soundReq);
//sound.addEventListener(Event.COMPLETE, onComplete);
//end of sound section
this.addEventListener(Event.ENTER_FRAME, playSound);
function playSound(e:Event)
    if(e.currentLabel == "lblStartSound")
            this.removeEventListener(Event.ENTER_FRAME, playSound);
            sound.play();
this.btn_Skip.addEventListener(MouseEvent.MOUSE_DOWN, skipFlash);
function skipFlash(event:MouseEvent):void
    gotoAndPlay("frm_Ending");
    sound.stop();
Errors I got are:
1119: Access of possibly undefined property currentLabel through a reference with static type flash.events:Event.
Source: if(e.currentLabel = "lblStartSound")
1061: Call to a possibly undefined method stop through a reference with static type flash.media:Sound.
Source: sound.stop();
Eventually, if the user click the skip button, I want to stop the sound.

Similar Messages

  • Using Flach CS4 and action script 2.0 how do I advance to a specific frame of the main timeline when a movie clip instance come to the end of its timeline?

    Using Flach CS4 and action script 2.0 how do I advance to a specific frame of the main timeline when a movie clip instance come to the end of its timeline?

    code on the last frame of your movieclip instance:
    _root.gotoAndStop('whatever_frame');  // will work unless this swf is loaded into another swf.  in that situation, you should use a relative path to the main timeline (eg,  _parent or _parent._parent etc).

  • How do I link to a specific frame in the timeline of an Edge document from a different page?

    lI have the intro of my new website made in Adobe Edge Animate, however I don't want people to watch the intro every time they click "back". So is there a way of linking directly to a label from another page? Should I use something like:
    "<a href="page_URL.com/edge_file.html" target="label_in_the_timeline">"

    Hey Squeege,
    I highly recommend you becoming familiar with basic javascript syntax (setting variables, functions, scope, if/else statements). Knowing at least the basics really makes Edge Animate come alive, and gives you a lot more power inside the application.
    Taking the code from the other thread, you would do something like this, on Stage.compositionReady event:
    // function to grab specified param
    sym.getParam = function(name) {
        name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
        var regexS = "[\\?&]" + name + "=([^&#]*)";
        var regex = new RegExp(regexS);
        var results = regex.exec(window.location.href);
        if (results == null)
            return "";
        else
            return results[1];
    // get query param called 'param', (should be "true", "false", or leave it out)
    var playIntro = sym.getParam('param');
    if( playIntro == "true" ) {
         // tell sym to play intro label
         sym.play( "intro" );
    }else if( playIntro == "" ) {
         // tell sym to play intro label
         sym.play( "intro" );
    }else if( playIntro == "false" ) {
         // tell sym to play skipIntro label
         sym.play( "skipIntro" );

  • If I have a list of Vimeo videos on a webpage, how can I use just one video frame and have all videos play in that one frame?

    I am creating a page with a list of Vimeo video links. I want to have only one video frame on the page. So no matter which video link a user clicks on, the chosen video needs to play in that one video frame on the page. How do I do this in Muse?
    Thanks.

    You can use composition widget for this. Insert the video details in trigger container and then insert that corresponding vimeo video widget in that specific target container. So It would work like, users will click on different video buttons but the actual video will play on same frame which is actually a target container of composition.
    The ID that we use for vimeo widget cannot be used for different videos on same time , because every video shares its own ID and url. But you can surely try the above.
    Thanks,
    Sanjit

  • How to create specific Frames

    Hi,
    Using Style and Create Frame I know but some specific frame How to create any one have Idea Please Share.
    Please find the Attached file have Some specific Frame types.
    Thanks
    Dhiraj

    You want to know how to make those specific frames by hand?
    You can find lots with just straight filmstrip tutorials and even some film strip templates...probably images of real ones for that matter... that can be used if you do a Google search. Same goes for the other frames.
    The tutorial I have linked below is using Photoshop. With the exception of doing the transform<warp step, everything can be done using elements. There are other tutorials that build a more detailed filmstrip but  I like this one because it shows how to make a wavy filmstrip.
    http://www.youtube.com/watch?v=ZhLbGleU-iY&feature=related
    Since transform warp isn't available in Photoshop Elements, you'll have to use the displacement filter (filter<distort<displace)  to make the filmstrip wave if desired.
    Above is the displacement map, I made to make my film strip wave. This was made by filling a layer with black and painting a couple of white lines with using the brush tool with a soft wide tip. I duplicated this layer and saved it as a PSD on my desktop.  Displacement maps must be in PSD format. I used this map along with these settings: 0 hoizontal; 50 vertical; stretch to fit; repeat. Note: You must have soft edges to get a wave effect with this filter. If you use hard edges this filter will cut instead of bend.
    Filmstrip images are some CG art I created.
    Frame made using the tutorial.
    Warped with displacement filter using the displacement map of two blurred lines.
    Added a perspective by using free transform as in the video along with a hand made drop shadow to ground the filmstrip. Background was also cropped.
    Final step was to simplify (rasterize) the gradient fill layer that I used over my background layer. I  added a little noise with Add<Noise to my simpified (rasterized) gradient fill layer to get rid of the gradient banding.
    Playing with a different perspective angle because it's kind of fun. Some of the shadow is lightly masked to make it fade a bit where the strip rises.

  • Play specific frame in relation to X and Y

    Hello i'm relatively new to Flash and although getting quite
    familiar with the environment i'm still pretty much a big ignoramus
    when it comes to actionscript. Appologies if sililar to this has
    been posted before, I did a search (and have been searching the net
    all day!)
    I have a stop frame animated head with most of frames done in
    various movements (at the moment they're JPGs, but if I can get
    this to work I'll convert to vector). I thought it'd be cool when
    the user is mousing around the top and right side of the head for
    the head to move in the cursors direction and look at it. Once the
    cursor is on top of the head it plays in reverse, back to the
    start. So I have the frames for this movement now (42 in various
    positions) and the closest i've come to achieving what I need is
    from using this:
    Actionscript:
    onClipEvent(load){
    xlow = 300
    xhigh = 450
    onClipEvent(enterFrame){
    gotoAndStop(Math.ceil((Math.min(Math.max(_root._xmouse,xlow),xhigh-1)-xlow+1)/(xhigh-xlow) *10))
    This works ok for just looking right (frames 1-10), but I've
    been useless at adapting this so far, and am not even sure if this
    it is what I need for the whole thing. I can't work out how to make
    it work on the y axis simultaneously.
    So all in all I need to tell flash to play a specific frame
    depening on the X and Y of the cursor and when the user mouses over
    the face the movie must play from wherever it was stopped.
    An added bonus would be something like a variation in
    animation speed - speedy at first and slowing as it reaches the
    target. However I'd be much more than happy to just get the basics
    down at the moment though.
    If none of this makes any sense I can supply the source file,
    but until I covert all the graphics to vector the file is big (8
    Mb).
    If anyone can give me any help or a nod in the right
    direction I'd be your new best friend,
    John

    This is made clear when you have Context Help turned on. You should always have this on.

  • How link from html page to a specific frame in flash cs5 as3

    Hi!
    I'm kinda new around here. I am interested in knowing how to link from a specific html page to a specific frame in flash cs5 as3.
    I have a website that I originally began to design in flash but later started developing new pages for it in html. The flash part of it has several pages on different frames and I have created links from the flash part to the other html pages, but, I can only link the html pages back to the main flash home page, and not the other pages in the flash part of the website.
    I have read that in cs3 it was possible using the flashvars skip variable, but I don't know how to do it. I have not yet seen any working examples and I could not find any instructions / tutorials online for cs5.
    Can someone help here?

    add a query string, to the swf's embedding html, with variable/value indicating the frame you want to display in your swf.  add a javascript function to return the query string (or entire url), call the javascript function from flash using the externalinterface class.  and finally add code to your swf to parse the returned url or query string, parse it and then direct your timeline to the appropriate frame.

  • Using Actionscript 3, how do I code a button in a parent file to load at a specific frame in another swf file?

    Using Actionscript 3, how do I code a button in a parent file to load another swf file at a specific frame?

    You can either place the loading code in the desired frame of the parent file, or continuously monitor the currentFrame proiperty of the parent file and do the loading when the value matches the desired frame number.

  • How can I play music through safari specifically youtube on my Mac book pro over soundlink to my bose wireless speaker I can only play audio from itunes at present? HELP PLEASE!

    How can I play music through safari specifically youtube on my Mac book pro over soundlink to my bose wireless speaker I can only play audio from itunes at present? HELP PLEASE!

    Should be able to go into your sound preferences and choose your output device, you can also try downloading Airfoil and try that, it's a pretty cool app.

  • Can you have a button play a specific frame in a different Edge Animate page?

    I'd like to create a movie that can open other HTML files and go to a specific frame within those other pages. Is there any way to handle that inside of Edge Animate?

    Thanks for the suggestion, but I'm looking for something a little different.
    I'm looking to figure out a way to pass along some information from one movie to another.
    For example. If I have a page (Movie1.html) that has Button A, Button B and Button C. Is there a way for me to open a different page (Movie2.html) AND point to a different frame based on what they clicked in Movie1.html?
    So if they click Button A, it will open Movie2.html and go to frame label "IntroSection"
    But if they click Button B, it will still open up Movie2.html, but this time it would jump to the label "AboutUs"
    And if they click Button C, it will open up Movie2.html, it would jump to the label "End"
    The idea is to have a few different files, but be able to point to specific frames or labels within an external movie.
    Thanks!
    Jeff

  • Jumping to a specific frame in another movie

    I'm wondering how to jump to a specific frame in an external
    movie. I'm not using the loadmovie command so I don't think the
    _level command will work. I just have two swf movies playing on the
    same page. I need to have a button in Movie A when released will go
    to a certain frame in Movie B. Thanks!

    well this certainly should work if the code is on the main
    timeline, and there is nothing else. However when you say
    'scrubber' do you mean that your 'testing' the movie by pressing
    'enter' while in the IDE, so that you're actually 'seeing' the
    playhead move? If this is the case, yes, no actions will execute.
    To test the swf file, use Ctrl+Enter (or Command+Enter on Mac) to
    run an actual 'test'

  • Opening new page to a Specific frame

    I am still learning Action Script but I have a problem with
    writing the full script for combing navigate to new URL and
    gotoAndPlay. More specifically what I want to do is use a button
    which when clicked will open a new page and then start playing my
    Flash movie at a certain frame on the Timeline. I have used buttons
    to navigate to a new URL and used the gotoAndPlay ( ) ; command to
    play a certain frame, both have been successful but when I combine
    the two I run into trouble. What happens is the new page loads
    correctly and goes to the specific frame but then opens the browser
    in a new window with the movie playing from the beginning. The
    correct sequence within the correct Webpage is playing but only if
    I close the current page, in other words what I am trying to
    achieve is running but in the background.
    I have attached some of the code I have tried if that helps.
    Many Thanks.

    How extensive are the corresponding text changes on the HTML
    page? How many HTML pages are there? The reason I am asking is that
    if HTML content is not big - your best bet may be to load all the
    HTML content at once and hide/unhide parts of it based on the
    commands that come from Flash.
    But if you are sticking to your guns:
    Your use case, as you described it, is:
    1. user clicks a button on a column
    2. the column clicked moves across the movie
    3. the movie starts to play a different section
    4. the text on the web page changes to match the new movie
    sequence.
    There is a problem here - No 4 requires browser reloading. I
    believe user experience will not be all that good because of the
    visual break (new html page loading) after all the animation
    sequence after the click occurs. Perhaps a better experience can
    be:
    click --> load appropriate page --> perform animation
    sequence.
    As for the variables that you add to the request,
    conceptually it is not different from appending url variables to
    the url string:
    You can do it this way:
    var url:String =
    "www.domain.com/mypage.html?myVariable1=something&myVariable2=somethingElse";
    Or you can do it this way:
    ar url:String = "www.domain.com/mypage.html";
    var variables:URLVariables = new URLVariables();
    variables.myVariable1 = "something";
    variables.myVariable2 = "somethingElse";
    var request:URLRequest = new URLRequest(url);
    request.data = variables;
    I hope you see the similarity. The result is the same - Flash
    sends request with the variables.
    You may perceive the second way as more cumbersome but there
    are several advantages of doing it this way. One of the most
    important is that Flash automatically makes variables values url
    formatted which is critical when you send strings with special
    characters. In addition, when you send many variables - it is much
    more manageable than keeping track of the variable and making
    assignments in one-line url string.
    How you deal with it further depends on how good you are with
    HTML and JavaScript OR server side processing.
    Say you need to start your Flash movie from a certain frame
    (say No 50). You may want to:
    1. Load HTML page with a url that contains a frame number:
    variables.startframe = 50;
    2. You need to read this variable with JavaScript and write
    an appropriate embed tag. There are several ways to do that. Read
    about FlashVars. It could be (in the embed tag):
    src="myMovie.swf?startframe=50" where 50 comes from browser
    location string.
    3. Inside Flash you will utilize LoaderInfo.parameters method
    to extract the value of the variable startframe.
    4. Write code that will perform and animation based on this
    variable/parameter.
    I guess a question is "How good are you at HTML and
    JavaScript?"

  • How can I capture a single video frame and save as an image in PS CS6 Extended?

    I have checked similar posts on this subject, but I have a problem doing this:
    I "File>Open" a video clip [.m2ts file type] into PS CS6 Extended.
    PS sets the "Pixel Aspect Ratio" for "HDV 1080/DVCPRO HD 720 (1.33)"
    PS then warns of "Pixel Aspect Ratio Correction" for preview purposes only, and that it should be turned off for maximum image quality.
    I advance the "Timeline" to the specific frame I wish to capture.
    I simply "File>SaveAs" for a JPG image - as has been suggested.
    Both the On-screen and saved images are grossly pixelated at 1440 x 1080.
    Furthermore, the saved image is an incorrect aspect ratio - regardless of how I have the "Pixel Aspect Ratio Correction" set.
    It produced a jpg image size of 1440 x 1080 at 635 KB.
    I clearly do not know what I am doing...
    Have I missed a process - either with the file type I open, or once opened in PS CS6 and set to the desired frame?
    Adobe Bridge will display each frame in a high-quality preview - which I could be happy with, but found no capture/save tool there.
    I went back to the software that came with the video camera and saved a frame image from the video clip just fine.
    It produces a jpg image size of 2304 x 1296 at 2.63 MB with the correct aspect ratio.
    After you stop laughing ... can you let me know what I really need to do to get the correct result in PS CS6?

    Place the playhead on the frame you want as a still. Then in share window choose location Save Current Frame. You can then select options such as Jpg, PNG etc.

  • How do I set up a specific playlist for songs so only those sync on A-TV??

    I have a huge number of songs on my Itunes library and I don't want the Apple TV (A-TV) to use so much space for all those songs - I prefer to save it for my video and movies. How can I set up a specific play list on Itunes for A-TV and then when I sync my A-TV - only that playlist goes over.
    Hopefully someone has an idea for me. Hope everyone had a great holiday.
    Skip

    Dear Winston,
    Thanks so much. It seems much easier after reading it. I did not have those tabs originally which was confusing... Once I clicked the correct preferences, the tabs came up. Now I am resyncing everything which will take time but I see it working.
    Thanks for your help Mr. Churchill....
    Skip

  • New update how to play music on apple tv

    I just updated my iPhone 4 and now can't figure out how to play music or videos on my apple tv

    iPhone 4 can AirPlay audio just fine, I'd forgotten that it can't do screen mirroring.  It's been so long since I had my iPhone 4 but I'm certain that some apps will allow video output over AirPlay (which is not the same as screen mirroring).  The stock iOS Photo and Video apps could stream pictures and video to ATV, but true mirroring of everything you see on the screen is not supported on iPhone 4.  It isn't iOS 7 that took away this capability, it is a capability that has always been limited with iPhone 4 (and earlier).
    If you are sure that your old 3G can output video over AirPlay, which specific apps?  Those same apps should work on the iPhone 4, even with iOS 7.

Maybe you are looking for

  • Unable to print in Reader X

    I am unable to print in Reader X, also it happened in Reader 9 - perhaps with the (clean) install of Snow Leopard from Leopard.  I am also using Neo Office (an OpenOffice for Mac).  Neither the Print Icon, nor the Print menu work - it does not bring

  • Inspire T5900 Sound Problems

    Hi I have a problem with my T5900 speaker system, but cannot find any threads that list this product. I have this connected to my PC through a Sound Blaster Xi-F card. We use an ION Profile Pro vinyl record decks to play the records and also to conve

  • External optical drive (HP) not responding to iDVD

    My new (HP) external optical drive does not respond to iDVD. When I go to click burn it is darkened. In my system profiler it has -R and -RW listed, but under burn support it says "Yes (unsupported)". The computer responded when I insterted a blank D

  • Auto CD Player won't read disk I just burned

    I have a G5 iMac, about a month old. If I burn a CD, the CD reads on my PowerBook and wife's G4. However, it won't play in my car. This is puzzling because a friend burned me a disk of tunes, also using iTunes, and that played in my car with no probl

  • Merge two libraries

    Is there a way to merge two libraries ? On my MBPro I have one iTunes library. On my MacPro another. There's some cross over of music, but a lot of difference too between them. Can I merge the two library files (on my external terabyte drive) and imp