Motion tween using scripting

I have this working, which moves a picture of a horizon
starting at the left edge of my document and slowly moves off the
scene to the left. Question is, How can I tile the same picture
together where the left edge meets the right edge so it appears to
be a seamless ongoing horizon made up of just the one picture?
Any ideas?
thx
var endX = horizon._x + 70;
var stepX = (endX - horizon._x) / 50;
horizon.onEnterFrame = function ()
if (this._x < endX) this._x -= stepX;

Yes the picture is greater than the stage width and I
understand aligning the picture so it is seamless, but how do I
continually get it to loop to its original position so it always
repeats itself. It is a backgrd to an interactive piece that I want
to always keep in motion.
I hope I making this clear

Similar Messages

  • Motion tween using actionscript

    I'm pretty sure there has to be a way to do this. I want an
    object to move to certain coordinates when certain objects are
    moused over. Any help?

    Bryan,
    > Thank you so muck...honestly. I hate to ask for more
    help,
    > but i need to ask ONE more thing.
    's okay. :)
    > I got the movement working but the thing i need now is
    for
    > the puck to stay under the button when i mouse off.
    Well ... okay, I looked at your code. Honestly, bro, it's a
    complete
    hodge-podge of new and old style coding. I know it's because
    you're on
    unfamiliar territory, and I'm not slammin' ya ... but really
    -- really,
    really, really -- your life will be soooo much easier if you
    step back and
    look at the big picture. Sooner or later, this will all gel
    for you, and it
    suddenly becomes very easy.
    Forget that tellTarget() business. That's old; like, Flash 3
    old. In
    fact, it was deprecated in Flash 5. If you want to path to an
    object, you
    use its instance name. Of course, first, that means you need
    to give your
    relevant assets instance names. You've already done with with
    the revolving
    "police" lights -- but make sure you're consistent. Name them
    light1,
    light2, light3, and so on (yours were a bit dissheveled).
    An instance name is just a "handle" that lets ActionScript
    "talk" to a
    given object. That light exists as a single movie clip symbol
    in your
    Library, but you want to talk to each one individually, so
    each one gets its
    own instance name.
    Do the same thing with your "net" instance (the tab/button
    movie clips).
    Rather than this ...
    tellTarget(this._parent.light4) {
    gotoandplay(this._currentframe+70);
    ... just refer to objects by instance name.
    light1.gotoAndPlay();
    Much cleaner code. Now, this isn't relevant in your case,
    but if that
    "light" symbol had another movie clip inside it, you could
    give *that*
    symbol an instance name, too. For example, you might name the
    bulb "bulb".
    If you needed to instruct that bulb movie clip, you could
    react it inside
    each instance of light like this ...
    light1.bulb.gotoAndPlay();
    light2.bulb.gotoAndPlay();
    // etc.
    It's just like folders and subfolders on your hard drive.
    Next, you've GOT to make sure you use the correct case.
    gotoandplay
    doesn't exist in ActionScript, but gotoAndPlay does.
    Thankfully, the
    ActionScript 2.0 Language Reference is only a click away, and
    besides,
    script code changes color to indicate when you've spelled
    something
    correctly.
    Next, while it's perfectly legal to use the on() event
    handler, it's
    also pretty old. It was deprecated as of Flash MX (aka Flash
    6), so use the
    approach I showed you in previous posts. Just use the clip's
    instance name
    and assign a function to its event.
    You want those instances of "net" to respond to mouse
    events. I gave
    each movie clip an instance name ... mcHome, mcCalendar,
    mcRecord, and so
    on.
    This allows you to neatly put all your code into frame 1 of
    the main
    timeline. No more hunting and pecking, having to click on
    each movie clip
    separately, etc.
    mcHome.onRollOver = function() {
    // instructions here
    That also means you don't have to keep repeating the import
    statements
    for each button. It's just much cleaner and more efficient.
    Give yourself
    a Scripts layer dedicated to scripts only, and put all your
    code there.
    Just remove all the on() stuff.
    Now here's the part that should make a halogen bulb go BOOM
    in your
    head. I'll repeat what you were asking:
    > I got the movement working but the thing i need now is
    for
    > the puck to stay under the button when i mouse off.
    Okay. That means you want the puck not to start from its
    original
    position every time. (In your Tween instantiation, you were
    always starting
    from 66.3 -- which of course means that's where the puck will
    start from
    every time.) So, how are you going to know where the puck is?
    Well, the puck is a movie clip -- so look up the MovieClip
    class. The
    MovieClip class lists a bunch of properties, which refer to
    characteristics
    of the object at hand. In other words, the MovieClip class
    TELLS YOU what
    properties are available to any movie clip out there --
    because classes
    define objects, and this is a movie clip object.
    So if you need to know where the puck is horizontally, look
    up its
    MovieClip._x property. Badda bing.
    mcHome.onRollOver = function() {
    new Tween(puck, "_x", Elastic.easeOut, puck._x, 58, .5,
    true);
    light1.gotoAndPlay(2);
    That puts the current _x value of the puck instance as the
    fourth
    parameter of that Tween constructor. Make sense? Here's
    working code for
    your Flash banner ...
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    mcHome.onRollOver = function() {
    new Tween(puck, "_x", Elastic.easeOut, puck._x, 58, .5,
    true);
    light1.gotoAndPlay(2);
    mcHome.onRollOut = function() {
    light1.gotoAndPlay(this._currentframe + 70);
    mcHome.onRelease = function() {
    getURL("site.php?page=press&links=home");
    mcCalendar.onRollOver = function() {
    new Tween(puck, "_x", Elastic.easeOut, puck._x, 215, .5,
    true);
    light2.gotoAndPlay(2);
    mcCalendar.onRollOut = function() {
    light2.gotoAndPlay(this._currentframe + 70);
    mcCalendar.onRelease = function() {
    getURL("site.php?page=press&links=home");
    mcRecord.onRollOver = function() {
    new Tween(puck, "_x", Elastic.easeOut, puck._x, 373, .5,
    true);
    light3.gotoAndPlay(2);
    mcRecord.onRollOut = function() {
    light3.gotoAndPlay(this._currentframe + 70);
    mcRecord.onRelease = function() {
    getURL("site.php?page=press&links=home");
    mcTitans.onRollOver = function() {
    new Tween(puck, "_x", Elastic.easeOut, puck._x, 533, .5,
    true);
    light4.gotoAndPlay(2);
    mcTitans.onRollOut = function() {
    light4.gotoAndPlay(this._currentframe + 70);
    mcTitans.onRelease = function() {
    getURL("site.php?page=press&links=home");
    mcPressBox.onRollOver = function() {
    new Tween(puck, "_x", Elastic.easeOut, puck._x, 688, .5,
    true);
    light5.gotoAndPlay(2);
    mcPressBox.onRollOut = function() {
    light5.gotoAndPlay(this._currentframe + 70);
    mcPressBox.onRelease = function() {
    getURL("site.php?page=press&links=home");
    ... keeping in mind, of course, that each instance of the
    "net" movie clip
    needs the relevant instance name, and that each instance of
    the "light"
    movie clip should be named as shown from left to right. NO
    CODE exists as
    attached to any movie clips. It's all in frame 1 of a new
    layer named,
    arbitrarily, scripts. The correct case is in use --
    Elastic.easeOut, rather
    than elastic.easeOut (or easeIn, whatever you prefer). And
    make sure to
    correc the getURL() parameter as needed.
    > I owe you big time!
    If you really feel that way, I do have an Amazon Wish List.
    ;) Write
    me off line, if you're so inclined. I'll reply with your FLA.
    You're under
    NO obligation to buy me anything. I mean that. If the spirit
    moves you, I
    won't complain -- but write me so I know where to send you
    your FLA. I
    think seeing it will help you out.
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Motion tweens from keyframe vs properties panel

    When motion tweening a grouped object in either Flash 8 or
    Flash CS3, I get different results depending on whether I use the
    keyframe or the properties panel to set the tween.
    If I right-click the first keyframe and select "Create Motion
    Tween," I get two graphic symbols named Tween 1 and Tween 2 in the
    library .
    If I select Motion from the Tween drop-down list in the
    Properties panel, I do not get those two graphic symbols in the
    library.
    Question #1: Which is the better way to create motion tweens
    -- using the keyframe or using the properties panel?
    Question #2: What other differences are there between
    creating a motion tween (or shape tween in CS3) between using the
    keyframe or using the properties panel?
    Ken Elder
    Oklahoma City

    1) either is fine, however you should not try to tween
    multiple object at the same time, put them in a moveclip and tween
    the clip, or on separate layer and tween them individually. This is
    why the symbol shows up in the Library, because it's not quite the
    right way to do it, and Flash needs to make some things to try a
    keep it straight. The best way to tween is to use the Tween class
    and script the tween.
    2) no difference, they both fire the same method. Like using
    key shortcuts vs. the menu.

  • Motion Tween (CS4)  - please help

    I'm a student trying to finish (what should be) a pretty
    simple assignment. I'm creating a 30 second banner. From frame 1 to
    frame 90 (3 seconds), I have an image (movie clip) sliding in and
    "bouncing" into place with a motion tween (used the motion editor
    to get the "bounce in" ease effect on the tween). So, currently,
    after frame 90 there are no more frames on that layer; my image
    disappears.
    Now I want the symbol instance to stay in place for the next
    x frames, while stuff on other layers slides in on "top" of it. But
    if I go out to frame x, select it, and hit F5, F6, or F7, it makes
    the symbol stay in place over those frames like I want, BUT it
    screws up my motion tween. I lose the "bounce in" ease, for some
    reason. How can I get my motion tween to work like I want from
    frame 1 to frame 90, and then have the symbol instance stay put for
    the next x frames after that?
    Thanks!
    Christophe

    My instructor said just to go to the frame in the layer, go
    to frame x and select it, then do insert>timeline>frames. But
    that still screwed up my tween. The object slides into place, but
    the "bounce in" ease is no longer visible.
    I found this workaround - which doesn't seem very efficient,
    but it worked. My motion tween ends at frame 90:
    1) select frame 91, hit F7 to insert a blank keyframe.
    2) go to and select frame 90, select the object on the stage,
    copy it.
    3) go to and select frame 91, paste in place.
    4) Now go out to frame X, select it, and hit F5. Object now
    sits in place from frame 91 to frame X, and "bounce in" ease of the
    motion tween from frame 1 to frame 90 isn't affected.

  • Using Timewarp on motion tweened effects...

    I'm using Timewarp to adjust the speed of a layer that contains motion tweened effects (ie. particles). For some reason Timewarp is treating the layer as regular 29.97 fps footage and using it's vector blending to interpolate the footage (creating undesirable distortions).
    In the end, I plan on Timewarping a single pre-comped layer that contains many different effect layers (Particular, Optical Flares, Element, etc.)
    Is there a way to get Timewarp to just re-calculate and re-tween the motion instead of doing it's usual vector blending thing?
    -Pete

    Hey, thanks for the great suggestion. I never really used Time Remapping before so I tested it and it works great! It actually re-calculates tweened motion and does a decent job on regular footage that has pixel motion frame blending enabled.
    I guess since Timewarp is just a filter, it's limited.
    Thanks agan.
    -Pete

  • Using Motion Tween to create a moving timeline

    I'm just learning the software and haven't been able to figure this out.  I'm trying to create an historic timeline for our company and am using 20 jpg images, which I placed on separate layers and then converted each jpg to a symbol and motion tweened to go across the screen.  The problem is that there is a gap between the frames when they play as a movie and I don't know how to get rid of that so that they flow continuously across the screen from left to right seamlessly.  Can anyone provide me with some instruction on this?

    this may be time-consuming but should be easy.  start at the left-most keyframe that has an image.  i would think there's only one keyframe there that has an image so nothing needs to be done there.  go to the next keyframe.  there will be an image there and the previous image should still be on-stage (or you need to move that 2nd keyframe).  move that 2nd image so it abuts the first. go to the next keyframe etc.
    all your tweens should be the same number of frames, use the same easing and move the images the same number of pixels.

  • Add motion tween to my buttuns in flash??

    hi, i'm new in flash ,i make a simple buttun by these steps
    1- i prepare color photo and same in black and white
    2- i import my photo to stage - convert to buttun
    3- in over , down  i put the black and white photo - also write text
    4- when i run the movie it seems ok when mouse over it change color and text appear
    what i'm trying to to is when mouse over i want the photo to become bigger i try motion tween on over but i cant move the markers!!
    please help?? can i do it without action script btw i use flash portable8
    big thanks in advance

    i try your idea i make movie clip in over then i
    make tween it work thanks alot but is the way i do it right

  • Save motion tween as as3 in flash cc2014

    in previous flash i had the ability to save motion tween as as3 and use it an scripting.
    i can not find it in flash cc 2014
    how can i use motion preset as part of as3 scripting?

    i don't know why it was removed, but in general the adobe engineers had to decide which features from the 32bit flash pro (cs) should be added to the 64bit flash pro (cc).  and there were time-constraints so the more features carried-over, the long it would take to release cc.
    i don't know if it's better to use xml because i've never seen the need to use either feature, ever.  in fact, i don't use the flash timeline tweening and i don't use the flash tween class.  like many flash professionals, i use a 3rd party library from greensock, tweenlite (usually and lately tweenmax).
    and finally yes, cc subscribers can use flash pro cs6:  open your cc desktop app>click apps>filters&versions>previous versions>flash pro install>cs6.

  • Free Transform breaks Motion Tweens

    Sigh! Normally I try to solve problems myself... but Google isn't giving me anything about this so maybe I'm the only one in the world experiencing this particular issue.
    I've used Flash for making games for years now, and I got used to using the old motion tweens for making looping animations for characters. I made the leap from AS2 to AS3 a while ago, and felt like I should try to use these new motion tweens as well since I got CS5...
    I've found them completely unusable, however, due to a bizarre problem that happens when moving around objects using the Free Transform tool.
    For a single character, I'll have a MovieClip with several layers, each with a 'body part' MovieClip on it, then I add the new blue-type motion tweens to all of those layers. At the end of those tweens, I use F6 to (hopefully) duplicate the starting pose; it is meant to loop, after all. Then I'll go about half way between these two keyframes and move bits around to create the A->B->A sort of 'idle' or 'breathing' animation.
    The Free Transform seems dodgy though. If I select all the 'limbs' of a character at once and try to rotate them as a group, it works, but they each end up displaced a bit when I release the mouse; they get offset slightly or rotate a bit in seemingly random directions.
    For example, compare these two images (it's easiest if they're opened in separate tabs, I suppose): http://scraps.fighunter.com/sparkpupagh1.png and http://scraps.fighunter.com/sparkpupagh2.png
    The first one is after rotating it but before I released the mouse button, the second is what the pieces ended up like after I released the button. Most of the pieces ended up where they should be, but the head was offset slightly. This is a mild case; it's usually worse and affects all the pieces, and the slight offsets and rotations build up, too.
    This in itself wouldn't be too bad - though it's frustratingly inaccurate - but it gets much, much worse the more I work on a single animation.
    (Note: These strange changes don't happen if I rotate all the parts as a group if they're not also contained within new motion tweens...)
    Here's a screenshot showing a frame mid-way through an animation, with one of the parts selected: http://scraps.fighunter.com/meepagh1.png
    The Motion Editor is shown, though I don't use that directly.
    With that feather bit selected, I then rotated it a tiny, tiny amount, but didn't *move* it at all. When I released the mouse, it ended up snapping suddenly to here: http://scraps.fighunter.com/meepagh2.png
    That'd be frustrating in itself, but as you can see from the Motion Editor, it's also messed up most of the other frames in the animation, somehow. This becomes unbearable, as you can likely imagine!
    If I edit the graph in the Motion Editor directly to alter the Z value and cause a rotation, it works, without problems... but this is horribly inefficient and unintuitive and not a solution. I can't animate by tweaking numbers. It's like trying to draw a portrait using an Etch-A-Sketch!
    It seems to only be the Free Transform tool that creates this bizarre problem.
    This has been happening since I got CS5 maybe a year or two ago, though I haven't actually had to use the animation tools much until a few days ago so that's why I'm bringing it up now. I've restarted Flash, my computer, etc, etc, many times; I also got the trial version of CS6 today to see if THAT would fix it, but the exact same thing happens in that version too.
    I'm wondering whether it's my computer's fault in some way... I don't know enough about hardware and 'specs' and that sort of stuff to describe anything about it, but I'm using Windows Vista and the computer is fairly old and not exactly what I'd call reliable. I'm planning to get a new one soon, so it'd be nice if that fixed this problem... but frustrating if it doesn't.
    I'll link to the CS6-flavoured .fla that those screenshots are from: http://scraps.fighunter.com/Meep.fla
    I'd very much appreciate it if someone could test this to see if it's happening to only me! If I go to frame 146 (to choose one at random), and try to rotate the foot, slightly, using the Free Transform tool, it breaks in the way that I've described. (Oddly, the head feather rotates without issues on that frame...) If you were to try to do this same thing and it *doesn't* break, it might be a good sign that it's my computer's fault!
    If it *does* break though... then I'd very much appreciate any help I can get from someone who understands the new motion tweens better than I do!
    It'd be a shame to have to go back to Classic Tweens because of this...

    Sigh! Normally I try to solve problems myself... but Google isn't giving me anything about this so maybe I'm the only one in the world experiencing this particular issue.
    I've used Flash for making games for years now, and I got used to using the old motion tweens for making looping animations for characters. I made the leap from AS2 to AS3 a while ago, and felt like I should try to use these new motion tweens as well since I got CS5...
    I've found them completely unusable, however, due to a bizarre problem that happens when moving around objects using the Free Transform tool.
    For a single character, I'll have a MovieClip with several layers, each with a 'body part' MovieClip on it, then I add the new blue-type motion tweens to all of those layers. At the end of those tweens, I use F6 to (hopefully) duplicate the starting pose; it is meant to loop, after all. Then I'll go about half way between these two keyframes and move bits around to create the A->B->A sort of 'idle' or 'breathing' animation.
    The Free Transform seems dodgy though. If I select all the 'limbs' of a character at once and try to rotate them as a group, it works, but they each end up displaced a bit when I release the mouse; they get offset slightly or rotate a bit in seemingly random directions.
    For example, compare these two images (it's easiest if they're opened in separate tabs, I suppose): http://scraps.fighunter.com/sparkpupagh1.png and http://scraps.fighunter.com/sparkpupagh2.png
    The first one is after rotating it but before I released the mouse button, the second is what the pieces ended up like after I released the button. Most of the pieces ended up where they should be, but the head was offset slightly. This is a mild case; it's usually worse and affects all the pieces, and the slight offsets and rotations build up, too.
    This in itself wouldn't be too bad - though it's frustratingly inaccurate - but it gets much, much worse the more I work on a single animation.
    (Note: These strange changes don't happen if I rotate all the parts as a group if they're not also contained within new motion tweens...)
    Here's a screenshot showing a frame mid-way through an animation, with one of the parts selected: http://scraps.fighunter.com/meepagh1.png
    The Motion Editor is shown, though I don't use that directly.
    With that feather bit selected, I then rotated it a tiny, tiny amount, but didn't *move* it at all. When I released the mouse, it ended up snapping suddenly to here: http://scraps.fighunter.com/meepagh2.png
    That'd be frustrating in itself, but as you can see from the Motion Editor, it's also messed up most of the other frames in the animation, somehow. This becomes unbearable, as you can likely imagine!
    If I edit the graph in the Motion Editor directly to alter the Z value and cause a rotation, it works, without problems... but this is horribly inefficient and unintuitive and not a solution. I can't animate by tweaking numbers. It's like trying to draw a portrait using an Etch-A-Sketch!
    It seems to only be the Free Transform tool that creates this bizarre problem.
    This has been happening since I got CS5 maybe a year or two ago, though I haven't actually had to use the animation tools much until a few days ago so that's why I'm bringing it up now. I've restarted Flash, my computer, etc, etc, many times; I also got the trial version of CS6 today to see if THAT would fix it, but the exact same thing happens in that version too.
    I'm wondering whether it's my computer's fault in some way... I don't know enough about hardware and 'specs' and that sort of stuff to describe anything about it, but I'm using Windows Vista and the computer is fairly old and not exactly what I'd call reliable. I'm planning to get a new one soon, so it'd be nice if that fixed this problem... but frustrating if it doesn't.
    I'll link to the CS6-flavoured .fla that those screenshots are from: http://scraps.fighunter.com/Meep.fla
    I'd very much appreciate it if someone could test this to see if it's happening to only me! If I go to frame 146 (to choose one at random), and try to rotate the foot, slightly, using the Free Transform tool, it breaks in the way that I've described. (Oddly, the head feather rotates without issues on that frame...) If you were to try to do this same thing and it *doesn't* break, it might be a good sign that it's my computer's fault!
    If it *does* break though... then I'd very much appreciate any help I can get from someone who understands the new motion tweens better than I do!
    It'd be a shame to have to go back to Classic Tweens because of this...

  • Poor quality motion tween with png image, tried "Trace Bitmap", but then it looks like a newspaper

    Greetings all,
    I've been a software developer for many years, but am not very savy in the design elements.  So, much of what I'm going to say will probably sound "newbie", so please forgive me in advance.
    So, I'm trying to get a transparent image to fly in from the side.  So, I *thought* I was doing the correct thing by moving the "symbol" off of the visible portion of the stage, and creating a motion tween to move it onto the stage.  The motion works, but the quality of the image in general (and the text in specific) looks pixelated.
    Thus, I did a little bit of snooping, and everyone said that you should start with a bitmap.  So I saved the image from Photoshop into .bmp format, and was able to set the properties to "allow smoothing" and with lossless compression.  So far, so good.  Now, as I expected, the transparency is no longer there... 
    So here's the question:  how can I make this image retain its quality, still have transparency, and a motion tween?
    It seems like this is some set of characteristics that don't play well together, even though I see this type of thing online ALL the time.
    I tried "Trace Bitmap" to convert to a raster image, and tried to follow some suggestions online, but when I do "Trace Bitmap", it ends up looking like it has a bunch of grayish dots on the image... definitely NOT what I was expecting.
    Thanks for your help!
    JPB

    Go back to using the png, and set the smoothing allowance. That should take care of the quality.  In Flash, a "bitmap" will often refer to any type of image element... .bmp's are probably dinosaurs (as in extinct) where Flash usage is concerned.

  • How do i start a motion tween by clicking a button and stop it at the end of the tween.

    Hi guys,
    I am creating a website for a project and i am trying to activate a box bropping down from another box when i click on the enter here button i have created. I have set the motion tween and its working when i preview i just unsure of the correct actionscript to start this tween when i have clicked the entere here button or how to stop it at the end of the tween.
    I am scared i may have made the layers in the wrong place, they are all currently in scene 1. does my second box that is dropping down need to be set inside the layers of the first box?
    Bit of a newbie at this.
    Thanks in advance!

    Create the dropping box movieclip as an animation by itself with a stop() coomand in the first frame and a stop() command in the last frame.  The click of the button should tell the movieclip to play(); at which point the animation should play and stop at the end.
    Another option would be to use an actionscript Tween to make the box drop.  Going that route the animation is what you code it to be and there is no need to have to stop it as it will end where you tell the Tween to end at.

  • Motion Tween w/ Rotation Dropping on the Y Axis

    Is there a way to prevent a motion tween w/ rotation from dropping on the Y axis? Basically I used Free Transform to change the angle of a line, but it always lowers itself on the Y axis when I insert a motion tween in it.

    Hey there,
    The properties shouldn't be changing when you insert a motion tween. Could you either attach a file with the object *before* you create the tween, or let me know all the properties of the object before you insert the tween so I can try and reproduce internaly?  (X, Y, rotation, scale X/Y, skew X/Y).
    Thanks!
    Jen.

  • Motion Tweens in AS3

    I'm trying to make a screen object(digitB1_mc) move in one of two different directions, depending upon the current cicumstances.
    I drew the Motion Tween _B1_12 and saved it as a preset for the first direction.
    I drew the Motion Tween _B1_21 and saved it as a preset for the second direction.
    Then I tried to find AS3 code to grab one of these two from the presets and apply it to digitB1_mc. Could not find a way to do it.
    Then I copied _B1_12 to Actionscript 3.0 code (ie. clipboard) and pasted it into an Actionscript 3.0 function B1_12 and got:
    function B1_12() {
    import fl.motion.AnimatorFactory;
    import fl.motion.MotionBase;
    import fl.motion.Motion;
    import flash.filters.*;
    import flash.geom.Point;
    var __motion_digitB1_mc:MotionBase;
    if(__motion_digitB1_mc == null) {
        __motion_digitB1_mc = new Motion();
        __motion_digitB1_mc.duration = 11;
        // Call overrideTargetTransform to prevent the scale, skew,
        // or rotation values from being made relative to the target
        // object's original transform.
        // __motion_digitB1_mc.overrideTargetTransform();
        // The following calls to addPropertyArray assign data values
        // for each tweened property. There is one value in the Array
        // for every frame in the tween, or fewer if the last value
        // remains the same for the rest of the frames.
        __motion_digitB1_mc.addPropertyArray("x", [0,7.4116,14.0277,19.6419,23.9742,26.6463,27.1809,25.0619,19.91,11.7411,1]);
        __motion_digitB1_mc.addPropertyArray("y", [0,-14.8969,-30.1606,-45.8179,-61.8789,-78.2953,-94.9161,-111.395,-127.195,-141.658,-154. 35]);
        __motion_digitB1_mc.addPropertyArray("scaleX", [1.000000]);
        __motion_digitB1_mc.addPropertyArray("scaleY", [1.000000]);
        __motion_digitB1_mc.addPropertyArray("skewX", [0]);
        __motion_digitB1_mc.addPropertyArray("skewY", [0]);
        __motion_digitB1_mc.addPropertyArray("rotationConcat", [0,36,72,108,144,180,216,252,288,324,360]);
        __motion_digitB1_mc.addPropertyArray("blendMode", ["normal"]);
        __motion_digitB1_mc.addPropertyArray("cacheAsBitmap", [false]);
        // Create an AnimatorFactory instance, which will manage
        // targets for its corresponding Motion.
        var __animFactory_digitB1_mc:AnimatorFactory = new AnimatorFactory(__motion_digitB1_mc);
        __animFactory_digitB1_mc.transformationPoint = new Point(0.500000, 0.500000);
        // Call the addTarget function on the AnimatorFactory
        // instance to target a DisplayObject with this Motion.
        // The second parameter is the number of times the animation
        // will play - the default value of 0 means it will loop.
        // __animFactory_digitB1_mc.addTarget(<instance name goes here>, 0);
    But when I called this function it did nothing at all except increase my swf file size from 3.8 kb to 27.3 kb.
    Can anyone suggest a solution that would allow me to swap back and forth between two motions for an object.
    Thanks,

    The culprit is most likely the garbage collector. If you do
    not have any references to your tween object, it will eventually be
    destroyed by the garbage collector.
    From
    Adobe
    Flash Quick Start
    quote:
    Note: Consider variable scope when using the Tween class. If
    a tween is created in a function, it is important that the
    variable's scope exists beyond the function itself. If a tween is
    stored to a variable of local scope, ActionScript garbage
    collection removes the tween as the function completes, which will
    likely be before the tween has even begun.

  • Moving multiple symbols "breaks" motion tweens

    I'm working on a character rotation in Flash CS 5.5 that leads into a basic walk cycle using all motion tweens. The tutorial I'm following (which only uses classic tweens) says to grab all the upper body symbols with free transform and rotate them forward a little. This works fine with classic tweens, but with motion tweens, the parts pop strangely out of place and the more frames I try to move the upper body symbols on, the worse the symbols start randomly sliding around. You can see a simple before/after example posted below. Moving the profile view upper body symbols displaces the arms on the first frame.
    Is there any way to move multiple symbols without ruining them? Someone else described at length a problem like this on an old thread, but no one answered: http://forums.adobe.com/thread/1084800
    I've tried taking all the upper body layers and sticking them in a symbol, but that won't work because the left hand will pass over the left leg instead of under due to layering.
    EDIT - Whatever change is made to the arms during the walk  changes the key frames at the beginning, but only if selected with other symbols. If I move the upper body parts down instead of rotating them, the first frame arms will be retroactively be moved down.
    Message was edited by: LastNameLeft3000

    If you are interested in getting decent results at some point youwill have to looke into the Bone-Tool or use a extension like DragonBones
    The reason why you are having "Displacement"-problems lies in the "Math" behind how AnimatorFactory (the system behind Motion Tweens) handles transformations different from Tweens (Its outright misleading to call them Tweens, and Adobe did a poor naming job).
    Right click one of the Motion tweens and chosy "copy as Actionscript 3.0" from the context menu then paste the code in any available textEditor and you will see sth like:
    import fl.motion.AnimatorFactory;
    import fl.motion.MotionBase;
    import fl.motion.Motion;
    import flash.filters.*;
    import flash.geom.Point;
    var __motion_Symbol1_9:MotionBase;
    if(__motion_Symbol1_9 == null) {
        __motion_Symbol1_9 = new Motion();
        __motion_Symbol1_9.duration = 24;
        // Call overrideTargetTransform to prevent the scale, skew,
        // or rotation values from being made relative to the target
        // object's original transform.
        // __motion_Symbol1_9.overrideTargetTransform();
        // The following calls to addPropertyArray assign data values
        // for each tweened property. There is one value in the Array
        // for every frame in the tween, or fewer if the last value
        // remains the same for the rest of the frames.
        __motion_Symbol1_9.addPropertyArray("x", [0]);
        __motion_Symbol1_9.addPropertyArray("y", [0]);
        __motion_Symbol1_9.addPropertyArray("scaleX", [1.000000]);
        __motion_Symbol1_9.addPropertyArray("scaleY", [1.000000]);
        __motion_Symbol1_9.addPropertyArray("skewX", [0]);
        __motion_Symbol1_9.addPropertyArray("skewY", [0]);
        __motion_Symbol1_9.addPropertyArray("rotationConcat", [0,3.91304,7.82609,11.7391,15.6522,19.5652,23.4783,27.3913,31.3043,35.2174,39.1304,43.043 5,46.9565,50.8696,54.7826,58.6957,62.6087,66.5217,70.4348,74.3478,78.2609,82.1739,86.087,9 0]);
        __motion_Symbol1_9.addPropertyArray("blendMode", ["normal"]);
        __motion_Symbol1_9.addPropertyArray("cacheAsBitmap", [false]);
        __motion_Symbol1_9.addPropertyArray("opaqueBackground", [null]);
        __motion_Symbol1_9.addPropertyArray("visible", [true]);
        // Create an AnimatorFactory instance, which will manage
        // targets for its corresponding Motion.
        var __animFactory_Symbol1_9:AnimatorFactory = new AnimatorFactory(__motion_Symbol1_9);
        __animFactory_Symbol1_9.transformationPoint = new Point(0.499943, 0.500000);
        // Call the addTarget function on the AnimatorFactory
        // instance to target a DisplayObject with this Motion.
        // The second parameter is the number of times the animation
        // will play - the default value of 0 means it will loop.
        // __animFactory_Symbol1_9.addTarget(<instance name goes here>, 0);
        // Call the addTarget function on the AnimatorFactory
        // instance to target a DisplayObject with this Motion.
        // The second parameter is the number of times the animation
        // will play - the default value of 0 means it will loop.
        // __animFactory_Symbol1_9.addTarget(<instance name goes here>, 0);
    This is only the code for simply rotating a rectangle over the duration of 24 frames.
    You notice 2 two problems right away: while having the registration point in the center, Flash distorts the values:
        __animFactory_Symbol1_9.transformationPoint = new Point(0.499943, 0.500000); //should be (0.5, 0.5)
    you can imagine that this "error" gets worse when inherited from nested symbol to nested symbol, it "exponentially" grows with each nesting, and it will soon reach a point were it gets visible.

  • Motion tween- arrows not appearing, tween not working! please help?

    I select where I want my motion tween to be, ctrl-click and select 'create motion tween'. It appears blue, and does not come up with an error message but no arrows appear like in the video's and the motion tween has not worked. Any ideas why? Also, I opened up a file that already had a motion tween in it (made by somebody else) to test it. I selected the motion tween and clicked 'remove tween' and straight away clicked 'create motion tween' again- to put exactly the same motion back into it, but the same thing happens- the selected area appears blue but no motion tween. Then, if I select it again, the option is 'remove motion' not 'remove tween' as before. A little complicated and could really use some help! Thanks!

    Thanks very much for the help. Classic tween has worked, the arrows have appeared and the figure moves but the shapes do not move around their anchor points and go all over the place before suddenly appearin in the right position on the very last frame.This is a screenshot of what i see on the second to last frame:
    And this is the last frame:
    I made sure all the anchor points were in the right place beforehand, any ideas why the shapes wont move right?
    Thanks.

Maybe you are looking for

  • CD/DVD R discs won't play in Sony DVD player system.

    I have just backed up my music and photos on CD R and DVD R discs on my new Macbook Pro. None will play on my Sony player. I previously purchased CD RW from Verbatim recorded on my Powerbook G4 and they play fine. I know there is technology change he

  • Can a Didital output task be used to read a line

    I have a digital output task, but I would like to be able to read the value of the line as well (to save me having to store the last value I wrote to it). I have tried, and it appears to work fine, but I can't find any hint that it is supported in th

  • CO document not created while billing

    Hi, When a sales document is released to accounting, the controlling document is not being generated. The following documents are being generated. Accounting document Profitability Analysis document Special purpose ledger document. Could you please h

  • Connect to Secure web service with certificate from SAP EP

    Hi Experts, Here is the current situation: 1. Our business requirement is to connect 3rd party RESTful web service which requires secure connection with private client certificate attached 2. I've tested in my Java test application and successfully a

  • Best method for scrollable list of objects

    I was attempting to create a list of objects in a scrollable pane with the ScrollPane object. I am having a very hard time customizing what is actually scrolling in that pane, though. By using a custom renderer class, I am able to change what it look