[Flashcoders] prototypes?
i found a prototype on a website for easing. it works in their fla... i am trying to get it work here. when i load the swf, nothing happens... the object i am trying to ease is ball1 is the instance. the name in the library is test. Movieclip.prototype.scrollme = function(xPos, yPos) { cX = this._x; difX = cX-xPos; this._x = cX-(difX/5); cY = this._y; difY = cY-yPos; this._y = cY-(difY/5); }; stop(); ball1.onEnterFrame = function() { this.scrollme(300,300); }; ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] prototypes?
murder design schrieb: i found a prototype on a website for easing. it works in their fla... i am trying to get it work here. when i load the swf, nothing happens... the object i am trying to ease is ball1 is the instance. the name in the library is test. Movieclip.prototype.scrollme = function(xPos, yPos) { cX = this._x; difX = cX-xPos; this._x = cX-(difX/5); cY = this._y; difY = cY-yPos; this._y = cY-(difY/5); }; stop(); ball1.onEnterFrame = function() { this.scrollme(300,300); }; ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com rename the library :-) no kidding, you should consider this ... prototype as ... deprecated. use: MovieClip.prototype.scrollme = function(xPos, yPos) { this.cX = this._x; this.difX = this.cX-xPos; this._x = this.cX-(this.difX/5); this.cY = this._y; this.difY = this.cY-yPos; this._y = this.cY-(this.difY/5); }; micha ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] prototypes?
i found a prototype on a website for easing. it works in their fla... i am trying to get it work here. when i load the swf, nothing happens... the object i am trying to ease is ball1 is the instance. the name in the library is test. Regardless of the code you have in hand, you might want to consider using something more advanced for easing. Prototype or no prototype, there's a lot easier + cooler + more pratical ways to do easing or transitions (including sliding stuff on screeen). Your Flash development life will never be the same after you start using a tweening extension. There's a lot of them around. They're more or less the same, with different syntaxes however. Here's a bunch of them: Flash MX 2004's built in easing classes: http://www.actionscript.org/tutorials/advanced/Tween-Easing_Classes_Documented/index.shtml Laco's Tweening: http://laco.wz.cz/tween/ Moses Gunesch's Fuse Kit: http://www.mosessupposes.com/Fuse/ Tatsuo Kato's dynTween: http://tatsuokato.com/flash/dynTweenMX.html Zeh (mine)'s MC Tween: http://hosted.zeh.com.br/mctween - zeh ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com