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>

Similar Messages

  • Moving Movie Clips dynamically

    Here's the deal. I have a function that I call to move the
    movie clips based on string that holds the movie clip instance
    name. The function as I have it now can be seen below listed under
    figure A. Figure B shows my call to that function. It takes in an
    array of strings and passes the current index to the function.
    Figure C shows my output panel text after I run the function.
    For some reason, the function is only moving one of my
    movieclips, and none of the others. I can tell this by tracing the
    instance ._x value, as shown in figure D. So, I know that my calls
    to the movieclip instances are correct, but why can I only move one
    card?? I know the movie clips are instantiated, as can be seen in
    Figure E, which show my objects list that I get from my debug menu.
    Any ideas/suggestions?

    My latest crack at it... I create multiple controllers for
    each movie clip, and I test the calling of the method by inserting
    a string literal as the call, still no luck. No matter how many
    times I call move, it will only work on the last card that I call.
    Framerate does not matter.

  • Center movie clips dynamically, as3.0

    Hi.  I have seen this discussed both on Adobe Forums and other sites but I can't seem to make sense of the code supplied by what I have seen thus far.
    I am trying to center display objects that are added to the stage at runtime dynamically through a basic drawing application.
    the code is something like this:
    1. add an event listener for the drawing event.
    2. add the path you want to draw to a container movie clip on the stage.
    3. add an enter-frame event listener to change the scale of the path randomly .... and this is the moment i want to change the default top,left registration point to the center,center of the path.  each path has its own registration point as i can tell thus far but at this point the scale is happening from the top,left of the container rather than about the path's own self.  and if it were to happen about the path i would have to get the bounds of the path and do some averaging to center the registration point.
    unfortunately i don't know what the code looks like to achieve what i'm trying to get.
    any help is appreciated.  thanks in advance.

    Well if using the graphics.lineTo method is Bitmap data then that is what I'm using.  But each call to the shape that I'm drawing is a new Shape(); .  The second paragraph you wrote seems a bit daunting when viewing it in the abstract sense.  Your first reply was a bit more concrete but I guess the first response didn't account for everything being in one container.  Should I create a container2 Movie Clip and create that as a new box on a per-shape basis so that I have multiple container2 mc's in the following path:
    container.container2[i].shape[i] where i would be an index (such that i++) though the code wouldn't be written exactly that way. ?
    (To store localX,Y positions in an array or vector shouldn't be too hard but I would need to try it several times before I get it right).

  • 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.

  • 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

  • How to resize movie clip dynamically

    how to resize movie clip sccording the stage size and width

    how to resize movie clip sccording the stage size and width

  • RePost: center movie clips dynamically, as3.0 ?

    I have a question that was somewhat answered but I now have some problems with, as far as implementing the solution is concerned.  I posted in August and I have revisited the file only now to see if I can create the changes necessary to center my mc's dynamically as they are drawn on the stage at runtime.  They need to center to themselves rather than having their registration points in the top left corner, per display object.
    Here is the thread:
    http://forums.adobe.com/message/5760947#5760947
    Thanks in advance for any responses.
    -markerline

    I attempted to reply yesterday but the forums became under maintenance (as we all re-logged in after).
    What I tried to post before the system went down was to give a single example as you had mentioned. To remove the complexity of the rest of the app so this can be understood alone and then implemented into your larger system.
    Centering via container in code is very simple as long as you can grab a hold of the shape in code as well.
    Here's a complete AS3 example of centering a single object inside a container. I just want you to paste this into a new AS3 doc so you can tell me you understand how it works. After that, the more complex multi-object container in a container approach comes in:
    e.g. 2 squares rotating:
    import flash.display.Shape;
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    import flash.display.Sprite;
    // start rotation loop using a Timer to turn all objects
    var moveTimer:Timer = new Timer(10,0);
    // function to rotate objects
    moveTimer.addEventListener(TimerEvent.TIMER, handleTimer);
    // draw a rect shape
    var redrect:Shape = new Shape();
    redrect.graphics.lineStyle(3,0x0,1,true);
    redrect.graphics.beginFill(0xFF0000);
    redrect.graphics.drawRect(0,0,100,100);
    redrect.graphics.endFill();
    addChild(redrect);
    // position at x:100 / y:100 on stage
    redrect.x = 150;
    redrect.y = 200;
    // now draw a blue square but with a container while centering the shape
    // container
    var blueContainer:Sprite = new Sprite();
    addChild(blueContainer);
    // draw a rect shape
    var bluerect:Shape = new Shape();
    bluerect.graphics.lineStyle(3,0x0,1,true);
    bluerect.graphics.beginFill(0x0000FF);
    bluerect.graphics.drawRect(0,0,100,100);
    bluerect.graphics.endFill();
    blueContainer.addChild(bluerect);
    // position in center of container (subtract half width/height)
    //-------------centering code----------------
    bluerect.x -= bluerect.width / 2;
    bluerect.y -= bluerect.height / 2;
    // position container
    blueContainer.x = 400;
    blueContainer.y = 200;
    // start timer which invokes function below
    moveTimer.start();
    // rotate the red rect (upper left reg) and blue (objects centered);
    function handleTimer(e:TimerEvent):void
              // just rotate both to see the registration
              redrect.rotation += 2;
              blueContainer.rotation += 2;
    Now do understand I know I can draw my bluerect with negative coordinates to achieve the same thing inside the shape (e.g. -50,-50,100,100) but the point here is containing potentially a complex object into a single object so the entire outer contents can be measured and rotated from a single center point. That comes after this simple code is understood.

  • Can I change the registration point of a movie clip?

    I'm loading a movie clip dynamically and its registration
    point defaults to top-left corner. I need to change it to the
    center, is this possible? if so, how?
    Thank you

    Thank you. I tried that and it didn't work too. Please check
    this code:
    loader.loadClip(_global.image_url+this["image1"], image1);
    DynamicRegistration.initialize(image1);
    image1.setRegistration( 20, 20);
    What is wrong with it?

  • Transform on movie clips

    I am loading a bunch of movie clips dynamically. Right now,
    the movie clips undergo a color transform for the onRelease()
    action. Now, I want to be able to transform a group of movie clips
    on the onRelease() action of a single movieclip.
    What would be the recommendation to accomplish this task? I'm
    sure there are many ways to do it, but I don't know where to start.
    I tried to put the movie clips into an array to then access the
    movie clips. I can get the properties of the movieclips that I want
    to transform, but I cannot transform them.

    This is the code that I use:
    for (var j:Number = 0; j<quad.length; j++) {
    var bu_mc:MovieClip = quad[j];
    bu_mc.select();
    trace("xPos: "+bu_mc._x+" building: "+bu_mc._name);
    The correct _x and _name are displayed, but nothing happens
    to the movieclip.
    select() is a function that I've defined. It works when
    called by the movieclip itself, but is not working when called by a
    different movieclip.

  • 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);

  • Printing a movie clip with dynamic text boxes

    I've got a certificate inside a movie clip, and i want the
    dynamic text box to dispay the user name, but for some reason it is
    coming up undefined, even though i have the dynamic text box set to
    finalname = _root.inputname, but it comes up as undefined on the
    screen. :( Can anyone tell me where i am going wrong?
    Is there a way to print just a specific movie clip on the
    screen? I can only print all the frames in the movie and without
    the dynamic text box... any help would be greatly
    appreciated.

    assign the mouseChildren property of your movieclip to false.

  • Dynamic text in different movie clip

    Inside scene one i have a movie clip that contains a movie
    clip that contains a dynamic text field. Also inside Scene one I
    have a different movie clip that contains a movie clip that
    contains a movie clip that contains a input text field. And I need
    for the user to type in to the input text field and see what they
    are typing show up in the dynamic text field. What would that
    script look like and where would I put it? Can anyone help
    please?

    hi!
    Lets say you have your dynamic clip on the same level as the
    movieclip containing your input field.
    _root.dynamic_texfield_name.text =
    _root.name_of_movieclip.input_texfield_name.text;
    If you need the dynamic textfield to be updated as soon as
    the user types something in the input field you can use a onChange
    handler.
    _root.name_of_movieclip.input_texfield_name.onChange =
    function(){
    _root.dynamic_texfield_name.text =
    _root.name_of_movieclip.input_texfield_name.text;
    }

  • Dynamic text in looping movie clip

    Hi,
    I am looping a movie clip which has a dynamic text box. I
    need to call data from XML and place the same in the Dynamic text
    box as per the duplicated movie clip. how do i do that.
    Thanks,
    Ayush

    on (release) {
    _parent.frontFields.topTextArch.ph2TopTextBrush._visible =
    false;
    That is the script attached to my button. I can see the text
    flash for a second when I push the button but it does'nt go away
    because the looping movie clip just continually goes back to the
    first frame and makes the ph2TopTextBrush text field visible again.
    I think I know what your saying. Your saying to attach a
    script to the first frame of the looping movie clip that would
    check to see which of the 3 dynamic text fields are visible. That
    would be perfect but I'm not sure how to do it.
    What would the script that I place on my button look like?
    What would the script in the first frame of the looping movie clip
    look like?

  • Dynamically adding multiple instances of a movie clip to the stage with one button

    hello,
    I was wondering if there was a way to add several instances
    of the same movie clip to the stage dynamically utilizing one
    button.
    I can do one with the following code placed on the button...
    on (release) {
    attachMovie ("filledCircle", "filled1", 5);
    filled1._x = 370;
    filled1._y = 225;
    But I want the user to be able to hit the button again and
    get yet another instance of "filledCircle" on the stage.
    I also want the user to be able to drag these instances
    around...
    Any help would be appreciated...
    Thanks,
    Muhl

    Muhl,
    > I was wondering if there was a way to add several
    > instances of the same movie clip to the stage
    > dynamically utilizing one button.
    Sure thing.
    > I can do one with the following code placed on the
    > button...
    >
    > on (release) {
    > attachMovie ("filledCircle", "filled1", 5);
    > filled1._x = 370;
    > filled1._y = 225;
    > }
    Gotcha.
    > But I want the user to be able to hit the button again
    > and get yet another instance of "filledCircle" on the
    > stage.
    You're in luck, because this isn't very hard to do. The main
    thing to
    keep in mind is that each instance must have A) its own
    unique instance name
    and B) its own unique depth. In your example, the instance
    name is filled1
    and the depth is 5. The next clip's instance name should be
    filled2 at a
    depth of 6. Then filled3, depth 7, and so on. You can use a
    single
    variable to handle the incrementation.
    // code in a frame
    var counter:Number = 1;
    // code on your button
    on (release) {
    attachMovie ("filledCircle", "filled" + counter, counter +
    4);
    With me so far? The variable counter contains the numeric
    value 1. The
    second parameter of attachMovie() is provided with a
    concatenation of
    "filled" + 1, which makes "filled1". The third parameter is
    provided with
    the sum of counter plus 4, which makes 5. Obviously, we need
    a bit more.
    The button must, in addition, increment the value of counter.
    The ++
    operator handles this perfectly.
    on (release) {
    attachMovie ("filledCircle", "filled" + counter, counter +
    4);
    counter++;
    Now, it seems you also want to position the attached movie
    clip to (370,
    225). Are they call supposed to go to the same place? If so,
    you may use a
    second variable to hold a reference to the newly attached
    clip. Look up
    MovieClip.attachMovie(), and you'll see that the method
    returns the exact
    reference you need.
    // code in a frame
    var counter:Number = 1;
    var mc:MovieClip;
    // code on your button
    on (release) {
    mc = attachMovie ("filledCircle", "filled" + counter,
    counter + 4);
    counter++;
    mc._x = 370;
    mc._y = 225;
    Make sense?
    > I also want the user to be able to drag these instances
    > around...
    Then you need to handle a few events. You're dealing with
    movie clips
    here, so your best bet is to study up on the MovieClip class,
    which defines
    all movie clips. (Note, also, that the TextField class
    defines all input
    and dynamic text fields; the Sound class defines all sounds,
    etc. This is a
    very handy arrangement of the ActionScript 2.0 Language
    Reference.)
    // code in a frame
    var counter:Number = 1;
    var mc:MovieClip;
    // code on your button
    on (release) {
    mc = attachMovie ("filledCircle", "filled" + counter,
    counter + 4);
    counter++;
    mc._x = 370;
    mc._y = 225;
    mc.onPress = function() {
    this.startDrag();
    mc.onRelease = function() {
    this.stopDrag();
    Easy as that. You're simply assigning a function literal to
    the event
    of each new MovieClip instance as you create it. Take a look
    and you'll see
    each of these class members available to you -- that is, to
    all movie clips.
    MovieClip.onPress, MovieClip.startDrag(), MovieClip._x, etc.
    Wherever it shows the term MovieClip in the Language
    Reference, just
    replace that with the instance name of your clip -- or a
    reference to that
    clip (which even includes the global "this" property).
    David
    stiller (at) quip (dot) net
    Dev essays:
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Dynamic  Instance for a MOVIE CLIP

    Hi Please help me!!!!!!!!!!
    I am creating dynamic Movie Clip using as3, but I don't have
    any idea about dynamic Instance name, please give me some idea that
    how I can assign Instance name for a movie clip.
    I am waiting your reply.
    Thanks
    Sushil Kumar

    You can assign a value to the name property of the MovieClip,
    but refering to the variable name of your MovieClip instance is
    preferable. This code illustrates the difference:

Maybe you are looking for

  • Bios update not engaging. computer stuck in bios update

    My computer HP Pavilion g2 notebook is stuck in hp bios update mode and although updated bios was downloaded it doesnt engage. At the very least how can i get it back to its original state of operation?

  • Finding my stolen iTouch

    So earlier this week my Ipod Touch was stolen from me, and I was wondering if there were any ways to find it. I did not have MobileMe, any GPS apps, and use Wifi only, but I did have TextNow, Facetime, and Runtastic Pro, and was not sure if any of th

  • Is it possible to give an action for TextFiled?

    hi.........Every one. Now i want to add action with TextField. just touch on TextField then go to SecondViewController 1 View Controller contain 1 TextField . then click on Textfield .... Display 2 ViewController. Please provide any information about

  • FlashPlayerPlugin 13 threads continually increase

    Hello everyone. Since upgrading to the latest version of Flash, I've been having troubles with Windows itself becoming stuttery and doing things like having my mouse cursor stop moving for a few seconds, and even moving the cursor over flash objects

  • Installing photoshop elements 10 mac os x

    Hello,  i have just changed some a Microsoft PC win7 to a Macbook pro running Mac os x.  I have logged into the adobe portal, installed the akamai netsession client for OSX and downloaded the software.  however what is downloaded is smaller .exe file