Drop a movie clip to play it

I have a drag and drop set up and I can move the two clips at the bottom around on the stage. When I let go, it snaps back to the original position. I would like to have the user choose a movie clip and drop it in the gray area. On release in that area, I would like the movie to play in the window. Any advice on creating this type of drop trigger would be great. If you know of a tutorial, or sample code, even better.
Thanks,
Rich

convert your gray area to a movieclip (eg, preview_mc) and when your movieclips are dropped use a hitTestObject(preview_mc) to determine whether to center the draged movieclip in preview_mc and play it or return it to its start point

Similar Messages

  • I would like a movie clip to play repeat itself everytime a button is pressed

    Hello,
    I am new to actionscripting but not Flash, I am using Flash
    MX 2004 for a college project at the moment. I have created an
    interface which features four buttons, each button activates a
    different movie clip. This works fine but only on the first time to
    press the button if you press the button again the movie clip does
    not play again, I would like the movie clip to play EVERY time the
    button is pressed. Here is the script that I have created in a
    seperate layer called actions, if that helps:
    ellaimage._visible = false
    Betaimage._visible = false
    Yakuzapic._visible = false
    Pornopic._visible = false
    boxmovie._visible = false
    Betabox._visible = false
    textboxmc._visible = false
    Yakuzabox1._visible = false
    Pornobox1._visible = false
    pellabutton.onRelease = function () {
    stop ();
    Betaimage._visible = false
    Yakuzapic._visible = false
    Pornopic._visible = false
    textboxmc._visible = false
    Betabox._visible = false
    Pornobox1._visible = false
    Yakuzabox1._visible = false
    boxmovie._visible = true
    textboxmc._visible = true
    Pellaimage._visible = true;
    Pellaimage.gotoAndplay(1)}
    Betabutton.onRelease = function () {
    stop ();
    Pellaimage._visible = false
    Yakuzapic._visible = false
    Pornopic._visible = false
    textboxmc._visible = false
    Yakuzabox1._visible = false
    Pornobox1._visible = false
    Betaimage._visible = true
    Betabox._visible = true
    boxmovie._visible = true
    Betaimage.gotoAndplay (1) }
    Yakuzabutton.onRelease = function () {
    stop ();
    Pellaimage._visible = false
    Betaimage._visible = false
    Pornopic._visible = false
    textboxmc._visible = false
    Pornobox1._visible = false
    Betabox._visible = false
    Yakuzabox1._visible = true
    boxmovie._visible = true
    Yakuzapic._visible = true
    Yakuzapic.gotoAndplay (1) }
    Pornobutton.onRelease = function () {
    stop ();
    Pellaimage._visible = false
    Yakuzapic._visible = false
    Betaimage._visible = false
    textboxmc._visible = false
    Betabox._visible = false
    Pornobox1._visible = true
    Yakuzabox1._visible = false
    Pornopic._visible = true
    boxmovie._visible = true
    Pornopic.gotoAndplay (1) }
    // this command stops the timeline
    stop ();
    Any help would be great.
    Thanks in advance

    No that doesn't work, that isn't what I want to to be
    repeated.
    In the below script I want textboxmc (which is a movie clip)
    to restart and play again everytime pellabutton is released.
    pellabutton.onRelease = function () {
    stop ();
    Betaimage._visible = false
    Yakuzapic._visible = false
    Pornopic._visible = false
    textboxmc._visible = false
    Betabox._visible = false
    Pornobox1._visible = false
    Yakuzabox1._visible = false
    boxmovie._visible = true
    textboxmc._visible = true
    Pellaimage._visible = true;
    Pellaimage.gotoAndplay(1)}
    Please can anyone help?

  • How do I get a movie clip to play fully in an iphoto slide show.

    How do I get a movie clip to play fully in an iphoto slideshow.  Right now it only plays for a few seconds, while the complete clip is 22 seconds.

    Bring up the Settings pane for the slideshow and click on the movie clip in the tray at the top.  Then in the Settings pane click on This Slide button and set the play time to the actual length of the movie clip. 
    OT

  • Can't get nested movie clip to play

    Hi everyone,
    I have a movieclip on one of the frames on the maintimeline.
    Within this movieclip is a nested movieclip which itself is
    contained by another clip. The first movie clip plays to a certain
    frame where I've got some code telling the nested movie clip to
    play at that frame but this nested clip doesn't play. I'm not sure
    if I'm targetting the nested clip incorrectly or whether something
    else is wrong with the code.
    The .fla file can be downloaded at:
    http://www.officelinkonline.com.au/Ad/
    if someone would take a look. The movie clip in question is
    on the layer called text5, and within this mc on frame 15 is the
    code I'm trying to use to get the nested movieclip to play at that
    point. The code used on that frame is:
    this.innerText5_mc.free_mc.play();
    stop();
    pauseAnim = setInterval (this, "nextFrame", 4000);
    I wondered if someone could take a look and see what I might
    be doing wrong? Basically the free_mc clip just makes the word
    "FREE" scale up.
    Would really appreciated any advice.
    Thanks

    Thanks again. I'm a bit worried that you weren't able to see
    the font that I used. All of the text used in the animations are
    static text fields. I don't seem to have the option to embed these
    characters since it's static text. It'll only let me embed if the
    text fields are dynamic. Does this mean I have to change them all
    to dynamic text fields, and if so do I need to embed the font in
    every text field in every frame of the animation or can you do this
    in one place?
    Appreciate your continued help.

  • *Class Project - Please help:  Why does my movie clip keep playing over and over?

    I am desperate for help on this one as its my Final Flash
    class project and I just can't get my scenes/movie clips to play in
    the order I want them to.
    I have Scene 1 (movie clip 1) that plays and then Scene 2
    (movie clip 2) plays. The problem is that Scene 2 (or movie clip 2)
    repeats itself over and over again. I can't get it to go back to
    Scene 1 (movie clip 1) to play that again.
    I want it go to to this Scene 1 and actually start at a
    certain frame to continue on with the story.
    I have named my movie clip instances.
    What am I doing wrong? I went into movie clip 2, into
    actions, and movie clip control, and I don't really see a way to
    tell it to go back and play movie clip 1. Trying to see how to
    refer back to the instance name of the movie clip and get it to
    play.
    Ideas? Please please? I would be forever greatful.
    Angie

    quote:
    Originally posted by:
    computerkitten
    I wonder if I should just take that movie clip out of the
    scene completely.... and not have the second scene at all. Maybe I
    should just have 1 scene and these 2 movie clips. Wonder if that
    would work better?
    As Nickels55 said, above, scenes add unnecessary complexity.
    So the answer to this is: YES. Scenes are awkward in Flash. Never
    use them in any final project. Put everything on a single timeline
    in a single scene, and you will have much better control of the
    project.

  • Movie clip stops playing for no reason

    I am making a banner that has multiple movie clips sharing the same area, creating different rainbow effects when different areas (invisible buttons) are moused over.
    First of all I couldn't figure out if there was a way to have one invisible button over the whole area that changed to a different colored effect with each mouse over (first mouse over the black and whites would change to reds, second would change it to blues, third would change it to browns, etc.). Since I couldn't figure this out I settled on creating three buttons covering a third of the banner each, so when the mouse passes over one button it changes to reds, over another button it changes to blues, over the third it changes to browns.
    The effects are movie clips where each frame has another stripe changing color so it goes in a wave effect from one to the next, and then goes back to white and black in the same manner.  The first frame of each movie clip I had to turn into a nested movie clip so I could turn the alpha to 0, since I was going to have these color effect movie clips on top of one another in the main timeline on different layers, and so you could see the effect even if that color layer wasn't on top. I used the same nested movie clip with zero alpha for the first frame of each color effect clip (reds movie clip, blues movie clip, etc), so I dont' know if that's an issue.
    Anyway, it seemed to work fine for a while, but after working on it for a while longer (and not getting any further since I removed most of the changes I made), now when I test the movie the mouse over does not seem to work correctly. It works fine, seemingly, for the first time I mouse over each button, but in order to have it work again I have to mouse over the button twice, and then it will pause randomly during a part of the clip and I have to move my mouse back over for the movie clip to continue.
    I can't tell if this is because of the overlapping movie clips, or because my buttons are messed up, or if my actionscript is messed up, or if the timeline has to be longer, or what. Currently the timeline is 55 frames, the same as each movie clip.
    I put a movieclip_instance.stop(); command in the first frame of the main timeline, is there a better way to do this? Should I put the stop command in the movie clip itself?
    Here is a section of my AS in the main timeline, this is my first time programming ever, in any language, and trying to learn from the internet is more difficult than I thought it would be.
    redmovie.stop();
    red_btn.addEventListener(MouseEvent.ROLL_OVER, playRed);
    function playRed(event:MouseEvent):void
              redmovie.play();

    I am not sure of what the problem is, so I don't know if this will help or not.  One thing I might suggest is that you use gotoAndPlay(1) instead of play().  That way, if your movieclip is in the middle of playing it won't continue but will start from the beginning.
    You could use one button to have the different movieclips play in sequence if you prefer that.  You would just need to have some form of counter that keeps track of which is the next to play. Somethin like...
    var mcCounter:uint = 0; // start at 0 since an array is being used to identify which movieclip to play
    var mcs:Array = new Array(redmovie, bluemovie, brownmovie);
    only_btn.addEventListener(MouseEvent.ROLL_OVER, playMC);
    function playMC(event:MouseEvent):void
             mcs[mcCounter].play();                  // tell the current mc to play
             mcCounter += 1;                            // increment for the next mc
             if(mcCounter == 3) mcCounter = 0;  // reset the counter if it exceeds the array

  • How do I call a Movie Clip to play from within another MC?

    Here's a simple one I'm sure but I can't get it to work or find a solution online.
    I have a movie with 2 movie clips on the stage, the first clip is triggered to play on a button click (which works fine) but I want the 2nd clip to start playing when the first ends. I've tried putting MovieClip2.gotoAndPlay(1) script on the last frame of MovieClip1 but I get  "1120: Access of undefined property".
    I very much appreciate your help.

    Try using:
    MovieClip(this.parent).MovieClip2.play();

  • Movie Clip not playing correctly (Flash CS3, AS2)

    Hey, I'm making a tutorial for a board game and there's this movie clip that mimics a piece being played. It's basically empty for about 9 frames and then the piece is on the 10th frame. On the 10th frame, I placed a stop(); script. The movie clip has no linkage and no label.
    For some reason, on a certain frame, it didn't work. It worked fine on other frames so I copy & pasted from those frames and replaced the movie clip that did not work right. Oddly enough, after I copy & pasted the movie clip, the error spread to the movie clip I copied! I tried it again and again the error spread to what ever clip I copied from. The other movie clips (same item) still functions properly. I never encountered a problem like this. Can anyone please help?

    1. you should have no code attached to objects.  assign your objects instance names (eg, mc) and use those names in your code.
    2. that code should not be in an enterframe loop. 
    if(_root.action_ryu==1){
    mc._alpha=100;  // not _Alpha
    mc.gotoAndPlay(4);
    _root.Ryu._alpha=0;
    } else {
    _root.Ryu_Attack._alpha=0;

  • AS3 to make movie clip not play on default?

    I created a movie clip that I want to play when a button is
    clicked and
    stop when another button is clicked.
    I have a stop action on the first frame where the 2 buttons
    appear and
    the movie clips resides. When I test the movie, the movie
    clip plays by
    default.
    How do I set it up so the movie clip does not play until the
    user clicks
    the play button?
    The code I am using:
    myPlay_btn.addEventListener(MouseEvent.CLICK, playMc);
    myStop_btn.addEventListener(MouseEvent.CLICK, stopMc);
    function playMc(e:MouseEvent):void{
    my_mc.play();
    function stopMc(e:MouseEvent):void{
    my_mc.stop();
    Thanks!!!

    Not sure if I understand. Where specifically should this be
    added to the
    code:
    myPlay_btn.addEventListener(MouseEvent.CLICK, playMc);
    myStop_btn.addEventListener(MouseEvent.CLICK, stopMc);
    function playMc(e:MouseEvent):void{
    my_mc.play();
    function stopMc(e:MouseEvent):void{
    my_mc.stop();
    Thanks!

  • Getting a movie clip to play in reverse

    I have this script to play a movie clip.
    What do I write to get it play in reverse?
    function fadeUp(event:MouseEvent):void {
        buttonFadeOver_mc.play()

    You need to use an enterframe event listener to continuously call prevFrame() until you see that you have reached the starting frame (by checking the currentFrame property).  Once you detect you are at the start you remove the event listener.

  • Selecting a movie clip to play

    Ok,
    The following set of code is partially working for me. If the
    randomNumber*100 is < 90, the clip "straight" plays just fine.
    If it is >90, both the "slightbenddown", and "slightbendup"
    clips go off at the same time.
    var randomNumber:Number = Math.random();
    if (randomNumber*100 <= 90)
    straight.play()
    if (randomNumber*100 > 90 && randomNumber*100
    <= 91)
    slightbenddown.play()
    if (randomNumber*100 > 91 && randomNumber*100
    <= 92)
    slightbendup.play()
    How can I make it so that "slightbenddown" only plays when
    (90<randomNumber<=91) and "slightbendup only plays when
    (91<randomNumber<=92)?
    Thank you for any help that you can give.
    BobR

    I tried the attached code, and still did not get what I was
    looking for. If the else is included for all of the iterations, I
    only get to see straight and slightbenddown. If I do the same
    thing, except leave off all of the elses, I do get to see the other
    movie clips, but almost always I see more than one at a time
    (usually slightbenddown + any other one).
    Any ideas would be appreciated.
    BobR

  • Can' get movie clip to play

    I have a Flash movie that plays a movie clip called DR1 at
    frame 113 using this code:
    DR1.play();
    There is nothing else going on in the movie for the length of
    the clip, but when I play the movie, the clip does not play - I
    just have a blank screen for those frames.
    Also, if I try dragging an instance of the movie onto the
    timeline at that point, the same thing happens - blank screen for
    the amount of frames that the clip is present.
    If I play the clip in the library it plays correctly.
    What am I doing wrong?
    Thanks,
    Beth

    OK - I realize now that I have to actually publish the movie
    to have the clip play, whether by dragging an instance onto the
    timeline or loading it via AS.
    Now I have another issue. I'm sorry if these are stupid
    questions, but I have a hard time finding things in the help file -
    maybe I'm too much of a new Flash user to understand what to look
    for!
    Anyway, when I play the movie, I have three problems:
    1) the clip starts playing immediately, even though I don't
    issue the play() command until the middle of the movie. I do the
    attachMovie in the first frame so that it has loaded by the time I
    want to play it, but it starts playing right away even though I
    don't tell it to play.
    2) the clip seems to be centered on the upper left corner of
    the screen when it plays. I have tried setting the _x and _y
    properties of the instance to 0,0 but that doesn't seem to make a
    difference. I want the clip to be centered on the screen (it is
    sized to take up the whole stage) but can't seem to move it no
    matter what values I plug into the _x and _y properties.
    3) the clip loops continuously. I only want it to play once
    but can't seem to find a property to control the looping.
    Here is the code in the first frame:
    var mc1:MovieClip;
    mc1 = this.createEmptyMovieClip("DR1",
    this.getNextHighestDepth());
    this.attachMovie("DR1", "mc1", this.getNextHighestDepth());
    mc1._x = 500;
    mc1._y = 500;
    mc1.stop(); (this was added to get it to not play until
    later, to no avail)
    And the code at frame 113:
    mc1.play();
    And finally at frame 412:
    mc1.stop();
    Help, please!
    Thanks,
    Beth

  • Movie clip not playing

    i create some animation. actuvally i move mouse on button some menu visible, i click test button  when play "boxani" Movie Clip.
    but not playing.  ?????
    Test link
    http://megaswf.com/serve/1185333
    btn_mc.menu_mc._visible = false;
    boxani_mc.stop();
    btn_mc.onRollOver = function()
              btn_mc.menu_mc._visible = true;
    btn_mc.onRollOut = function()
              btn_mc.menu_mc._visible = false;
    btn_mc.test_btn.onRelease = function()
              boxani_mc.play();

    any solution that type of animation method
    like freedocast video player mouse over menu and click run action (16:9, 4:3).
    http://www.freedocast.com/watchvideo.aspx?vid=531B426A31D72143109F

  • Can I include movie clips be played in the LR4's Slideshow module?

    Hi,  I'am just starting to learn about LR's SlideShow module. I recently returned from a vacation in eastern Europe and want to create a slideshow of my best pictures and short movie clips. The slideshow is mostly still photography, but I also want to play a few of the clips shot in movie mode and play these clips inside the slideshow.  Is this possible in LR4's Slideshow module?

    No, unfortunately that is not possible in this version.
    Other people have felt the same need though: you can support this by adding your vote in the feature request forum
    http://feedback.photoshop.com/photoshop_family/topics/adding_videos_to_lr3_slideshows

  • Drop and drop 4 movie clips to single target to navigate to seperate urls

    var myTargetName:String = "target" + event.target.name;
    var myTarget:DisplayObject = getChildByName(myTargetName);
    if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
        navigateToURL(new URLRequest(http:// websiteAdress.com));
    I am trying to navigate to a new url for each movie clip, problem is im really unsure of how to achieve this I have one target on my page and would like to be able to drop any of these movie clipt o to  it?
    the movie clips are named:
    port1_mc
    port2_mc
    port3_mc
    port_4mc
    really appreciate the help

    assign a property to each movieclip that indicates the associated url.  for example:
    port1_mc.urlS="http://www.adobe.com";port2_mc.urlS="http://www.flash.com";
    port3_mc.urlS="http://www.kglad.com";
    port_4mc.urlS="http:://www.whatever.com";
    you can then use:
    navigateToURL(new URLRequest(e.currentTarget.urlS));
    in your listener function.

Maybe you are looking for

  • GUI_UPLOAD+HAS_FIELD_SEPARATOR

    Hi everybody . In my program, I use the fm GUI_UPLOAD to upload the flat file which separator is the pipe(|). Exemple of line :  AAA|BBB|CCC|DDD HAS_FIELD_SEPARATOR='|' not working, so how can i use this fm and define SEPARATOR  as pipe . thank  in a

  • Change logs for Shopping cart

    Hi, Is it possible to get the change logs for a shopping cart in SRM as to who deleted a line item after approval? We are in the SRM 4 version ( classic scenario). The problem is that the batch job user seems to be coming up in the last update for th

  • For some reason every so often Firefox responds incorrecty to certain key strokes .

    The details are that Firefox will work fine and then for no reason I am able to determine [Shift + 2] becomes @ instead of " and [shift + ' ] becomes " instead of @. This problem is only within Firefox as all other software continues to produce the c

  • Increasing font size

    Hi All, Is there a way to increase/change the font size of letters on SAP screens. Is there a parameter/parameters through which thsi can be done? Thanks in advance. Regards Cyrus

  • Simple features wish list

    Please allow the reading and writing of text files as a standard feature vs having third party software to do so.  In the file manager, please use the default interface for playing music instead of the video player. Same for pictures. Please allow ch