flash actionscript:
Dear List I have a basic syntax question that I realized I'm not quite familiar with in flash8. It came up when I've tried to create a combobox to allow the user to chose different types of Tweening and easing from the Tween class. I created two comboboxes, one with all the Tween values (Regular, Strong, Elastic...) and one with all the easing values (easeIn, easeOut...) When I trace the comboFunc variable below it does trace some function, but once I plug it into the tweenExtended method nothing happens. It seems to tween everything the same way. What am I missing here? any leads appreciated. Thanks Stephan ----------------- var tweenType = [_root.growingTween.selectedItem.data]; var easeType = [_root.growingEase.selectedItem.data]; var comboFunc = [tweenType+easeType]; this.tween = new TweenExtended(this.ring, ["_xscale","_yscale"],eval([tweenType+easeType]), [this.ring._xscale, this.ring._yscale], [_root.getMinSize(),_root.getMinSize()], _root.getShrinkSpeed(), true);
Not real clear on your code snippet. But I assume you could store the easing method name as a label and the tween class as the data. Then use the selectedItem.data for the Tween class. But you could also look at the attached code as an alternative example. switch( tweens.cb.selectedItem.data ) { case "strong": tweenEasing = Strong.easeOut; break; case "elastic": tweenEasing = Elastic.easeOut; break; . . . } new Tween( __tweenMe_mc, "-y", tweenEasing, 0, 100, 3, true );
Excellent solution. Works like a charm. Thank you very much.
Don't see what you're looking for? Try a search.
|