Moving three movie clips together to a y co-ordinate of an event click

I have 9 buttons (with instance names mov_1 - mov_9) verticle along a page. I want movie clips a, b and c. with instance names (ltop, graphic and lbottom). to move in parrallel down the page to the y co-ordinates of each of the 9 button movie clips when clicked on. My code so far for each of the cases is:
  public function onClicked( e:MouseEvent ):void
   var circle:MovieClip = e.currentTarget as MovieClip;
   HtmlTextFieldFactory.formatTextFields(  [panel.title, panel.content], this.context );
   switch( circle )
    case mov_1:
     panel.title.htmlText = _modelDataHelper.getTextAssets( "ct1" );
     panel.content.htmlText = _modelDataHelper.getTextAssets( "c1" );
     panel.x = 30;
     panel.y = 438;
     circle.alpha = 1;
     circle.removeEventListener(MouseEvent.MOUSE_OUT, onMouseOut );
     circle.removeEventListener(MouseEvent.MOUSE_OVER, onMouseOver );
     var mov_1_y:Number = mov_1.y;
     var myTween1a:Tween = new Tween(graphic, "scaleY", Strong.easeOut, graphic.scaleY, 1, 2, true);
     var myTween1b:Tween = new Tween(graphic, "y", Strong.easeOut, graphic.y, mov_1_y, 2, true);
     var myTween1c:Tween = new Tween(ltop, "y", Strong.easeOut, ltop.y, graphic.y, 2, true);
     var myTween1d:Tween = new Tween(lbottom, "y", Strong.easeOut, lbottom.y, graphic.y + 135, 2, true);
     break;
Currently on one click of mov_1, graphic moves to the correct place. But it takes a second click before ltop and lbottom move to the correct place. I am needing them to move at the same time, together.
Any suggestions?
Thanks

This is happening because of what the value of graphic.y is at the time of instantiating myTween1c and myTween1d. Perhaps they should be this:
var myTween1c:Tween = new Tween(ltop, "y", Strong.easeOut, ltop.y, mov_1_y, 2, true);
var myTween1d:Tween = new Tween(lbottom, "y", Strong.easeOut, lbottom.y, mov_1_y + 135, 2, true);
HTH

