How to detect the end of a movie clip:  what eventListener to use?

I'm doing a rather fancy button with up,down,rollover,rollout,and static states, something the standard flash button structure isn't capable of as far as I can tell, and believe me, I've tried it.
Here's the setup:  My main timeline has a series of frames with stop(): scripts, and each frame has a movie clip representing what should happen during that state:  still, rollover, rollout, mousedown, mouseup
I can't get the mouseup event  to work.
Here's what I've tried so far that doesn't work:
1. in the imbedded movieclip, no script at the end.  Result: This just loops the embedded clip.
2. in the imbedded movieciip, put gotoAndPlay("NextFrame"), where "NextFrame" is the label in the root movie where I want to go. result: loops clip
3. in the imbedded movieciip, put root.gotoAndPlay("NextFrame"), where "NextFrame" is the label in the root movie where I want to go. result: error
I think what I need to do is write an eventListener for the root actionscript, but I don't know what event to listen for. 
What event is thrown when a movieclip finishes playing?
:<)McFrisco

You have to create your own mechanism(s) for detecting the end of a movieclip being reached.  You can either build code into the end of the clip itself, possibly dispatching an event that is being listened for by a containing timeline, or you could continuously monitor the currentFrame of the clip to see if it equals the totalFrames value.

Similar Messages

  • Detecting the end of a movie clip

    Hi,
    Objective: Display a book that the user can turn the pages to
    view more text. I used a tutorial from the web to create the
    turning page.
    Process: On layer 1, frame 1 of the main time line, I put an
    image of a book. On layer 2, frame 1 and also frame 2 of the main
    time line, I put text for the book. I then created a movie clip
    (MC) called PageTurnMC that looks like a page in the book is being
    turned. On layer 3 of the main time line, I put an instance of the
    MC and called it PageTurn. On layer 4 of the main time line, I put
    a button to play the MC and advance to frame 2 called drawer1cont
    (see code).
    //code on the button used to turn the book's page
    on (release) {
    PageTurn.play(); //plays my PageTurnMC
    gotoAndStop("drawer1cont"); //advance to the next frame of
    text
    Problem: I need to detect when the end of the MC before I
    advance to the next frame. I have to use the PageTurnMC many times,
    so it is not possible for me to put the action in the last frame of
    MC. As of right now, my frame 2 text appears as the PageTurnMC
    plays which is not what I want.
    Thanks for any help.

    I just tested it and got my quick example to work. Here are a
    couple of possible areas to double check:
    In the last frame of PageTurnMC, gotoAndStop must reference
    the main movie clip, e.g. _root.gotoAndStop().
    Also, make sure the parameter _root.frameID isn't in quotes
    because it is a variable, not the actual string.
    As I said, I'm not a Flash expert nor do I know the setup of
    your movie, but this should work as long as you have all of your
    references correct. If you can't get it to work, try to trace
    necessary variables to make sure you are accessing the appropriate
    variable.
    The suggestion by nilu_only will also work, but it will waste
    some cycles because you will have to wait for the movie clip to
    end. Here is what I mean:
    Immediately after playing PageTurn, accessing
    PageTurn._currentFrame will return the currentFrame only once. So
    if PageTurn isn't on its lastFrame, your condition statement
    (PageTurn_currentframe == PageTurn._totalframe) will fail and
    gotoAndStop will never be called.
    Instead, you would need to wait for some time and continually
    check the _currentFrame until the condition statement is true, e.g:
    on (release) {
    PageTurn.play();
    while (PageTurn_currentframe != PageTurn._totalframe) {}
    //wait until reaches the last frame
    gotoAndStop ("drawer1cont")
    This approach is likely to be suboptimal since you are
    wasting cycles checking the current frame instead of just having
    the movie let you know when it has reached the last frame.
    Depending on how Flash handles that while statement, you could have
    serious slowdown from that while statement. And since Flash doesn't
    have a sleep() function, you would have to do some sort of
    setTimeout() to slow down those checks. Either way, I would venture
    to say this approach is better off avoided.

  • How to detect the end of a loaded swf file

    Hello Guys
    This is my first time on this forum, come here with a great
    hope
    I have loaded a picture file (jpeg) and a video file (swf)
    into the main flash file using xml
    on frame 3, I load the picture and on frame 7, I load the
    video, there is a stop action on frame 6
    Now when the flash is executed the picture is displayed ( it
    says "Click here to view the video")
    when the user click the picture , the video is loaded and
    starts to play ---- so far everything is working fine
    now what I want to do is, once the video finishes playing (
    not stoped) I want to display the picture again
    can you tell me how to detect the end of an external loaded
    swf files,
    Please help me
    Thanking You
    Shriram

  • How to detect the end of an external swf loaded into a container

    Hi,
    I'm having trouble finding a solution for this problem, can somebody help me?
    I have a main swf that will load external swfs into a container. I need to detect the end of the loaded external swf in order to start to load and play a new one into the same container.
    The problem is that i do not know what the length of the external swfs will be, and will have no control over the development of them, so i cannot place a variable at the end of their animation which would allow me to detect from the main movie its end.
    I also cannot rely on the _totalFrames property because the loaded swf might not have all the animation inside its main timeline.
    Is there any way to achieve this goal?
    Thx

    Ok... Its as i thought... unfortunatly...
    Gonna mark your latest post again as possible solution, just in case someone comes with any sort of out of the box thing...
    Thx for your help Kglad

  • How do I mute the sound on a movie clip that I'm using in iphoto slide show?

    I cant get rid of the sound on a movie clip I'm using in an iphoto slide show. I want to mute it as I'm using music on the slideshow. Thanks!

    Did your Mac come with iMovie preinstalled?
    Then you could export your video, import it to iMovie and remove the audio track. iMovie has two methods to silence a video clip - you can either select the clip in the project and use the command "Detach audio" or chance the audio settings of the clip and set the volume to zero. Then render the video new and import the silent version to iPhoto to use in the slideshow.
    Regards
    Léonie

  • Help, How to detect the end of sentence in a plain text

    Hi, Everyboday
    I really don't know how to use ArrayList and endsWith to realize detecting the following question. Could you give me some help? Thank you!
    1. find the end of the sentence. that means that we print it out if you meet "!" or "." .....
    2. calculating the frequency of the key word in the whole text. maybe using IDF..
    import java.io.*;
    class SearchEnd{
         public static void main (String[] args){
              try{
                   File myFile = new File("Test.txt");
                   FileReader fileReader = new FileReader(myFile);
                   BufferedReader reader = new BufferedReader(fileReader);
                   String line = null;
                   while ((line = reader.readLine()) != null){
                        System.out.println(line);
                   reader.close();
                   }catch (FileNotFoundException exception){
                   System.err.println("File not found");
                   }catch(IOException exception){
                   System.err.println("IO Error");
    }

    Checkout this thread about how to use these forums effectively. Particularly with College home type questions, expected to be taught how to find the answer rather than be given it outright.
    http://forum.java.sun.com/thread.jsp?forum=54&thread=190747
    -- Question ---
    There are lots of ways to do this, check out the API documentation http://java.sun.com/j2se/1.4.2/docs/api/
    Your sample shows you can iterate the string so checkout these three classes.
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/StringBuffer.html
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/StringTokenizer.html

  • AE How to Change the color of a movie clip?

    I have a movie clip of a White Show Avalanche. How can I change the color from White to another earthly color. I would like to post 2 images, one still of the white avalanche and one still image of the color or look I am after. Can you post or attach images to this thread? If so how?
    I am not just trying to change the Hue/Saturation.

    To elaborate on Ko's post: In RGB space, White is presented by full values of 1 (or 255, if you like that better) for Red, Green and Blue. Since there's no differential between the individual components, there's nothing to shift the Hue. Hence you will have to find alternate ways of recoloring your stuff.
    A simplistic way would e.g. be using effects such as Tint, Tritone or Colorama based on the Luminance. A more elaborate way would be cutting up the whole thing in multiple pieces (debris, shadows, waves, edges) and color correct each part individually. In any case you will very likely have to work with multiple instances of your layer and apply some masking here and there.
    Mylenium

  • How to detect  the Collission for duplicated movieclps

    Hey guys .. i am back with set of query..till now .. key
    press movement a rocket (mc) is moving left right up down in a
    defined stage area. and i am able to generate some fire balls
    randomize falling from top. this is just i am duplicating the movie
    clip(fireball_mc) .... now i want incase or when the rocket (mc)
    touch the fire ball programm shold detect the collsion and generate
    a score board. well for this i have tried a script for two movie
    clips ... wchich is working but ..i don know or i m not gettng the
    logic how to detect the collission for duplicated movie clips...
    well i m just giving the script for oinly 2 movie clips
    coliding...can any one tell me how to do it with randmize or
    duplkicated mcs??
    for 2 movie clip ...
    _root.mc1.onEnterFrame = function() {
    if(this.hitTest(_root.egg)) {
    _root.result="Oh no..... we are dead";
    } else {
    _root.result="we are going fine";
    (this is happening ..but let me know how can i get the same
    result for ranndom mcs)
    hope someone can help me out ...
    i appriciate ur valuable time to read this..
    thanking you

    Hey thx for ur suggestion...but as i said m very much new to
    actionscript (more designer) so i don have much idea... most of the
    things i m doing for this game i m going through lots of references
    then i tried to understand te codes m implmenting them to my
    need..can u explain me little more about arrays u haves asked for
    loops u asked me to use the hittest function..please /.. i will be
    greatfull to u... thx

  • In iMovie '11 how do I slow down my credits at the end of my movie.  I typed them in, but the speed is too fast.

    I have iMovie '11, and I can't find how to slow down the "credits" I've typed in at the end of my movie.  I guess
    it would be the scrolling speed.

    Credits scroll at the speed that is necessary for the scrolling to complete by the end of the clip.  So, to slow them down, simply prolong the duration of the scrolling credits title clip by selecting and draggging out the yellow boundary.
    Geoff.

  • Is there a way to detect the end of a video?

    Is there a way to detect the end of a video.. .mp4 or youtube? I want to be able to detect the end of a video and then have it do something...ie play on timeline or go to and play symbol.

    For youtube the code would be something like this:
    view-source:calkaweb.herobo.com/video.html
    for HTML5 videos for youtube replace &version=3 with &html5=1 in the youtube URL
    I have no idea how to impletent the youtube code into Edge tho other than an iframe but that wouldn't work I've tried :
    http://forums.adobe.com/thread/1285212
    You would need to place all of the youtube codes into edge in order for it to work but I duno how to do that and no1 answered the question in the thread I made about it.
    as for MP4/HTML5 video you can use
    var video = document.getElementsByTagName('video')[0];
        video.onended = function(e) {
          /*Do Something*/

  • Detecting the end of an flv in ac 2

    I have a custom player i built. How do i detect the end of
    the flv so i can prompt an action, like go to another frame for
    instance or loop or call another flv. Have been struggling to find
    a solution online and keep hitting dead ends..
    Thanks in advance if someone can help... need this in
    actionscript 2

    unsure...
    I was just using keyframes on a timeline to play different
    flvplayers, brought in through import. I have used netstream
    successfully but i lose the player controls...

  • Adding a simple audio fade at the end of a movie - help

    Hi gentlemen,
    How do you add a simple fade out to the audio track at the end of a movie ?
    I tried adding a keyframe about 5 seconds before the end of my movie, but can't figure out how to do it. Not sure how to do this :-(
    I need some help. ( I read the manual and I don't get it )
    Thanks,
    Dave.

    Dave,
    In Effects>Audio Transitions>Crossfades, you should have 2 Trransitions. Choose Constant Power, and drag it to the end of your Audio Clip. Depending on your settings in Edit>Preferences, you may need to drag the beginning of the Constant Power Crossfade to the left, to get the 5 sec., that you want.
    Other method would be to highlight the Clip, and in the Effects Control panel, choose Volume. Go to 5 sec., before the end, and click the "stopwatch" to add a start Keyframes and add a Keyframe. Go to the end of the Clip and click the "add Keyframe" button. With the CTI still over that Keyframe on the end of the clip, drag the Volume slider to -00.0db.
    Hunt

  • How to get the end time of an Interface?

    How to get the end time of an Interface?

    Hi,
    As per your reuirement. I will suggest to use IKM SQL to SQL append. and Before Insert statement in IKM u need to add one more step i.e update. Your update should be like this
    command on sourse.
    <%for (int i=0; i < odiRef.getDataSetCount(); i++){%>
    <%=odiRef.getDataSet(i, "Operator")%>
    select      <%=odiRef.getPop("DISTINCT_ROWS")%>
         <%=odiRef.getColList(i,"", "[EXPRESSION]\t[ALIAS_SEP] [CX_COL_NAME]", ",\n\t", "", "((INS and !TRG) and REW)")%>
    from     <%=odiRef.getFrom(i)%>
    where     <% if (odiRef.getDataSet(i, "HAS_JRN").equals("1")) { %>
         JRN_FLAG <> 'D'
         <%} else {%>
         (1=1)     
         <% } %>
    <%=odiRef.getJoin(i)%>
    <%=odiRef.getFilter(i)%>
    <%=odiRef.getJrnFilter(i)%>
    <%=odiRef.getGrpBy(i)%>
    <%=odiRef.getHaving(i)%>
    <%}%>
    Command on target..
    UPDATE <%=odiRef.getTable("L", "TARG_NAME", "A")%> T
    set <%=odiRef.getColList("", "T.[COL_NAME]", ",\n\t", "", "(UD2)")%> ='N',
    <%=odiRef.getColList("", "T.[COL_NAME]", ",\n\t", "", "(UD1)")%> =SYSDATE
    where (<%=odiRef.getColList("","T.[COL_NAME]", ", ", "", "UK")%>)
    in(<%=snpRef.getColList("", ":[CX_COL_NAME]", ", ", "", "UK")%>) and <%=odiRef.getColList("", "T.[COL_NAME]", ",\n\t", "", "(UD2)")%> <> 'N'
    check UD1 and UD2 columns.
    Hope this will help you.
    Regards
    Saurabh

  • Help!! working on a movie on Imovie. I had to delete a music file from a clip section and now there are some clips that have no audio!!! don't know how to get the audio back to my clips!!!! Help!!!

    Help!! working on a movie on Imovie. I had to delete a music file from a clip section and now there are some clips that have no audio!!! don't know how to get the audio back to my clips!!!! Help!!!

    You can use some third party software to copy the music from your old iPod back to computer first, and then import the music into iTunes and re-sync them to yournew iPod. Here is a guide about how to transfer iPod music to computer. Hope it helps. Feel free to email me if you need further help.

  • How to detect the Acrobat Browser Plug-in version installed on a users system for non-IE browsers?

    How to detect the *Acrobat Browser Plug-in version* installed on a users system, on Firefox, Safari, Opera, etc?
    Or one script for detecting Plug-in version for major browsers. Need full example code.

    Wrote an article on this with code samples (Javascript + HTML) - basically there are differences between IE and other browsers. Chrome natively comes with the Chrome PDF Viewer so I've incorporated that in my detection script.
    The script detects the browser type, and the installed acrobat version...
    Have a look here:
    Detect the Adobe Reader Plugin

Maybe you are looking for

  • Consuming webservice in a webdynpro component

    Hi Experts, I have a third party free webservice as WSDL link.My requirement is to make use of that webservice in my webdynpro component. Can any body give me a step by step approach to consume that webservice in my webdynpro Component. If possible,

  • Input dv / output dv

    I want to join many dv movie files i have captured from Premiere, to make them all one dv file. How can this be done and is it lossless?

  • Exclusion - For all customers, except one

    Is there a simple way to create exclusion for ALL customers, except XXXXX? There are approx 20,000 customers, across multiple Sales Orgs. Would like to exclude 100+ products from 19,999 customers Is there are way to set up products for only one custo

  • ABAP: FN MODULE "SAVE_TEXT"

    HAI FRIENDS,     I AM USING ON FUNCTION MODULE I.E "READ_TEXT".     HERE I GET THE IN TWO TYPES I.E          1) TO GET A MATERIAL WITH TEXT.          2) TO GET A MATERIAL WITHOUT TEXT. NOW I WANT TO ADD SOME TEXT FOR WITHOUT TEXT MATERIAL       HERE

  • Hash value in my DME file...

    Hi all, I am not sure if this issue I am suppose to issue an OSS to SAP or there is an existing OSS notes... Recently, we had an upgrade from 4.6c to ECC6, and of course unicode conversion were carried off. After the upgrade, my DME (RFFOM100 program