How to add button inside move clip and call it from main timeline?

Hi,
On the main timeline I  have a movie clip called clock_mc and playBtn
playBtn is  placed in the center of clock_mc
When you press playBtn clock_mc starts playing
playBtn.addEventListener(MouseEvent.CLICK, playClock);
function playClock(event:MouseEvent):void
    if (event.target == playBtn)
        clock_mc.play();
        playBtn.visible = false;
        trace ("play button was clicked");
This is working fine for me.
But I want to add replayBtn to the last frame of clock_mc and set up the function on main Timeline.
Another words when the clock_mc rich last frame you see replayBtn.
code example:
replayBtn.addEventListener(MouseEvent.CLICK, playClock);
    if (event.target == replayBtn)
        clock_mc.play();
        replayBtn.visible = false;
        trace ("replay button was clicked");
I've tryed to placed the replayBtn on the stage on the main timeline and I've set it up to replayBtn.visible = false;
And then I add replayBtn.visible = true; to last AS frame of clock_mc but it wont work
Even when I put the button physically to the last frame of clock_mc it will not work either.
Please help

I've solved the problem:-)
I've set replayBtn.visible = false; on first frame of clock_mc
and  replayBtn.visible = true; at the last frame
and than as you sugested I'v add:
clock_mc.replayBtn.addEventListener(MouseEvent.CLICK, replayClock);
function replayClock(event:MouseEvent):void
        clock_mc.play();
        trace ("replay button was clicked");
I couldn't see replayBtn at the firs stage because I have clockTween assosiated with clock:
clockTween = new Tween(clock_mc, "x", Regular.easeOut, -469,438, .5, true);
and I had replyBtn in the wrong place so when clock_mc was coming up on the stage replayBtn was on the left side of the stage :/
Now I have to solve only one thing.
Maybe you would have any suggestions please.
I've set up stop(); in a first frame of clock_mc
that when you see clock_mc sliding in it has to wait for playBtn to be clicked
because I have two tween:
        clockTween = new Tween(clock_mc, "x", Regular.easeOut, -469,438, .5, true);
        playTween = new Tween(playBtn, "x", Regular.easeOut, -720,514, .5, true);
        playBtn.visible = true;
so when you click on playBtn:
function playClock(event:MouseEvent):void
    if (event.target == playBtn)
        clock_mc.play();
        playBtn.visible = false;
        trace ("play button was clicked");
everythink is working fine except when I clik on replayBtn it play for I sec because there is stop(); on the first frame of clock_mc

