A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: How to reverse a motion script

  1. #1
    Senior Member
    Join Date
    Jul 2001
    Posts
    317

    How to reverse a motion script

    As an example, in Swishmax, I

    create text,
    add a motion effect,
    convert it to a sprite,
    name the sprite "test"
    open the sprite,
    put a "forward" label at the
    beginning of the timeline,
    put a "reverse" label at the
    end of the timeline,

    at the scene level I insert
    the following code:

    onClipEvent (enterFrame) {
    if (test.mode == "reverse") {
    test.prevFrame();
    } else {
    test.nextFrame();
    }
    }

    and the effect plays until the
    label "reverse" is encountered
    in the timeline at which point
    the effect plays in reverse back
    to the "forward" label in the
    timeline.

    I'd like to accomplish the exact
    same thing in KoolMoves.

    It may or may not require
    actionscript to accomplish
    the same thing in Kool Moves,
    but, I've yet to be able to figure
    it out.

    For example, adding text and
    applying the "Blinds" motion script.

    Anyone?
    Last edited by dinkledorf; 09-13-2006 at 11:20 PM. Reason: because

  2. #2
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    First trick....forget all the ways you did things in Swish. Swish's motion scripts are frame dependent meaning the number of frames they span alters the outcome...slide in fast or slow for instance......in Koolmoves Motion Scripts are single frame wonders. To reverse those you use a combination of scripting (the motion script itself) and timeline navigation. That is why you will notice many have the option parameter of "Reverse". If you used a frame based effect (like the fade in/fade out/spin/rotate effects)....your old method is the same.

    Attachment picked up by poster and cleared for space

  3. #3
    Senior Member
    Join Date
    Jul 2001
    Posts
    317

    My examples

    Thanx for the example, Chris.

    I think maybe I need a tutorial not just an example.

    Yours is a very simple example, that, I can't make
    heads or tails out of. I mean I understand HOW it
    works. I have no clue how to pick it apart and put
    it back together or to recreate it from scratch.

    Conceptually speaking it's like understanding how
    an automobile engine works and getting from that
    understanding to building one or taking it apart and
    putting it back together again.

    I'm just not figuring it out.

    Here's some examples I put together using SwishMax
    just to try to help me understand the process (and I
    understood from your explanation that SwishMax and
    KoolMoves are apples and oranges apart in their process)

    At any rate, from your example both effects load and
    a variable is set to "false". Then a button is clicked and
    that variable is set to "true". And at that point the effects
    reverse. Somehow, clicking the button triggers the reversal.

    That much I think I understand. But, that's about it.

    Here's my examples.

    (I also did them because I wanted to compare final size.)

    The Koolmoves example exported to (swf) 27k (from v5.5 - Demo).

    The swishmax examples exported to (swf) 2-3k.

    Reversed effect (Ping Pong):

    http://mywebpages.comcast.net/unkerjay/reversed.html

    Effect with push button for reverse:

    http://mywebpages.comcast.net/unkerj...sh_button.html

    Nothing beats rub my stomach, pat my head thought process for
    a real doozy of a headache.

    Working at forgetting how swishmax works in the process of figuring
    out Kool-Moves.

    Maybe if I just beat my head against a nearby wall a few times until
    the feeling subsides...

    :-)

  4. #4
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    I think maybe I need a tutorial not just an example.
    I'm sure one will come along. I didn't realize you were on the demo. I'm going to clear the attachment to save space in my total. Good luck on the transition over if you decide to purchase

  5. #5
    Senior Member
    Join Date
    Jun 2000
    Posts
    3,512
    Unless the particular motion script has a reverse parameter you can't reverse the action unless you rewrite it yourself.

  6. #6
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    I wanted to add that my example used a button component for the example. In an empty movie with a flash 6 button component it would add 23k to the file size....if a flash 8 button component about 13k. Now you Swishers may find that unreasonable but you must remember that Swishmax has NO button components (buttons that accept scripted button commands with standard AS1) which I find equally unreasonable

    At the time I made the example I was more concerned with showing that Koolmoves can do anything Swish can and did not realize it was also a size competition. Had I known I would have possibly chosen a different style of example. Being a previous Swisher myself (2+ years) I don't want any Swisher who may be coming over to our platform to think that they would be downgrading their toolbox but would actually be miles ahead of what they are using now (Koolmoves acts and scripts like big red) if they do. If a few "k" make the world of difference and is worth sacrificing power for sheer size...you should remain a Swisher. If power is your primary goal...then run...don't walk here....from Swish

  7. #7
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Chris, when you got that 23k example, are you sure you unchecked the flash 6 components checkbox otherwise both are included. Normally the flash 8 components also take about 13k.

    If it was a motion script effect, that also adds a few extra kb since KM effects are scripted and (most ?) Swish effects are precalculated if I'm correct.

  8. #8
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    I had it backwards...was just about to update the post.

    F8=13k
    F6=23k

    Sorry

    Had I not used the F6 button I did in the example it would have smoked his Swish example but like I mentioned he did not mention exported size was also being checked. I was a bit irritated so I removed the example and will let him decide what platform he prefers based on their own merits. If he converts...great...if not...oh well

    Yes..Swish precalculates and divides over the span of frames. A shorter span speeds up a longer span slows down.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center