Tween current position after the previous tween movieclip

I hope someone can give me a hand with a little script I'm trying to drag a movieclip on the stage.   The clip is five times the width of the stage and I am using the Tween class to move on the stage when a key is pressed.   The interaction I want, it's that when the button is pressed the clip moves to a certain amount.   If the key again it moves further.  The script I came up with good that resuming the movieclip in the original position of the movieclip and then moving, as opposed to the displacement of the position, he has reached after clicked on the first button.

I've tried a few things but nothing works.  The script I use now is:

var myTween:Tween = new Tween (clouds1_mc, "x", Strong.easeOut, x-400, 5, true);

myTween.stop ();

I hope someone can help.

What your button code looks like - it was just myTween.start ()?-that would be a reason for him to do the same thing again and again.  Your button must include all of the Tween code so that a Tween is again created with new starting points and end every time.

Tags: Adobe Animate

Similar Questions

  • How to get the current position from the point of view

    can I know how to get the current position of the view?

    Edited by: anIdiot July 27, 2011 22:01

    1 - get belvedere of the universe:

    u = new SimpleUniverse (canvas3D);
    ViewPlat = u.getViewingPlatform (); view of the universe

    definition viewplat: ViewingPlatform ViewPlat;

    2 - get look a transform of the platform in an existing Transform3D

    ViewPlat.getViewPlatformTransform () .getTransform (t3d).

    3 - Look at the trandform: t3d.get (Quater1, vector1); orientation object Get and coords

    Kind regards.
    JFP

  • Flex TextInput to get the current position of the cursor

    TextInput component in how to get the current position of the cursor? Because I want to record a loss of focus on the location of TextInput dynamically add text.

    Here:RichEditableText is a part of the skin of the class spark TextInput and is what is doing all the text in the editing/rendering of work. If you need to make all text advanced operations, they need to go through the property here. Because it is a part of the skin, you need to make sure that is not null before doing anything on this subject.

    Fixed typo: it is the property here is, not textInput

  • How to take the new start of table in the same position as the previous and only randomize the newObjec

    So I'm trying to do 5 boxes/ships (3Blue and 2 Greens) appear in a random position (1-Gree, 2nd - blue, blue-3rd, 4th-green, green-5 or some other random way) I have the corner of the stage. Bring down. Make a new 5 boxes and position them on the same position the previous 5 and only get randomized (not with the 5 previous, it does at the moment). And that then they move down.  so far code I have is:

    import flash.events.Event;

    var shipCount:Number;

    var shipCount2:Number;

    var shipArray:Array = new Array();

    var shipArrayPosition:Array = new Array();

    var count: int = 0

    var positionsX:Array = ["50" "100", "150", "200", "250"]

    addEventListener (Event.ENTER_FRAME, everyFrame)

    function everyFrame(ev:Event):void {}

    counter ++

    If (counter % 70 == 0) {}

    doShips()

    }

    positionShips()

    trace (shipArray.length)

    }

    function doShips() {}

    shipCount = 3;

    shipCount2 = 2;

    var distance = 10;

    for (var i: int = 0; i < shipCount; i ++) {}

    var s = new ship;

    shipArray.push (s);

    s.x = s.width/2 + (s.width* i) + gap * I

    addChild (s)

    shipArrayPosition.push (s);

    }

    for (var j: int = 0; j < shipCount2; j ++) {}

    s = new Ship2.

    shipArray.push (s);

    }

    var array: Array = new Array();

    While (shipArray.length > 0) {}

    var: index: uint = Math.floor (Math.random () * shipArray.length);

    Array.push (shipArray [index]);

    shipArray.splice (index 1);

    }

    shipArray = array;

    shipsArray has been randomized

    for (var k: int = shipArray.length - 1; k > = 0; k-) {}

    shipArray [k] .x = positionsX [k]

    addChild (shipArray [k])

    }

    }

    function positionShips() {}

    for (var i: int = shipArray.length - 1; i > = 0; i--) {}

    shipArray [i] .moveDown (//what) code in the class of the ship and Ship2-> only: this.y += 3

    }

    }

    and how to stay in one position. Must not move in any position x when the 5 new are added

    It is even more effective, because it removes the ships that moved out of sight:

    import flash.display.MovieClip;
    import flash.display.Sprite;
    import flash.events.Event;
    
    var numShips:int = 5;
    var shipCount:int = 3;
    var shipArray:Vector. = new Vector.();
    var counter:int = 0
    var positionsX:Array = [];
    
    init();
    
    function init():void
    {
              // populate positions
              for (var i:int = numShips - 1; i >= 0; i--)
                        positionsX.push(50 * i);
    
              addEventListener(Event.ENTER_FRAME, everyFrame);
    }
    
    function everyFrame(e:Event):void
    {
              counter++
              if (counter % 70 == 0)
                        doShips();
              positionShips();
              trace(shipArray.length);
    }
    
    function doShips():void
    {
              var gap = 10;
              var s:MovieClip;
              var shipsLine:Sprite = new Sprite();
              shipsLine.cacheAsBitmap = true;
              addChild(shipsLine);
              shipArray.push(shipsLine);
              shuffle(positionsX);
              for (var i:int = numShips - 1; i >= 0; i--)
              {
                        s = i < shipCount ? new Ship() : new Ship2();
                        s.x = positionsX[i] + gap;
                        shipsLine.addChild(s);
              }
              shipsLine.y = -shipsLine.height;
    }
    
    function shuffle(a:Array):void
    {
              for (var i:int = a.length - 1; i >= 0; i--)
              {
                        var r:int = Math.floor(Math.random() * (i + 1));
                        var t:Object = a[r];
                        a[r] = a[i];
                        a[i] = t;
              }
    }
    
    function positionShips():void
    {
              for each (var shipLine:Sprite in shipArray)
              {
                        shipLine.y += 3;
                        // remove line that moved out of stage
                        if (shipLine.y > stage.stageHeight + shipLine.height)
                        {
                                  removeChild(shipLine);
                                  shipArray.splice(shipArray.indexOf(shipLine), 1);
                        }
              }
    }
    
  • Is it possible to read the voltage/current SMU after the closure of the original session?

    What is the method, or is it still possible reading the voltage and current of an SMU SMU-4138 measurements after the original configuration session has been closed?  I have a (relatively) long Teststand sequence that sets up the EMS to provide power to the ESA, then conducts tests and along the way I have to take the readings of SMU.  I was always under the impression, it is advisable to open and close the EMS quickly set up, but the 3-State programming model does not allow a way to jump into the running state of Init with channels VI, except through committed and engaged States and thus any stop in the process. The power measurement VI only works if you are in the Running State. Seems like a no-brainer, so what Miss me?

    bholsinger wrote:

    I was always under the impression, that it is recommended to open and close the EMS quickly set up

    It's BAD advice.  You open at the beginning of your program, you do whatever it takes with it inside your test (configure, read, etc.) program and you don't log off not until you stop your program.

  • 3D layers change position after the rendered movie

    Hello, please help.

    I created a composition that RAM previews fine in AE (CS5), but when I make them in a quick time video 3D layers only in the change of the composition.

    The 3D layers fail to change positions after making. They are opacity, horizontal position and scaling on X and Y axis all behave as they should, but after the movie of rendering, 3D layers remain static on the Z axis - as the camera does not zoom in and out?

    Total transformation on the 3D layers work well, it's just that the zoom in and out, which does not work after that is the position of the 3D layer changes after rendering. Please see the screenshots illustrating the problem.

    The first 4 images are EI when the 3D look good layers. They show the progression of animation, and the layer 3D, zoom in and out.

    3 final images are of the movie exported in QuickTime player, after I made the film. The section of the animation where the 3D layer fails to zoom in and out, and the layer 3D remains static on the axis z. (see chronology to decipher the logical order of the images)

    Here you can compare the two sets of images to be observed the error after having made.

    Forgive any unprofessional AfterEffects terminology, this is my first post!

    Kind regards.

    Screen shot 2011-09-07 at 15.54.19.png

    Screen shot 2011-09-07 at 15.54.26.png

    Screen shot 2011-09-07 at 15.54.35.pngScreen shot 2011-09-07 at 15.54.44.pngScreen shot 2011-09-07 at 15.55.14.pngScreen shot 2011-09-07 at 15.55.25.pngScreen shot 2011-09-07 at 15.55.39.png

    Don't forget that you're seen using the Active Caméra view. It is what will be rendered for final output. I can see your screenshots are you preview through the view camera 1.

  • How to refresh the current page after the return of a contextual dialog box?

    Hello

    In jdev 11.2.3,

    In a jsff page, I have a commandbutton control to start a dialog popup and actionListener like this:

    < af:commandButton text = "Select Bills" id = "cb1" actionListener = "#{newReceiptBean.refreshBillPending}" >

    < af:showPopupBehavior popupId = "p1" / >

    < / af:commandButton >

    or

    < af:commandButton text = "Select Bills" id = "cb1" actionListener = "#{newReceiptBean.refreshBillPending} '"

    action = "#{newReceiptBean.refreshBillPending}" >

    < af:showPopupBehavior popupId = "p1" / >

    But the 'newReceiptBean.refreshBillPending' method can be run even if it can be executed by another button like this:

    < af:commandButton text = "ExecuteWithParams."

    Disabled = "#{!}" bindings. ExecuteWithParams.enabled}"id ="cb3 ".

    action = "#{newReceiptBean.refreshBillPending}" / >

    How to run a bean method, after the return of a pupup dialog box?

    Thank you!

    Post edited by: BAO. SZ It seems after setting showPopupBehvior for the button, 'action', and "actionListener" cannot be performed more. Can someone give any help? Thank you.

    I'm not sure that clearly understand your requirment. But have you all ok or cancel button in your popup?

    Well, you can use diaglogListener in your popup if you use dialog.in your dialoglistener runs your bean method.

    see this example

    Handling Ok and the button cancel in af:dialog to context-sensitive help in Oracle ADF by dialogListener | Techartifact

  • Calculation of current date or the previous months

    Script gurus of wishes!

    I would like to ask help on calculating Date.

    Here's my current scenario:

    The user enters a date mm/dd/yyyy ("DateField")

    Power here ask the 'DateField' to calculate these items:

    Less "DateField" 12 months = ("12MonthsAgoDateField") / mm/yyyy

    'DateField' 18 months = ("18MonthsAgoDateField") / mm/yyyy

    'DateField' less than 36 months = ("36MonthsAgoDateField") / mm/yyyy

    and so on...

    I read some posts Date of calculation, but could barely find anything that fit this scenario.

    Freely, I confess that my ability to script is very minor.

    I would appreciate help in this script.

    Thank you!

    If you really want to go into the details (or not the time to do)

    Here is the simple solution to your problem.

    I wrote a small function (a few lines)

    Put this in the document level javascript

    Function level javascript document-

    function getPastDate (textFieldName, month) {}

    var util.printd = cDate ("dd/mm/yyyy", new Date (this.getField ("textFieldName") .value));

    sDate var = util.scand ("mm/dd/yyyy", cDate);

    If (sDate == null) {}

    App.Alert ("Please enter a valid date in the form \"mm/dd/yyyy\". »)

    } else {}

    update var = new Date (sDate.getFullYear (), (sDate.getMonth () + months), sDate.getDate ());

    Return util.printd("mm/yyyy",pDate);

    }

    }

    Now suppose that we have a text box name "Text1" including the date in the format "mm/dd/yyyy".

    1st parameter is for the name text box (seen the date that you want to process)

    2nd parameter is the number of months (to subtract pass a negative value)

    If you want to get the result in another area of text "Text2" write the following code in the event to calculate Text2

    Event.Value = getPastDate ("Text1",-12);

    This removes 12 month value "Text1".

    Hope this will help

  • Change event - why is does not select the current value, just the previous value?

    Hello.

    I use the script when the user selects a value from the drop box, something visible text (using the ' presence')

    I use the change of the event, but it does not work very well. When I select a value, it does not change the text, but if I select another value, it will display the previous selected value.

    Why did he not synchronize the value?

    Thank you!!

    Hi Rafael,.

    I don't know if you are using an event well.

    mouseExit is something good to use (especially when paired with the mouseEnter), during the change of the visual appearance of an object. For example, a button where the legend is underlined on mouseEnter and not highlighted on mouseExit.

    If you want to change the presence of objects on the form that the flat user above the list drop-down, then mouseEnter/mouseExit should work. However, if you want the changes occur once the user selects an item in the drop-down list, I recommend the exit event.

    Here are some examples:

    https://Acrobat.com/#d=txGF4IAoqmfTKPrLkwybIA

    https://Acrobat.com/#d=OzNofi-xFxmpXD1MrVU6rA

    https://Acrobat.com/#d=Hi0ZwVgVB1PWbxc6OJ0z4A

    Hope these helps,

    Niall

    Ensure the dynamics

  • Why I get the following message appears everytime I open Firefox? It occurred after the previous update and continues to occur with the current version. [TypeError: Components.classes['@softage.ru/skype/SkypeFfExtension;1'] is undefined

    [TypeError: Components.classes['@softage.ru/skype/SkypeFfExtension;1'] is undefined
    This happens everytime I open Firefox

    Turn it off until you can find an update for this add-on.

  • Windows 8 doesn't remember size and position of the previously open programs

    I hope that if there is no solution for this problem, at least it can be taken as feedback on the next update of WIndows 8.

    The question is:

    I use Windows 7 and WIndows 8 at home to work.

    Now, Windows 7 remembers the size and position of all my previously opened programs (I mean by "programs": EXCEL, INTERNET EXPLORER, FILES, WINDOWS MAIL, WORD, POWERPOINT and others), so that when opens again, they open in the same place and size that they were finally on the closure.

    So I can arrange some programs to occupy some space on the desktop, and each time that I open them they will open in the same place.

    However, WIndows 8 does NOT. When you use the desktop computer in Windows 8 even after organizing the progams to where I like them every time, the next time I open them they will NOT open in the same place or size.

    Or sometimes it does, but only once, but then not do the next time.

    In any case, it is so NOT intuitive and it is a huge concern to be their resizing each time.

    Anyone know WHY? and more importantly if there is a solution? or, where and how can I let Microsoft have this feedback so that the Windows 8.1 update can include a fix for this?

    Additional data:

    System: Windows 8 64-bit (w/Panel touchscreen desktop PC)
    I use my taskbar on the top of the screen in my Windows 7 and Windows 8 PCs.

    Thank you!!

    Hello

    Resize the window of Windows Explorer how you want and then close.

    Next time, when you open the Windows Explorer window, you should remember that the windows of size when it was closed the last time.

    If this isn't the case, then this problem occurs because the registry to the folder options settings are incorrect.

    Note: Serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs.

    (a) delete the following registry subkeys:

    o HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Bags

    o HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\BagMRU

    o HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\Bags

    o HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\BagMRU

    o HKEY_CURRENT_USER Settings\Software\Microsoft\Windows\Shell\BagMRU

    o HKEY_CURRENT_USER Settings\Software\Microsoft\Windows\Shell\Bags

    D
    elete the following registry subkeys:

    o HKEY_CURRENT_USER\Software\Classes\Wow6432Node\Local Settings\Software\Microsoft\Windows\Shell\Bags

    o HKEY_CURRENT_USER\Software\Classes\Wow6432Node\Local Settings\Software\Microsoft\Windows\Shell\BagMRU

    (b) Re-create the following registry subkeys:

    o HKEY_CURRENT_USER Settings\Software\Microsoft\Windows\Shell\BagMRU

    o HKEY_CURRENT_USER Settings\Software\Microsoft\Windows\Shell\Bags

    Re-create the following registry subkeys:

    o HKEY_CURRENT_USER\Software\Classes\Wow6432Node\Local Settings\Software\Microsoft\Windows\Shell\Bags

    o HKEY_CURRENT_USER\Software\Classes\Wow6432Node\Local Settings\Software\Microsoft\Windows\Shell\BagMRU

    (c) create and then set the registry BagMRU Size value to 5000 in the registry subkeys you created in step b.

    Please post with the State of the question.

  • Sound preview audio stream starts beginning rather than at the current position in the timeline

    I have an audio stream which I'm doing an animation. After working for a while, especially later in the video (like 2 minutes or more). audio will not play at the position, I'm in the workspace and rather play early instead. It is therefore impossible to work efficiently synchronize audio animation.

    I tried with several computers and sound cards, and I get the same behavior.

    What is going on? Is this a known bug?

    Yes, it is a known problem in Windows. I have reason to believe that it will be corrected in the next update to Flash Pro. Don't know when this will be.

  • My current position on the map is off by a few blocks

    I always use the Maps app on my iPhone 6 to obtain places just like a normal person. Then, I noticed that my 'current location' was not there where I am. It was almost half a mile away! Does anyone know how to fix this?

    You have turned on Wi - Fi? Location services may be affected by a number of things, including the fact that a Wi - Fi connection must be switched on. The iPhone uses GPS, cell location location and location information with band wifi. Sometimes, if changes have been made to the local Wi - Fi networks, it can lead to some issues. Have you tried standing outdoors with a good view of the sky and try to check your location? That could make things.

  • Outlook express missing current emails after the compression

    After checking my emails this morning, Outlook express asked me to compress the files. I did it and now I can't see all my Inbox emails that have come since March 23 to today (May 26).  all my messages are there, and all my emails before March 23 are there... but nothing of all the most recent. How can I restore these?

    Just to add to the comments of Bruce.  The first thing to do is to check the Recycle Bin for the bak files are backups of dbx files you want to restore, as appropriate.  See www.oehelp.com/OETips.aspx#2 don't restore the file with the same name, but give it a different name, so it does not replace what is already existing.

    If there is no file bak or bak files do not contain messages, so your only chance of recovery is my DBXpress program (www.oehelp.com/DBXpress/).  While it will pull messages from dbx files, its likely that your Inbox contains more messages which have been lost (the space they were in fills with zeros very often), so you should probably run the extraction of the disk set.  This will bypass the file system and to analyze all the clusters on the drive, and if the messages still exist on the disk, it will recover them.  Its the only program which has this ability and at this stage, its likely, the only thing that will retrieve messages.

    In the future, make sure that you back up your messages frequently, as happens all the time.

    Steve

  • Set the current position of the scrolling screen?

    Hello

    My current screen is dropdown - is there a way to specify what 'part' of this screen with scrolling should be visible? Therefore, my users are not automatically scroll...

    Thank you!

    You can call Field.setFocus () on a specific field, the UI must auto scroll to it.

Maybe you are looking for