ActiveDen

AAAH tweenmax...

900 posts
  • Has been a member for 5-6 years
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Netherlands
  • Referred between 50 and 99 users
michelsteege says

I have a problem,

I use tweenmax in a website, and want to set the easing from xml but everything in the xml comes in flash as string and the easing must be a function. (or better: Class.function)

Anyone have a idea on how to set easing of tweenmax from xml? of is this just not possible with tweenmax and do i have to stick with tweener?

Thanks :)

3 years ago
179 posts
  • Has been a member for 4-5 years
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 1 and 9 items
  • Hungary
  • Referred between 10 and 49 users
tomez says

use getDefinitionByName to get the class from a String

3 years ago
900 posts
  • Has been a member for 5-6 years
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Netherlands
  • Referred between 50 and 99 users
michelsteege says
use getDefinitionByName to get the class from a String

I tried that :) but it does not work:

ReferenceError: Error #1065: Variable Elastic is not defined. at global/flash.utils::getDefinitionByName() at pages::HomePage/transitionIn() at com.gaiaframework.assets::PageAsset/transitionIn() at com.gaiaframework.core::TransitionController/pageIn() at com.gaiaframework.core::TransitionController/onTransitionInComplete() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at com.gaiaframework.assets::PageAsset/onTransitionInComplete() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at com.gaiaframework.templates::AbstractBase/transitionInComplete() at Function/http://adobe.com/AS3/2006/builtin::apply() at gs::TweenLite/complete() at gs::TweenLite/render() at gs::TweenLite$/updateAll()

3 years ago
900 posts
  • Has been a member for 5-6 years
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Netherlands
  • Referred between 50 and 99 users
michelsteege says

doublepost…

3 years ago
179 posts
  • Has been a member for 4-5 years
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 1 and 9 items
  • Hungary
  • Referred between 10 and 49 users
tomez says

use Elastic.easeIn

3 years ago
900 posts
  • Has been a member for 5-6 years
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Netherlands
  • Referred between 50 and 99 users
michelsteege says
use Elastic.easeIn

Does the same, some things i also already tried:

this[“Elastic”]

[“Elastic”]

Class(“Elastic”)

var e:Class = “Elastic” as Class

gs.easing[“Elastic”]

3 years ago
179 posts
  • Has been a member for 4-5 years
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 1 and 9 items
  • Hungary
  • Referred between 10 and 49 users
tomez says

import gs.easing.*;

var e:Class = getDefinitionByName("Elastic.easeOut") as Class;
3 years ago
900 posts
  • Has been a member for 5-6 years
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Netherlands
  • Referred between 50 and 99 users
michelsteege says
 import gs.easing.*; var e:Class = getDefinitionByName("Elastic.easeOut") as Class; 

That is the same as: use Elastic.easeIn ;) returns the same error :(

I wonder why tweenmax does it like this and not with a string?

3 years ago
179 posts
  • Has been a member for 4-5 years
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 1 and 9 items
  • Hungary
  • Referred between 10 and 49 users
tomez says

import gs.TweenLite;
import gs.easing.*;

var elastic:Elastic;

var f:Function = (getDefinitionByName("gs.easing.Elastic") as Class)["easeInOut"];

TweenLite.to(t, 1.5, {x:300, time:1, ease:f, delay:1});

it works for me, but for some reason you must make a variable with “Elastic” type to make it work.

3 years ago
900 posts
  • Has been a member for 5-6 years
  • Beta Tester
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Netherlands
  • Referred between 50 and 99 users
michelsteege says
 import gs.TweenLite; import gs.easing.*; var elastic:Elastic; var f:Function = (getDefinitionByName("gs.easing.Elastic") as Class)["easeInOut"]; TweenLite.to(t, 1.5, {x:300, time:1, ease:f, delay:1});  
it works for me, but for some reason you must make a variable with “Elastic” type to make it work.

Thanks :) that works.

3 years ago
by
by
by
by
by