This content has been marked as final. Show 7 replies
the Tweeing class modifies object properties, but can not call function. This is why your code does not work.
Have look at this Color Tween example class, it should do the job for you:
Thanks Jan-Paul - once again you are a saviour and a star!! :D
>>but can not call function
Sure it can. But you cannot provide an object property that doesn't exists.
could you post an example on your to use the Tween class to call a function with tween-values instead of modifying an objects properties?
I never needed this function, but if I do, it would be nice knowing how to do that.
I tried the following which doesn't work:
new Tween(_root, "getValue()", Strong.easeIn, 100, 0, 2, true);
also I don't know how to pass multiple parameters to this function :-(
If you open up the Tween Class in your actionscript editor, you'll notice the constructor expects an argument 'prop' and in the class definition you see that prop is supposed to be a string. So, you have to pass a string value to the constructor but whether you just provide the string or let a function return it... doesn't matter. As long as the return value from that function is a string (and a property of a movieclip). The same goes for all other parameters. Either provide a value when you create the new instance or call functions that return - valid - data for the specific parameter. However, the property you provide has a relationship with the start and end values you provide so usually you provide a property but can randomize start, end, time and even the type of easing if you want. Attached a (weird) example.
Oh, and if you want real power with animating -> Fuse Kit -> www.mosessupposes.com (big 'wow' factor).
LuigiL thanks a lot for your response, and the interesting link to the fuse engine...looks definetely worth a try.
now back to my question:
of course you can make any function return a string value and pass this to the Tween class as a constructor parameter, thats just what I said before:
"the Tweeing class modifies object properties, but can not call (a) function"
waht I wanted to say with that (which was maybe misunderstood by you) is that the Tween class can modify any objects pubic properties, but it can not call any of the _objects_ functions. So I am not sure if you misunderstood my statement or if I am realy wrong.
Your example also only shows how to modify any property of the mc object (even though the name of the property is returned by a function, therefore is dynamic) with the Tween-Class but not how to call an objects funtion for every Tween step. And this is what RedBox tried to do, which, as I said is not possible.
Do you agree?
>>but it can not call any of the _objects_ functions
Then indeed I misunderstood! Fully agree.