Jump to content
Search Community

dro

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by dro

  1. sorry. you can delete this message )

    the problem was with 

    getTweensOf(mc, true); flag.

     

    all paused tweens are not active!.

     

     

     

     

     

     

     

     

     

     

    ////////////// question just for archive.

     

    but let me take it straight

    var tm:TweenMax = TweenMax.from(mc, duration, obj);
    tm.pause();

    then I forget about this tween for a little while.

    then I come back and do

     

    var tweensarr:Array = TweenMax.getTweensOf(mc, true);
    trace("currently " + tweensarr.length + " tweens");
    for each(var tweenToContinue:TweenMax in tweensarr) {
        trace("___________________ there s tween to continue " + tweenToContinue);
        tweenToContinue.play();
    }

    currently always 0 tweens.

    that's why no tweens got continued.

     

    Can you help me? Is this behaviour familiar?

  2. Probably this simple question was answered before.

     

    Is it possible to immediately finish tween (set all properties to target values and kill the tween)?

    I was trying tween.time (tween.totalTime()); but that didn't help.

     

    Could you help please?

  3. Hello. 

    I'm returning Flash developer. Abandoned AS3 like 5 years ago, but there's a new project entirely in Flash.

    Also I never used TweenMax before. (only caurina)

     

     

    my question is how to translate JSON to TweenMax correctly?

     

     

    there's standart syntax : 

    public static function from(target:Object, duration:Number, vars:Object):TweenMax

    and it works fine when I use it like that from AS3

    TweenMax.from(mc, 4,  { x: -100, alpha:0, ease: Back.easeOut.config(1.7) } );

    no surprises.

     

     

    But I have specific task to load animation instructions from JSON. And I've already made a little test:

    This example works fine:

     

    json object =

    {"alpha": 0,"x": -100,"rotation":-100,"scaleX":0}
    
    TweenMax.from(mc, 4, JSON.parse(json));
    

    It works pretty good. I was happy to see such fast and forward instructions conversion to TweenMax properties.

    But then there's a need to specify ease.

     

    "ease":"Back.easeOut.config(1.7)"

    doesn't work

    even "ease": "Back.easeOut"

     

     

    I'm not talking about custom ease for now. But we will also need this.

     

     

     

     

    That's all understandable

    inside TweenLite.as _Init there's a code

    if (vars.ease is Ease) {
    _ease = (vars.easeParams is Array) ? vars.ease.config.apply(vars.ease, vars.easeParams) : vars.ease;

    so it's clear that <string> can not be straightly converted to ease type. Also there are additional parameters like config(1.7) and strings can not be translated to those functions.

    Keywords like "x", "alpha", "rotation" translated correctly because they have numeric values. But "easeType" can't be recognized that way.

     

     

     

    So how to solve this? I believe if I start my own string to ease converter I will be lost on the way. Maybe there's an other intentional usage?

    Please help me to translate pure json to TweenMaxVars.

     

    // sorry for poor english.

    /// if somebody need this. I can upload json file. but it's pretty simple actually.
×
×
  • Create New...