Shape Tweening via ActionScript?

Hey all,
I am trying to create a tweening using ActionScript between
two vector graphic shapes.
The application is very simple: I have frames with different
shapes (frame 1: circle; frame 2: square; frame 3: triangle and so
on). I have an edit box in which the user can select two frames. I
want to automatically create a tweening between those shapes and
display it to the user.
From what I saw, the Tween Class can affect only size,
location, alpha, etc. There is no option to define two objects (or
for that matter two frames) and let the Action Script interpolate
between them... is that so? Does anyone have creative suggestions
for solving this problem?

yes, it's true that you cannot shape tween using actionscript
alone. you could use a combination of actionscript and timeline
tweening and that would probably be the easiest for the situation
you're describing.
you could utilize the drawing methods and sequentially draw
the shapes that you want but that would be more involved that
combining actionscript of timeline tweening.

Similar Messages

  • Ghosting occurs in shape tweens in clips with scale9Grid active.

    Why does ghosting occur in shape tweens?  Is this some kind of rendering bug?  I seem to keep running into stuff like this
    (sorry, first post had image that was not cropped properly by MSPaint and had tons of white space; I fixed it)
    --Background (feel free to skip if TL;DR): My SkinnedButton class supports states for DEFAULT, ROLLOUT, ROLLOVER, PRESS, RELEASE, RELEASEOUTSIDE, TRACKOVER, TRACKOUT, DRAGOVER, DRAGOUT, DRAGDROP, plus all variations of SELECTED_* states in addition to a "selectedMask" and "focusMask" display objects that are automatically arranged, docked, and made visible to suit not only the button state, but also (at least in the case of "focusMask") taking into account the manor in which it entered a particular state (via keyboard, via mouse, via assignment, what the drag source origin was, exact origin clip, custom tracked drag source, whether a drag even began, was cancelled, etc.).  It dispatches events for all of these states and has fallback chains for any that are missing, since they're all classified into simple states out, over, and down.  For example, if no RELEASE state is defined (can be either property named "mc_release" or "release" label on "skin" MovieClip), then it will progressively fall back to ROLLOVER, ROLLOUT, and finally DEFAULT until one is defined.  The bare minimum for a functional button is to define a clip for the default state.
    So anyway, I wanted to animate my "release" state by having the button collapse and expand, and I discovered this odd ghosting behavior.  This is just a simple reproduction of the problem with no special logic, just a shape tween on a clip with scale9Grid active.  It appears as though Flash isn't re-rendering the bottom most shape as its exposed by the tweened shape on the layer above:ShapeTweenGhosting.fla - Google Drive
    I suspect this is occurring because of the active scale9Grid, since the ghosting goes away when you turn it off, but then the button is all distorted.  Turning on cacheAsBitmap exhibits the same behavior.  Again, it's not a performance issue, it's just incorrectly rendering.  I don't see any documentation stating shape-tween animations are not allowed in clips with scale9Grid applied.  The shapes themselves appear to be rendering correctly based on the scale9Grid (i.e. without distortion), but the ghosting is a problem.
    Here is an even more pronounced example with a large shrinking and expanding oval shape:
    ShapeTweenGhosting2.fla - Google Drive

    I posted a bug here: Bug#3767678 - Ghosting occurs in shape tweens in clips with scale9Grid active
    Continued experimentation revealed it occurs on the y axis too, and depends on how much you scale the clip.
    At 99%, 100%, and 101%, no ghosting is observed.  At 110%, it occurs a little bit.  At 120%, the ghosting is very pronounced.  I suspect the problem is arising due to inaccurate calculations of the redraw regions, which may not be taking into account certain scaling factors, perhaps such as stroke widths; however, I reduced all stroke widths to zero (hairline), and the ghosting still occurred, so something is not quite right.

  • Stop rotating in shape tween

    Hi,
    I have made a rectangle in cs6 actionscript 2.0
    Now I want to make it a Liquified shape, that keeps moving. So am planning to do, is to make keyframes and then change the shape with the envelop tool or the pen tool. And between the keyframes I want to use the shape tween to make it a smooth transition. Problem is, that when the shape then changes, it automaticly rotates 90 degrees. I just want it to change to the shape in the next keyframe, not make a rotation while doing so.
    If there are other better ways of doing this, please feel free sharing tips!
    Thanks a lot!
    Patrick

    use shape hints: modify>shape>add shape hints.

  • Shape Tweening - simple tween doesn't work

    I'm thoroughly discouraged with Flash CS3 for the trouble I'm
    having with this simple shape tween. Please tell me it's my fault
    so that I can get this to work and not think that Flash is dumb.
    I'm going from a small circle with a 1 px stroke to a round
    cornered rectangle with the same stroke. It looked like it spun a
    little during the morph so I added shape hints. I tried a few
    different arrangements and none of them really worked. The most
    annoying thing is when it looks right no the FLA and then the
    export is working correctly - obviously some kind of program
    defect.
    Shape hints:
    - All four corners with A starting in the top left and
    continuing around counter clockwise.
    - All four sides with A starting on the left side and
    continuing around counter clockwise.
    - A on left side and B on right side.
    They all either still spun funny or completely disappeared
    during the morph.
    All the hints appeared green and yellow for all arrangements
    - no red hints.
    In the past I've arranged them in what I would think to be a
    random order with the hints appearing red and the dam thing would
    actually work.
    Just the fact that I have to screw around with shape hints
    for this simple tween is silly.
    Simple fix here?

    Thanks for reporting the issue. Please move the code in first
    frame to frame 2 as a workaround.

  • Shape tween variables?

    Hello :-]
    I'm using shape tweens to morph one shape into another:
    http://megaswf.com/serve/81955/
    While I enjoy some of the choices Flash makes for animating the transformations,
    I am wondering if you can control it in any way, or even have flash generate a different transformation.
    I would also love to know of any suggestions you might have for making animated videos with shapes more dynamic.
    That demo shows about what I know, which amounts to:
    applying shape tweens for morphing;
    and motion tweens for 2d spinning,
    and basic movement from point A to point B.
    Bless you!

    You can use shape hints for a measure of control on shape tweens.
    As for animating there are a lot of tricks. One of the simplest is to use easing. Select one of your tweens and look in the properties panel. There you will see and easing number. Try some different values (negative and positive).
    Other things that aren't just a technical fix are anticipation and overshooting. Matter of fact most of the things that make compelling animation have nothing to do with Flash or specific technologies. If you are interested in doing a lot of animating I would recommend any book by Chris Georgenes.

  • How can i use shape tweening and motion tweenin together on a movie clip?(where is looping whitch was in propertise panel in CS5?)

    how can show animation (shape and motion tween) witch i was created in Scens1-MovieClip in time line?
    there was an option (looping) in CS5 but how can i do it in CC and CS6?

    shape tweening can only be applied to raw drawn shapes, no movieclips.  IF you wanted to do a shape tween to a movieclip it would have to be done within the timeline in the movieclip.

  • Shape Tween Trouble

    Hi
    (using Mac OS snow leopard)
    I'm animating a character in Flash CS6:  the character is composed of graphic symbols that make up the various body parts and have a dark colored Stroke that outlines each symbol.  Some the symbols used for the limbs however have outlines where a section of the Stroke is colored to resemble the Fill color: in order to make the symbols appear connected smoothly (such as the arm symbol's Stroke is colored to resemble the torso's Fill color in the section where the arm would be anatomically be connected at the sholder).  
    Problem is when I shape tween inside the graphic symbol; the outline changes color in between each set of keyframes.
    Is there any way I can get these symbols to shape tween and still maintain the outline the way its designed when on a keyframe?
    Any help would be greatly appreciated !

    Hi Ned,
    That is what I did orginally.  Unfortunately, instead of changing color, the stroke itself would fill in the area of the outline that I had removed.   Causing an effect that looked like a line started to grow when I would scrub on the timeline between each set of keyframes.

  • How can I shape tween crossing objects?

    I want to shape tween multiple objects on the same layer.  When they are placed independently from each other all the time on the canvas, I have no problem to make them morph into the other shapes in the ending keyframe.
    However, when some of the objects are crossing each other in either the starting or ending keyframe, they don't morph smoothly but quite funnily. Funny phases are nested between the intended starting and ending tages.
    See the images below. What should I do to prevent this?
    Intended starting stage
    Funny interpolation
    Intended ending stage

    I believe you're only option is to tween each shape on a separate layer.

  • Reflection for a shape tween..how ?

    Hi
    Flash CS5
    I have created reflections so far for MovieClips which are just static png images within the MC, as the MC travels across stage, the reflection travels with it.
    I also have an MC of a human standing which, within the MC, it starts as a png, then I have traced that as shapes each with a matching colour fill, I shape tween each of those shapes to become the shape of the ending png (human fallen down) then that png continues to show for the duration of MC timeline.
    There are 12 shapes that each tween. (legs , feet etc)
    This MC also travels across stage a short distance.
    Ideally I need reflections for each of the 29 frames during the fall, either of the combined shapes per frame, or of each of the 12 shapes per frame. The latter would mean a lot of MC's !...as it takes two MC's per subject reflection and some code to make a reflection. (maths 12 x 2 x 29 = 696 MC's !)...impractical !
    Method of reflection is a reduced height png is MC'd with e.g. MC and instance name SideView and also a graduated colour rectangle black/white matching this shape is placed over this and MC'd with e.g. MC name and instance name of SideViewMask_mc with white nearest subject, white alpha 30% black 0% my chosen transparency. Then coded.
    SideView.cacheAsBitmap=true;
    SideViewMask_mc.cacheAsBitmap=true;
    SideView.mask=SideViewMask_mc
    How can I make my reflection for the shape tween ?
    I wondered if for the speed of the fall I could just have reflection MC set for him upright and a reflection MC set for him fallen and Classic Tween those ?...or could the combined shape seen by the human eye per frame be given reflection. Thats still 29 frames each with a different shape.
    Envirographics

    try it.
    i'm not sure what your figure is doing but, if your movieclip's bitmap representation is changing (ie, it's not just moving horizontally/vertically), you'll probably need to update the reflection repeatedly until the bitmap no longer changes.

  • Error in Importing webservice via ActionScript

    Hi All
    This is regarding the Webservice via ActionScript (Import->Web Service) for Flex 3
    I am using the same method to import the webservice. The proxy classes are getting generated. I am using the following code for accessing the method:
       var myVar:Welcome = new Welcome();
       myVar.name = "shilpa";
        var myService:WelcomeNoteService = new WelcomeNoteService();
        myService.addwelcomeEventListener(handleResult);
        myServ.addWelcomeNoteServiceFaultEventListener(handleFault);
        myService.welcome(myVar);
    Here Welcome is the function name in webservice (for which proxy class is generated) and WelcomeNoteService is the webservice name (for which proxy classes is also generated).
    When I try to access 
    public function handleResult(event:WelcomeResultEvent):void{
    Alert.show(event.result.toString());
    event.result is coming as null.
    I have tried to debug also , but not able to find the error.

    Hi,
    <i>My dev is on SP 15 and Cons on SP 10..While transporting SLD product using file system i got following error:
    </i>
    See SAP Note 832142 for known restrictions about transporting objects between
    different XI 3.0 support packages And See SAP Note 834507 for known restrictions about cross-release transports.
    Also see the CMS Guide at market place, how to guide,
    https://websmp201.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700003090422005E
    Also refer 780297 for continiuosly updated errors.
    May be all this will help you to analyse if not directly arrive at the solution.
    All the best,
    Anirban.

  • Shape Tween grayed out between 2 vectors

    I have two vector graphics I imported to my stage and want to do a shape tween between them.  But shape tween is grayed out.  The images are imported Illustrator EPS's.  Why is this happening?
    I attached two screenshots.  Thx!

    Right now they are grouped, you need to break them apart. cntrl+B.
    That is going to give you some funky results though - with the "02" being the same in both keyframes and the black being what is intended to be tweened, just a heads up. You probably will just want to shape tween the black and motion tween the "02"

  • Shape tween on circular object

    I've got a disk on a flash movie I'm animating. I want the
    disk to appear as if the hands of a clock are moving around the
    face so as the hand drags in a clockwise motion, then disk appears
    behind it. I have tried to start with a straight line in the 12:00
    position and then have it move to different pie shaped wedges (with
    a midpoint on the stage), but they dont' wnat to tween in a logical
    manner (ie. following the hands of a clock).
    Has anyone been able to do this with ease.
    I'm using Flash MX 2004.
    Thanks for any help.

    I'd make your line a symbol, apply a motion tween to the
    layer, then hit "q" and move it's center point to the center of the
    disk to change it's pivot. Then just keyframe down the timeline and
    rotate, keyframe/rotate, etc... Don't use the shape tween in this
    instance.
    K.

  • Shape tween doesn't repeat..

    I created some blinking eyes last night with shape tweening.  I'm been working on a mouth and I got it to make the mouth open but unlike the blinking eyes  the mouth just stays open stays open.  Can someone gude me to what I may have done wrong in the proces.

    After your post rob I decided to start over.  I figured I made a mistake along the line that effected the continued motion of the eyes.   I was right because the second one had no issues.  Then I moved on to creating a mouth with some  teeth.   Making the mouth was tough at first.  THen I realized I was crossing my lines and after fixing that the mouth shape tween worked great. Then I started on the teeth and things went all wrong. I had the exact same issue as I did with the eyes.  WHere the repeat went bad.  I wanted to see if you could tell me where I went wrong with the up and down motion of the teeth.  I have a feeling i'm missing something when it comes to creating classic tweens with out any hicups.
    http://www.mediafire.com/?tqr4dr5v312pepz

  • Is it possible to do one to one shape tween or animate vector anchors/handles?

    I am animating hair. I've added shape tween hints to as many points as I can, but parts of the shape still tweek out. Im wondering if I can animate handles/anchors directly, or if I can specify that I don't want the shape tween to add/remove anchors/handles while it tweens.
    Is there a way to tween a shape one to one? By that I mean: Say I have an N point vector animated over frame 1 to 10. I want point 0 at frame 1 to blend to point 0 at frame 10, point 1 at frame 1 to blend to point 1 at frame 10, etc
    Thanks!

    MB31 is for doing goods receipt of production order

  • Shape Tween edit will not save on Mac OS X

    The file that I am working on has a shape tween that I added, but when I go to save the file, the save bar pops up and everything seems fine. When I open that file again the shape tween is not saved and is not even there anymore.
    I am running Mac OS X

    I am trying to watch the on demand videos on the xfinity website. According to the website it says the minimum requirement is Flash 10.0.42
    http://customer.comcast.com/help-and-support/internet/xfinitytv-com-minimum-requirements/

Maybe you are looking for

  • Linux support on Solaris 10 x86

    When we are trying to run linux binaries on solaris 10 getting the following error: update_records: Cannot find /lib/ld-linux.so.2 update_records: this is linux binary. Whereas Solaris 10 features states that we can run the linux binaries on solaris

  • When switch on...I don't know what's going on...

    I don't know what's wrong with my MacBook Pro when I switch it on Please watch the video below http://youtu.be/uPCtqYYOMvY?list=UUcR6nO8MYaeh6ZbcEs7-Cyg How can I solve this problem? Please help.

  • Best OS to install on early 2008 MBP?

    Hello Everyone, I have an Early Macbook Pro 15 inch currently running on Mavericks. To be honest, my computer has never ran any slower. Programs open slowly, startop takes a bit of time. Overall it's very slow. I cleaned installed the Mavericks OS on

  • Filter Restricition issue

    I have a filter issue in my query analyzer. If I restrict  filter values above 20 entries - In the report I am getting filter infoobject displays complex .No filter values are displaying.If I restrict filter values is  20 or less than 20 values it di

  • CS4 Bridge and Lion

    Since upgrading to Lion Bridge predictably crashes when wxiting Camera RAW after making modifications. The crash report is similar each time. The workaround is to open RAW files in PS. My question is this. Does apple take any notice of the crash repo