Similar Messages

  • Subject : Slideshow looks bad  Hello guys  I have a project in my Final Cut just about done.  I want to add my slideshow as part of the project and burn it to DVD.  In my slideshow, there are some stills from the movie clips and some downloaded from the i

    Subject : Slideshow looks bad
    Hello guys
    I have a project in my Final Cut just about done.  I want to add my slideshow as part ofthe project and burn it to DVD.  Inmy slideshow, there are some stills from the movie clips and some downloadedfrom the internet but they all look blur when playback and even worse if Iapply Ken Burn to it.   Pleasesome one can tell my how to do it right or it can’t be done because thedownload quality and stills from the clip are not suitable or slideshow.  Thank you
    PSC

    Thank you Ross.
    The entire DVD containing Quick Time movies (Final CutExpress project) and slideshow was done in iPhoto.  The Final Cut project was rendered prior to export to QT,  the slideshow was sent to iDVD withoutrendering. The slideshow with most of the pictures from my still camera incombination with stills from movie clips and some downloaded from the Internet.After burning, the movie playback is perfect but the slideshow is not.  The slideshow containing 3 differentkinds of pictures; those from my still camera looks OK; the stills from themovie clips and from the Internet are not.  I don’t have much knowledge in this game, but I think NTSCwith frame size 720x480, and the downloaded picture Item Property shows most ofthem are between 400 to 500 x 300 to 600, may be both of them are not suitablefor TV screen while the stills from my still camera looks OK because they are2048x1536.  Please enlightenme.  Once again, thank you so much,I really appreciate the time you offered.
    psc

  • Advanced Button with Movie Clip and Fading

    Problem: I'm trying to create a bottun that when you roll
    over it it plays a movie clip and also fades in and out on roll
    out. It is similiar to the three main navigating buttons on the
    following site.
    http://www.fjcruiser.ca/
    the buttons with the compasses that appear are the ones I am
    talking about.
    I already know how to make buttons, I just can't figure out
    the actionscripting to load the movie and also fade in and fade out
    according to roll over and roll out.
    Please help. Thank everyone.

    Amazingly, I actually know exactly how to do this. And it
    only requires about 4 lines of code in the _root layer and on the
    button.
    Instead of having the rollover load an external movie, you
    want the have the rollover execute an on(enterFrame) function that
    tells each newly entered frame of your movie to check to make sure
    the mouse is still on the button, and if not, send the movie
    playhead backwards.
    So, put that sampleMovie right on the stage with the button.
    Then write the code in the _root so that says: as long as the mouse
    is over the button, the movie will advance to nextFrame(). When it
    gets to the next frame, again the code checks to see if the mouse
    is on the button, if so, the movie is instruct to go one more next
    frame (which is tweening the fade, right?) again, over and over
    until the stop() at the last frame. But, if while while entering a
    frame, the code finds that the mouse is no longer over the button,
    it does the same thing but this time instructs prevFrame(), and so
    on, going prevFrame (backwards, in other words) as long as the
    mouse is not on the button.
    The result of the above is a gradual fade in and out,
    depending on whether the mouse is hovering. This, as opposed to an
    abrupt disappearing graphic on(rollOut).
    Click the below link for the .fla that demonstrates this
    technique (which, by the way, I learned from Joshua Davis'
    excellent book, "flash to the core". Check it out at Amazon, or
    wherever. Lots of cool tricks).
    click here for
    fade_Movie example

  • AS3 Putting Buttons Inside Movie Clip

    I am practicing AS3 (after years of AS2) and am having trouble having a button inside a movie clip talk to another movie clip on the main timeline. Here is the code:
    OneButton.addEventListener(MouseEvent.CLICK, OneButtonClicked);
    function OneButtonClicked(event:MouseEvent):void
    MovieTarget.gotoAndStop(1);
    MovieDescription.gotoAndStop("One");
    TwoButton.addEventListener(MouseEvent.CLICK, TwoButtonClicked);
    function TwoButtonClicked(event:MouseEvent):void
    MovieTarget.gotoAndStop(2);
    MovieDescription.gotoAndStop("Two");
    The code above works, but if I put OneButton and TwoButton inside a movie clip, I know longer can target MovieTarget and MovieDescription. The reason I want to put OneButton and TwoButton inside it's own MC is so I can dim each button after it is clicked by toggling the playhead inside that MC. Help? Thanks!

    Start over from the begining
    press  f8 and chose movieClip then draw your untoggled button call the movie button then create another movie and create your toggled button or greyed out button and call it greyedButton.  Go to main stage add 2 button instances and 2 greyedButton instances( just drag from library).  you have 4 instances on stage.  give call instance names and place one them on top of each other so u can only see 2 buttons on stage.  put the greyed button under the button.
    now with action script
    button1.addEventListener(MouseEvent.CLICK, OneButtonClicked);
    function OneButtonClicked(event:MouseEvent):void
    MovieTarget.gotoAndStop(1);
    MovieDescription.gotoAndStop("One");
    button1.visible = false; //  here the greyed button will show
    button2.addEventListener(MouseEvent.CLICK, TwoButtonClicked);
    function TwoButtonClicked(event:MouseEvent):void
    MovieTarget.gotoAndStop(2);
    MovieDescription.gotoAndStop("Two");
    button1.visible = true; // here button1 will go back to its orignal state
    button2.visible = false // here the greyed button will show

  • Buttons inside movie clip dont work

    I have a simple HTML website with 5 buttons one of which, a movie clip, drops down 3 more buttons but the buttons dont always work. I get wierd issues for instance: whether I'm on the mcs page or another page completly the drop down buttons only work when Im on the parent movie clips page. When the buttons do work and you click on the button of the page your on  they only work once then the whole issue repeats itself. Hopefully to clarify here is the code inside of the movie clip that directs the drop down buttons.
    stop();
    var cdButton:URLRequest= new URLRequest("character desin.html");
    cd_btn.addEventListener(MouseEvent.CLICK, cd);
    function cd(event:MouseEvent):void
            navigateToURL(cdButton,"_self");
    var caButton:URLRequest= new URLRequest("concept art.html");
    ca_btn.addEventListener(MouseEvent.CLICK, ca);
    function ca(event:MouseEvent):void
            trace("ca_btn");
            navigateToURL(caButton,"_self");
    var dsButton:URLRequest= new URLRequest("draw sketch.html");
    ds_btn.addEventListener(MouseEvent.CLICK, ds);
    function ds(event:MouseEvent):void
            trace("ds_btn");
            navigateToURL(dsButton,"_self");

    From what I see you are trying to somehow program a Actionscript only iframe navigation. That will never work without an external Interface call to the Browsers Javascript. This is complicated stuff and surely not what you have in mind. If concept art, draw sketch etc. are all separate swf files, you should load them (instead of the html you embedded them in)

  • How to add button to Table View and initiate action?

    hello,
    i'm new to Javafx 2, i recently followed the tutorial on tableview and would like to add a deletion action on particular row. What i had in mind was to add a delete button on the last column of each row, when clicked it will fire a handler and remove that row from the data observablelist. how do i do that?
    please advice,
    wesley

    Hi,
    Please find the below code. I am creating a table view with two columns. The second column consists of delete button.
    TableVeiw table = new TableView();
    /*First column*/
    final TableColumn<String> titleCol = new TableColumn<String>("Title");
    titleCol.setProperty("title");
    /*Second column*/
    TableColumn<String> actionCol = new TableColumn<String>("Action");
    actionCol.setCellFactory(new Callback<TableColumn<String>, TableCell<String>>() {
          @Override
          public TableCell<String> call(TableColumn<String> param) {
                 final TableCell<String> cell = new TableCell<String>() {
                          @Override
                          public void updateItem(String value, boolean empty) {
                                super.updateItem(value, empty);
                                final VBox vbox = new VBox(5);
                                Image image = new Image(getClass().getResourceAsStream("/images/delete.png"));
                                Button button = new Button("", new ImageView(image));
                                button.getStyleClass().add("deleteButton");
                                final TableCell<String> c = this;
                                button.setOnAction(new EventHandler<ActionEvent>() {
                                      @Override
                                      public void handle(ActionEvent event) {
                                              TableRow tableRow = c.getTableRow();
                                              Item item= (Item) tableRow.getTableView().getItems().get(tableRow.getIndex());
                                              /* TODO : Delete this item from your data list and refresh the table */
                          vbox.getChildren().add(button);
                          setGraphic(vbox);
            cell.setAlignment(Pos.TOP_RIGHT);
            return cell;
    grid.addColumns(titleCol,actionCol);I hope this can help you. :)
    Edited by: Sai Pradeep Dandem on Aug 18, 2011 10:04 PM

  • Playing multiple movie clips one after other on main timeline

    Excuse the probably simple question but I'm just starting off with Flash.
    I have imported a few video trailers directly into flash and saved them as movie clips.
    I want to be able to insert these movie clips onto the main timeline and play them one after the other, repeating once they have all played.
    On the main timeline I have set a layer for each clip and a keyframe where the clip is inserted for each layer.
    When I go to play the flash file, it is showing the first frame from each movie file and then moving to the first frame of the next movie file.
    What do I need to do to make flash play the entire movie file in that specific frame before moving to the next frame where the next movie file is and playing all that movie?
    Sorry for what is probably a simple thing to ask.
    thanks

    Create an actions layer on the main timeline and place stop(); commands on that layer in each frame where a movieclip resides.
    Within in each movieclip, at the end (last frame) you want to tell the main timeline to play(); so that it moves to the next frame (where it will stop because of the stop() commands you add).
    So at the end of each movieclip you will put either:
    for AS2:  _parent.nextFrame();
    for AS3: MovieClip(parent).nextFrame();
    For the last movieclip in the lineup you will replace nextFrame() with gotoAndStop(1);

  • How to add handles on .mov clips from an AVCHD camera

    Hi
    I am trying to put transitions between the clips I have just logged and transferred from my AVCHD camera. They are imported as finite .mov files, without any in and out points. I know that I have to add handles to insert transitions. How do I change the in and out points? When I open the clip in the Viewer window and play with the little slider towards the bottom, it seems to change the overall length of the clip. Is this correct?
    thanks!
    Terri

    Thanks. It does make them shorter. Next time I will do that from the start so there is less messing around on the timeline!
    best
    Terri

  • How to add your method in photoshop plugin & call it from javascript?

    pls help me i have to add a method in photoshop sample plugin & call it through any script like javascript?don't have to use any listener like script listener?

    You create the plugin, so you defined the terminology for the plugin.
    So there should be no reason to use the listener because you already know the terminology needed.

  • Urgent - How to add buttons to a Table

    How to add buttons to a Table and enable them for Mouse Listeners/ Action Listeners

    extends the defaultcellrenderer make it return a Jbutton as the component to draw.
    class OverCellRendererClass extends DefaultTableCellRenderer {
    public Component getTableCellRendererComponent(JTable table,
    Object value,
    boolean isSelected,
    boolean hasFocus,
    int row,
    int column) {
    //put your stuff here to make or get a button
    return myButton;
    Use something like this to set the renderer for the column :
    tb.getColumnModel().getColumn(4).setCellRenderer(new YourCellRendererClass());

  • Simply way to make sub vi and call it form main vi

    I'm a beginner and have major problems to make a sub vi and call it from main vi. I'm going to do a save dialog where is extra info for my saving and want to call dialog from main vi and after that save info to a file or database. I want that save dialog appears after i press button. I attach sub vi where is no functionality yet.
    Attachments:
    save_dialogsub.vi ‏21 KB

    The first step is to connect the controls and indicators that you want to pass information to and from your main vi.
    You right-click on the icon at the top right corner of the Front Panel and select "Show Connector". Typically put inputs at the left and outputs at the right side of the connector pane. Save it.
    Open the main vi. Go to the block diagram. Click on "Select a vi" inside the Functions Palette. And choose the sub vi you prepared. Then wire it up inside your main vi.
    -JLV-

  • Remove Child and Event.SOUND_COMPLETE not working inside movie clip. What's the problem?

    I have a movie clip that is called to the stage. The user then clicks a button and music plays. As the music starts, another movie clip is called, a simulation of  an equilizer. There are several things that should happen:
    1) When the user closes the movie clip the music is supposed to stop playing and the equilizer movie clip is removed. What actually happens is the music stops playing but  the equilzer movie clip is not removed.
    2) When the music is finished playing the equilzer is supposed to be removed from the stage and the play button is reactivated. But none of that happens. When I click on the movie clip a second time equilizer is still there and the play button is not reactivated.
    Here's the code that calls the movie clip to the stage.
    stage.addEventListener(MouseEvent.MOUSE_DOWN, goButtons);
    function goButtons(event:MouseEvent):void
        if (event.target == Song_bnt)
            SoundMixer.stopAll();
            addChild(myPlaySong);
            myPlaySong.x = 304;
            myPlaySong.y = 105;
            //event.stopImmediatePropagation();
    Here's the code in the movie clip:
    import flash.media.Sound;
    import flash.events.Event;
    stop();
    var playRayJaySong:RJSong;
    var playRayJaySongChannel:SoundChannel;
    var equilizer:Equilizer;
    equilizer = new Equilizer();
    playRayJaySong = new RJSong();
    //Plays music, inactivates buttons, and adds the equilizer to the stage.
    PlaySongRJClip.addEventListener(MouseEvent.MOUSE_DOWN, songPageButton);
    function songPageButton(event:Event):void
        playRayJaySongChannel = playRayJaySong.play();
        PlaySongRJClip.visible = false;
        ClicktoPlaySong.visible = false;
        addChild(equilizer);
        equilizer.x = 269;
        equilizer.y = 246;
    //Removes the equilizer from the stage when the music is complete.
    PlaySongRJClip.addEventListener(Event.SOUND_COMPLETE, rjSoundComplete);
        function rjSoundComplete(e:Event):void
        PlaySongRJClip.visible = true;
        ClicktoPlaySong.visible = true;
        removeChild(equilizer);
    //Removes the equilizer and event listeners from stage and calls dispatch event to close the movie clip.
    closeSong_bnt.addEventListener(MouseEvent.MOUSE_DOWN, CloseSong);
    function CloseSong(event:MouseEvent):void
        removeChild(equilizer);
        dispatchEvent(new Event("RemoveMSong"));
        PlaySongRJClip.removeEventListener(MouseEvent.MOUSE_DOWN, songPageButton);
        PlaySongRJClip.removeEventListener(Event.SOUND_COMPLETE, rjSoundComplete);
    //Removes the MovieClip from the stage when the user clicks on the close button inside the MovieClip.
    myPlaySong.addEventListener("RemoveMSong", RemoveSongClip);
    function RemoveSongClip(e:Event):void
        SoundMixer.stopAll();
        removeChild(myPlaySong);
    Any thoughts?

    I figured out the problem. Here's how I reorganized the code (all in one frame).
    //Code for Ray Jay song.
    var playRayJaySong:RJSong;
    var playRayJaySongChannel:SoundChannel;
    playRayJaySong = new RJSong();
    myPlaySong.equilizer_inst.visible = false;
    //Plays the song.
    myPlaySong.PlaySongRJClip.addEventListener(MouseEvent.MOUSE_DOWN, songPageButton);
    function songPageButton(event:Event):void
        playRayJaySongChannel = playRayJaySong.play();
        playRayJaySongChannel.addEventListener(Event.SOUND_COMPLETE, rjSoundComplete);
        myPlaySong.equilizer_inst.visible = true;
        myPlaySong.PlaySongRJClip.visible = false;
        myPlaySong.ClicktoPlaySong.visible = false;
    //Removes the MovieClip from the stage when the user clicks on the close button inside the MovieClip.
    myPlaySong.closeSong_bnt.addEventListener(MouseEvent.CLICK,RemoveSongClip);
    function RemoveSongClip(e:Event):void
        SoundMixer.stopAll();
        removeChild(myPlaySong);
        myPlaySong.equilizer_inst.visible = false;
        myPlaySong.PlaySongRJClip.visible = true;
        myPlaySong.ClicktoPlaySong.visible = true;
        playRayJaySongChannel.removeEventListener(Event.SOUND_COMPLETE, rjSoundComplete);
    //Resets all of the movieclips to their orginal state.
    function rjSoundComplete(e:Event):void
        myPlaySong.equilizer_inst.visible = false;
        myPlaySong.PlaySongRJClip.visible = true;
        myPlaySong.ClicktoPlaySong.visible = true;
    Thanks all for your suggests and input.

  • How do I separate short movie clips loaded from my digital camera to iPhoto 11 at the same time pics are downloaded and how do I get those video clips to a dvd that will play on a dvd player

    When loading pics to iphoto 11 from my camera, occassionaly it will include some video clips with the description of Movxxxx. I wonder if someone could direct me to some straight forward instructions as to how to transfer these video (movie) clips, which now exist in iphoto, to a dvd that will play on a dvd player as one might  expect to see a video play, including the audio that was captured at the time of filming.
    Thanks in advance for any assistance you can offer this novice.

    You need to open iMovie and it will have a event library called iPhoto Videos, click on that and the videos will load in the window next to it, then you make a new project in iMovie.  Then open iDVD and make a new project then import the movies to the program then burn to a DVD..

  • How can i let a move clip complete his motion tween movement after dragging and dropping it

    hi how can i let a move clip complete his motion tween movement after dragging and dropping it
    i am using this code and there is a motion tween applies to the movie clip r_mc
    r_mc.addEventListener(MouseEvent.MOUSE_DOWN,fun); r_mc.addEventListener(MouseEvent.MOUSE_UP,fun2); function fun(event:MouseEvent):void { stop(); r_mc.startDrag();
    function fun2(event:MouseEvent):void {
    play(); r_mc.stopDrag();

    i have a simple .fla file wich contains MC that has
    a motion tween(its moving from the left to the right of the stage)
    this motion tween covers the whole time line (  there is only 50 frames in the time line)
    i mean in the frame 1 the MC appears in the left of the stage
    and in the frame 50 the MC appears in the right of the stage and there is a motion tween between them
    every thing till now working well
    i want to make that MC dragabble
    so when i drag the MC i will use stop()
    and when i drop it i will use play()
    but the problem is that the mc doesnt move and complete
    his motion tween movement when i drop it
    for example the MC will be in the middle of the stage in frame 25
    in this frame (25) i am draging the MC ,stoping the timeline,dropping the MC and resum playing the timeline again
    but the MC freezes in the middle of the stage and doesnt go to the right of the stageo until the flash loops and start from the frame 1 again
    here is the example wich i am worikng on
    http://www.mediafire.com/?ia47r4owha7sz8v
    thank u very much and sorry for my bad English

  • How to stop , play nested movie clips....

    Hi all,
    I'm calling a swf file in a container_mc, which is in
    another swf file(Interface), by loadMovie() method. The Major
    problem I've stucked with is that in the interface I'm having a
    Play/Pause Button, which is not stopping the nested movieclips of
    the external swf file which is loaded in the container_mc
    movieclip.
    The other major issue is that I'm not able to add a
    progressbar(sliderbar) which runs according to the animation, to
    this interface. Please help ASAP

    I have a similiar situation however the container_mc has me
    puzzled, I'm not sure what that is - perhaps you can answer my
    question:
    I have a master swf called index.swf. The index.swf has a
    main tool bar of buttons which load frames; each frame is named to
    coincide with the main bar button (i.e. genInfo, setup,
    mainentance, etc). This works perfectly. My problem is with Movie
    Clips.
    Each frame has a sidebar which loads external swfs (i.e.
    genInfo.swf) - each external swf is made up of a series of Movie
    Clips which run in succession along the timeline; each Movie Clip
    belongs within its own frame (i.e. MCseg1 is in frame seg1; MCseg2
    is in frame seg2, etc).
    I need to pause and play each individual Movie Clip at will;
    I have built two buttons (pauseBtn and playBtn) into a Movie Clip
    called MCpausePlay. The first frame of MCpausePlay contains the
    pauseBtn; this frame is coded with the global "stop();" In order to
    move to frame(2) which contains the playBtn, the pauseBtn is coded
    with -
    on(release) {
    gotoAndPlay(2);
    The playBtn is coded:
    on(release) {
    gotoAndPlay(1);
    When clicked, the MCpausePlay moves from pause to play.
    That's all I have been able to get this to do.
    How do I code MCpausePlay to pause and then play each
    individual Movie Clip? (How do I get a Movie Clip to control other
    Movie Clips?). Should I code the Movie Clip, the frames within the
    Movie Clip, or each individual button within the Movie Clip? And,
    does this MCpausePlay belong on the Index.swf file, or should it be
    on each external swf? Or perhaps built in to every Movie Clip? I
    have tried all and have not had any success.

Maybe you are looking for

  • Boot Windows 8.1 in MBR mode from UEFI GRUB

    Hi, i installed Windows 8.1 in BIOS/MBR mode to my second hardisk /dev/sdb. On my first disk /dev/sda is Archlinux with GRUB 2.0 in UEFI mode. Is it possible to boot Windows 8.1 from the UEFI GRUB? The description in the wiki is only for MBR systems.

  • Update for Camera Raw 6.6 fails with PSE 10 on Mac OSX

    I have been trying to update my just purchased from App Store Photoshop Elements 10 to the latest Camera Raw 6.6 #1 I cannot see an update option in the Help Menu #2 Try to do a Manual Update after mounting the dmg and runnning AdobePatchInstaller.ap

  • How do I stop the rpc. html download that pops up a lot? I think I clicked on a yes by mistake in some window asking about it.

    some window came up asking if I wanted something downloaded. I went to click no , but hit yes by mistake. Now I keep getting this rpc. _html download ( with numbers) almost everytime I open a new tab. How do I stop that.

  • Repeating frame not visible when the query returns no rows

    I've developed a report whose output looks like this: Subinventory | Part Code |Part Description |Ordered Qty | Received Qty Mentone St | BATT | non serialised item | | Mentone St | SONY | spare parts MIN MAX | 30| 0 In the above report subinventory,

  • CS3 Lockup in Design View

    I'm having an issue with my webpage locking up Dreamweaver every time I try to open it in Design View. I can open it with no problem in Code View, but as soon as I try to switch to Design, I get the Spinning Beach Ball of Death. Worked fine until I u