Share Posted November 25, 2009 Hello. I was wondering if there's a way to assign functions for onStart and onComplete stats for every Tween? I prefer to use static initialization method: TweenLite.to(...); Thanks in advance. Link to comment Share on other sites More sharing options...
Share Posted November 25, 2009 Nope, sorry - why would you want to do that anyway? You could certainly create a proxy function of sorts, like: function tween(target:Object, duration:Number, vars:Object):TweenLite { vars.onComplete = myCompleteFunction; vars.onStart = myStartFunction; return new TweenLite(target, duration, vars); } Link to comment Share on other sites More sharing options...
Author Share Posted November 25, 2009 Thanks. I wonder why I didn't figure it out myself? So simple and yet a grate solution! Why? Well, I would like to dynamically change the frame rate of a swf. Like that: private function set transitions( value:int ):void { m_transitionsTotal = value; stage.frameRate = m_transitionsTotal == 0 ? 1 : 30; } private function get transitions():int { return m_transitionsTotal; } public function addTranstion():void { transitions++; } public function remTranstion():void { transitions--; } So every Tween could just run addTransition() at the beginning and remTransition at the end. Anyway, thanks for help! Much appreciative! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now