Similar Messages

  • I have 3 consecutive movie clips that I am trying to drop into the drop zone but it only recognizes the first one and only produces the firts one in a DVD. How can I drop all three  movie clips into one drop zone

    On IDVD, I have 3 consecutive movie clips that I am trying to drop into the drop zone to create a DVD but it only recognizes the first one I dropped and only produced the first one in a DVD. How can I drop all three  movie clips into one drop zone.

    I have had some luck doing the following: Export each clip from imovie as a quicktime clip. Open iDVD and create a new project. Import a few stills into iDVD and then click on the button that gets created to get into the screen where the individual slides appear. Drag each quicktime into that screen and arrange in the order you want. You can then delete the stills. The button that appeared when you dropped in the stills will launch a complete show.

  • Dynamically placing movie clip at the angle and global position of a mouse click (button) which is constantly rotating.

    Does anyone know the code for finding the global positioning of  X & Y co-ordinates of a click of a button which is constantly rotating,
    and then secondly the code for when you click on the button it  displays a movie clip on top of it -(position of x & y when clicked) at the angle that you clicked it  (so underneath the buttons are still rotating so other people can click them where they are)
    to explain the context, I'm trying to design a mock up of a circular interactive table
    when someone comes up to it and clicks on one of the buttons that are moving, it reads where the person clicked it and opens up a new box (movie clip) where they clicked it (at the angle) so its not upside down if you are at the top.
    I've included my .fla file which shows the four buttons moving and a little diagram
    explaining what I'm trying to do.

    yourbutton.addEventListener(MouseEvent.CLICK,f);
    function f(e:MouseEvent){
    var yourmc:MovieClip=new YourMC();
    yourmc.x=e.stageX;  // if you want the mouse position where the button was clicked.  else use e.currentTarget.x and e.currentTarget.y
    yourmc.y=e.stageY;
    yourmc.rotation=e.currentTarget.rotation;
    addChild(yourmc);

  • Moving a movie clip via key press event question.

    I have a project where I'm trying to move the movie clip: "wally", up and down three levels of a stage.
    However, from the default position I have him move up 145 pixels, and down 120 pixels.
    I want to limit this action to one use, meaning if wally goes up once from his default position he must come back down, and vice versa, if he goes down he must come back up(or stay on that level). Also, if he goes up the 145 pixels, he needs to come back down 145 pixels, likewise if he goes down 120 pixels, he needs to come back up 120 pixels. I might be over-thinking this, as I had to strip it back to the starting code the other day, and am at a loss once more. If this'd be easier performed by moving with keyboard arrows and case statments, let me know, as I'm stumped.
    Starting code:
    stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressHandler1);
    function keyPressHandler1(event:KeyboardEvent):void
              if(event.keyCode==38)
                        wally.y -= 145;
                        else if(event.keyCode==40)
                        wally.y += 120;

    use:
    wally.startY = wally.y;
    stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressHandler1);
    function keyPressHandler1(event:KeyboardEvent):void
              if(event.keyCode==38)
    if(wally.y==wally.startY){
                        wally.y -= 145;
    } else if(wally.y>wally.startY){
    wally.y=wally.startY
                        else if(event.keyCode==40)
    if(wally.y==wally.startY){
                        wally.y += 120;
    } else if(wally.y<wally.startY){
    wally.y=wally.startY;
    p.s. please mark helpful/correct responses.

  • Locking Movie Clips Together?

    I have 50 movie clips containing images. what I need is that
    when I drag one movie clip, they all move at the same time and the
    same way as if I was moving all of them. I can't put them in a
    container movie clip because I need to know their _x and _y
    positions at all time.
    Can anyone help?
    Thank You! :)

    at the start of your drag (onPress) assign some variables to
    store the initial _x and _y properties of the movieclip being
    dragged and initiate a loop (like setInterval() or onEnterFrame).
    in the loop adjust each of your other movieclip's _x and _y
    properties by the same amount as the change in the dragged
    movieclip's _x and _y properties.
    terminate the loop when you stopDrag().

  • Moving a Movie Clip dynamically

    Hi All,
    I want to move a movie clip dynamically on a predifined
    track. How could I do this? help me.
    Thanks in advance
    Ankur

    Ankur Arora wrote:
    > Hi All,
    > I want to move a movie clip dynamically on a predifined
    track. How could I do this? help me.
    what kind of "predefined track" is that ?
    Best Regards
    Urami
    !!!!!!! Merry Christmas !!!!!!!
    Happy New Year
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • How to stop a movie clip moving

    I'm not newbie to flash but I am newbie to coding using
    actionscript!!!
    I am trying to create a button that moves a movie clip
    ("content1") diagonally across the screen but once the movie clip
    reaches a certain x co-ordinate I want it to stop and then when I
    click another button I would like it to return to it's starting
    position. At the moment the movie clip moves if I click one of the
    buttons but as soon as I click another one it stops which it
    shouldn't it should go back in the other direction. The other
    problem is that once I've clicked a button I cant seem to get it to
    stop moving once it reaches a certain _x position it just keeps on
    moving off the stage.
    Below is the script I have so far not including any
    conditions to check if "content1" has reached it _x position
    Could anyone help please!!!!
    //on Right movie clip containing the button
    onClipEvent (enterFrame) {
    _root.content1._x += speedX;
    _root.content1._y -= speedY;
    //on Right button inside movie clip
    on (press) {
    speedX = 5.5;
    speedY = 1.33;
    //on Left movie clip containing the button
    onClipEvent (enterFrame) {
    _root.content1._x += speedX;
    _root.content1._y -= speedY;
    //on Left button inside movie clip
    on (press) {
    speedX = 5.5;
    speedY = 1.33;

    Many thanks ClBeech!!!
    I've tried the code you suggested but it doesn't seem to work
    :0(
    I'm working on a Mac using Flash Pro 8 which only has the
    option to publish as 'actionscript 1.0 or 2.0' is the script you
    supplied an actionscript 3.0?
    Below is the script with the amendments, I've changed my
    button instance names to match the script you supplied (left_btn /
    right_btn)
    stop();
    import mx.transitions.Tween;
    import mx.transitions.easing.Strong;
    var rposX = 369;
    //the ending x of the right position
    var rposY = 84;
    //the ending y of the right position
    var lposX = 116;
    //the ending x of the left position
    var lposY = 154;
    //the ending y of the left position
    right_btn.onPress = function() {
    new Tween(content1, '_x', Strong.easeOut, content1._x,
    rposX, time, false);
    new Tween(content1, '_y', Strong.easeOut, content1._y,
    rposY, time, false);
    left_btn.onPress = function() {
    new Tween(content1, '_x', Strong.easeOut, content1._x,
    lposX, time, false);
    new Tween(content1, '_y', Strong.easeOut, content1._y,
    lposY, time, false);

  • Moving on a Movie Clip

    CS3
    Basic Question, I think. I've made a lot of flash files and I noticed that when I zoom in over a movie clip, I lose the hand to move around the flash. This doesn't happen when not over a movie clip.
    Here's the problem swf (the others I don't really care about). I made this for my aviation forum: Map of Australia.
    If you zoom to read this large map all is pretty much ok, but I have a movie clip showing an addon companies product coverage and when on, people cannot drag when zoomed. If you need to see what I mean, check the box for "Orbx Coverage". Now zoom in and you'll see.
    Thanks for the help!
    ~Dan

    You're saying that  mine is the first time you have ever seen anyone use the right click for providing zoom/panning control. The one thing that statement is, is the furthest thing from a fact because you're missing the point. I am not asking how to zoom, or that I want to use/provide any one method of zooming. By saying the quoted above, you insinuate that that I am intentionally using the right click method for providing zoom or expecting them to use my files in that way. No I am not, Flash is. I am merely trying to understand how some people seem to be able to design theirs in a way that a viewer, like myself, can zoom in and then pan, but when I do to my files, I cannot.
    If using zoom controls or ANY other alternate method (or whatever other method you seem to think I am avoiding), is indeed why one cannot pan, then please, feel free to inform me and I'll try it immediately. If the answer is by using another flash player like you state, then that too would be interesting to know which. It's not that I'm getting an attitude, I am correcting you for being wrong on your take of what I'm trying to do, nothing more.
    Re-wording my question:
    In What manner, can one create a Flash document in which they can zoom and then pan around movie clips? If a certain use of any particular event allows this then that is the answer I seek (such as event.delta which does not).
    If the answer is only the above method then I guess I will then put  instance names on every mc I ever create and thus a separate line of  code for every single nested and other, movie clip in my entire file. I only try to point out that the files I have in AS2, do not do that, the AS3 1 file I have does not do that and various banners and others work that I've seen, does not do that (or at least appear to). Since Flash came out from Macromedia I have often zoomed in on nicely created flash files to see certain detail. In 99% of these cases it acts like Adobe reader and I get a hand to then pan around. Why on earth would someone want to make controls for doing this, when you can just click and drag? Have you ever googled directions? There are two map formats available in case you didn't know. There are zoom and pan w/hand (like I'm talking about), and then there is idiotic controls that one then has to leave the map to use and click the dumb little arrows and +- controls (I can't stand those maps and would never intentional create one so flawed in design from the start). Can you imagine using Adobe reader zoomed in and not having the hand? Using PhotoShop or Flash and NOT have the ability to hold space bar then drag?
    Thanks Ned for trying to help and working with me on this, it is appreciated, but I need to dig deeper and hope there is a better answer or someone from Adobe can pipe in and say, "Nope".
    Why to the above of course, and the only answer I'm really hoping to find here.
    Bonus why's that have now been brought up:
    Why do I need to tell flash to set enable mouse to false if my intentions are to use the mouse? This seems like quite the code oxymoron to me, especially since by setting it to false it gives me more mouse control then without.
    Why is the default to not allow panning when zoomed in? Is this only CS3 and below?
    Why in any situation while zoomed in, when I right click and move above the menu I then get the panning hand, even though they are in situations when I otherwise would not? If this is just a glitch I would hope someone at Adobe can harness that flaky behavior and make it default.

  • Multiple Movie clips and rollovers

    Hi, I need some help. I am putting together a flash file with
    3 movieclips. I have three movie clips I made - one for each of the
    3 big circles. When they roll over the other circles are supposed
    to disappear under the circle that they have their mouse on. I
    placed all 3 movie clips on the first scene, but when they roll
    over one of the circles the other circle movie clips stay there
    while the other one runs on the mouse over. I need the other ones
    to disappear. You can view what I have so far:
    http://www.feeco.com/Portals/0/encap.swf.
    If you need to see my fla file I can email it to you. Thanks!
    Stephanie

    use:
    stop();
    yourplaybutton.addEventListener(MouseEvent.CLICK,playF);   // replace yourplaybutton with the name of your play button.
    function playF(e:MouseEvent):void{
    play();
    /* Click to Go to Frame and Play
    Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and continues playback from that frame.
    Can be used on the main timeline or on movie clip timelines.
    Instructions:
    1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
    button_19.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_15);
    function fl_ClickToGoToAndPlayFromFrame_15(event:MouseEvent):void
        gotoAndPlay(2);
    /* Click to Go to Next Frame and Stop
    Clicking on the specified symbol instance moves the playhead to the next frame and stops the movie.
    button_20.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame_6);
    function fl_ClickToGoToNextFrame_6(event:MouseEvent):void
        nextFrame();
    I also have added a keyframe to the end of my actions to stop(); this does not appear here with this code but on a separte screen but under the same actions folder the stop works just as I want to the last movie clip stops at the end
    Just can not figure out how to get the play to not start over from begining but to continue.

  • Flash Movie Clip Run Very Slow

    I have about 10 of "coconut tree" Movie Clips, 1 clouds movie
    clip, 1sea movie clip. The problem is when i run all of the movie
    clips together, the animation run very slow. Can anyone help me
    please................................................
    thanks

    It's hard to tell without knowing what those movie clips
    contain. If they contain raster images (bitmaps), have tons of
    points, utilize a lot of alpha tweening, etc. it could be the
    cause. How does it run with each movie clip running by itself? Are
    coconut trees vector or raster? If vector, can you optimize the
    shapes any to reduce the number of points?
    (Modify>Shape>Optimize)

  • Single droptarget for multiple movie clips

    I have a movie clip which i use as a drop target. And I have four additional movie clips which can be dragged and dropped into the droptarget movie clip. But when I place a movie clip into a droptarget and I drop the second one too, the droptarget for the second one becomes the first movie clip but not the actual droptarget movie clip.
    Please suggest.

    Thank you for the reply. Can you give me an idea what the below code does?
    mainContainer is a movie clip. mc1, mc2 are three movie clips
    mainContainer.addChild( mc1 );
         and while dropping mc2
    mc2._droptarget - what this will refer to?

  • Buttons and movie clips

    I'm sorry if this question has already been answered. I
    searched the archives and couldn't find what I was looking for.
    Basically what I want to do is use a button to play a movie when
    pressed. The problem is I can't figure out how to do it.
    1. I've created 3 buttoms and three movie clips.
    2. I created a layer for the background which has text on it
    that says "press to view".
    3. I created another layer for the buttons and one layer for
    the button text
    4. I created an actions layer and put a stop action in frame
    1
    5. I added another layer for the movie clips on frame 2
    (mailflow_mc), frame 3 (reject_mc), frame 4 (fullrate_mc) and
    labeled each frame accordingly.
    6. Add action script for each button:
    on (press) {
    gotoAndPlay("reject");
    When I play the movie the animations will not load and they
    flash fast. Any suggestions?
    Thanks,
    Mimi

    if you have a frame labelled reject you can use:

  • Controlling flash movie clips...

    I made a flash animation using timelines and broke my movie up into three clips. The clips run fine in their own time line. I was reading about clip.play() clip.stop() and it seemed like I could do this. I have a main timeline with three frames. Each frame has a movie clip symbol on it. Each movie clip symbol has a timeline a few seconds long in it.
    I did this because I want to put a click event that will go to a different url depending on which clip the viewer is currently seeing. This swf file will be embedded into an html document.
    When I run the resulting swf - the three frames on the main timeline zip along like crazy and the movie clips don't play at all. I've tried every combination of stop() and play() I can think of but this is just not working as advertised...
    My movie clips have instance names of Clip1, Clip2 and Clip3. Can someone help me with
    1) some sample code that works so that I can run these clips in consecutive order;
    2) the appropriate onClick code to use in the main timeline frames for my url events
    Thanks much.
    BC

    I had to put this on hold to make a deadline and never really got back to it until just now - another similar request. So here is a modification to the code provided to me that I made and seems to do exactly what I wanted. I am not an expert at script but I haven't had a problem with this so I am going with it. If this helps anyone else - great! I never got a reply from the original poster on how to fix the problem where the script they provided looped around on my final movie clip.
    This is the code I used in frame one to control the loop for the three movie clips:
    var myMov:MovieClip
    myMov = Clip1
    this.stop();
    // myMov.play()
    this.addEventListener (Event.ENTER_FRAME, onEnterFrame); function onEnterFrame (event:Event):void {
    // is "myMov" current frame, play head, at the end of "myMov"
    if (myMov.currentFrame >= myMov.totalFrames) {
    // if it is then move the main timeline on 1 frame  
    if (this.currentFrame == 3) {
      myMov = Clip1;
      this.gotoAndStop (this.currentFrame-2);  }
    else {
      this.gotoAndStop (this.currentFrame+1);  }

  • Quicktime 10 - joining movie clips?

    I used to be able to join movie clips together in QT 7 (Pro upgrade) simply 'by dragging and dropping', but cannot seem to be able to do it in the new QT (SL). Is there a solution?
    Message was edited by: Liamo

    As Wyodor said, use QuickTime 7 Player. It should be in the Applications -> Utilities folder on your computer.

  • In actionscript 3.0 how do i make a nested movie clip button go to a frame on the main timeline

    I am making a website based in flash actionscript 3.0 i have a button nested in its own movie clip, because I have the button expanding to be able to read it i have figured out the only way to do this is by creating it as a movie clipa nd inside the movie clip creating it as a button
    I added an event listener to the blog button by saying,
    blog.addEventListener(MouseEvent.ROLL_OVER,gotoblog);
    function gotoblog(evtobj:MouseEvent){
         gotoAndStop(2)
    this part of the code works it goes to the 2nd frame of the timeline it is in and stops wich is a blown up version of the origanal symbol
    i added on frame 2 a second command
    blog.addEventListener(MouseEvent.CLICK.gotoblogpage);
    function gotoblogpage(evtobj:MouseEvent){
    gotoAndStop("blogframe")
    trace("the blog button was clicked")
    i have named the symbol blog and have name the frame of where the blog page is going to be "blogframe" this line of code at the bottom is where i run into trouble the output window in Flash is saying "The blog button was clicked" just like i want it to. no errors are accouring why than is the playhead not going to frame "blogframe"? if the button is working when i click it the code is right i belive the problem here is it does not want the playhead to go to the frame i want it to. So i gues my question is, how can i make a button withing a movie clip interact with the main timeline?

    I have a similar problem if could please help me i'd really apreciate it!!
    So i have a looping animation of some thumbnails, the hierarchy goes like this
    Scene1(main timeline) -> imgBar(MC)->imgBarB(MC within the imgBar MC)
    My buttons symbols are in the last MC "imgBarB" where i have this code:
    ss1.addEventListener(MouseEvent.CLICK, OneButtonClicked);
      function OneButtonClicked(event:MouseEvent):void{
      MovieClip(root).gotoAndStop("ssbox1");
    I want to control the Btns in my "imgBarB" MC to play a labeled frame(named "ssbox1") on another MC on the main timeline,this other MC goes like this:
    Scene1(main timeline)->ssbox_mc(MC where my labeled frame is)

Maybe you are looking for

  • Error while creating adf table in jdev 11.1.1.2.0

    Hi I am getting below error while running the jsf page. ======= <UIXInclude><_setupIncludeContext> Illegal call to setup the context of an include that is already in context <UIXInclude><_tearDownIncludeContext> Illegal call to tear down the context

  • I want to print edited Pages documents with Comments written in margins, not yellow boxes

    Can anyone tell me a way to use Track Changes to edit a Pages document so my comments are printed in margins, not hidden in yellow boxes. I was able to do this on Word documents, but my students are now using Pages. Neither they nor I can see all com

  • Problem with IT0080 Enhancement using exit_sapfp50m_002

    My specification requires a change the default dates for start and end dates of IT2001(Absences) on the screen of IT0080 (Maternity Infotype). While entering dates for IT0080 on the screen IT2001 begin and end dates are set to default to a certain da

  • How to create xml template in landscape format

    Hello Everyone, I am trying to create a template in Landscape format in xml publisher. But when i upload and run, the output is in portrait format only. Any suggestions would be helpful. Thank You Kumar

  • Mail merge and Page count

    I've made a template with at the bottom a "Page Number/Page Count" inserted. When I do a mail merge, a new document is being created including all the addresses of my mailing list. If for example you have a 2 page document, which you merge with a lis