Alright, I wrote some code that draws a circle and I added an easing effect using Tweener as follows:
var Circle:MovieClip = _root.createEmptyMovieClip("Circle", 2); function drawC(centerX, centerY, radius, sides){ Circle.per = 0; Circle.lineStyle(4,0xFFFFFF,100); Circle.moveTo(centerX + radius, centerY); var to = {per:100, time:1, transition:"easeOutQuad",onUpdate:function() { var pointRatio = (this.per/sides); var xSteps = Math.cos(pointRatio*2*Math.PI); var ySteps = Math.sin(pointRatio*2* Math.PI); var pointX = centerX + xSteps * radius; var pointY = centerY + ySteps * radius; Circle.lineTo(pointX, pointY); } } Tweener.addTween(Circle, to); } I tried than to use it as a preloader by adding the Preload function and ading a parameter to the drawC function as follows:: function drawC(centerX, centerY, radius, sides, percent){ *// here i added the percent par* Circle.per = 0; Circle.lineStyle(4,0xFFFFFF,100); Circle.moveTo(centerX + radius, centerY); var to = {per:percent, time:1, transition:"easeOutQuad",onUpdate:function() {// *here i assigned the per property to the variable passed by the percent parameter* var pointRatio = ( this.per/sides); var xSteps = Math.cos(pointRatio*2*Math.PI); var ySteps = Math.sin(pointRatio*2*Math.PI); var pointX = centerX + xSteps * radius; var pointY = centerY + ySteps * radius; Circle.lineTo(pointX, pointY); } } Tweener.addTween(Circle, to); } Preload = function () { total = _root.getBytesTotal(); onEnterFrame = function () { loaded = _root.getBytesLoaded(); percentage = Math.floor(loaded/total * 100); if(percentage !== 100) { _root.drawC(250, 200, 15, 100, percentage); *// the percentage is passed to the drawC* }else if (percentage==100){ delete this.onEnterFrame; }; }; }; Preload(); It doesn't work when theoretically it should.. I tried it without Tweener, using a loop and it worked but without easing. like this: function drawC(centerX, centerY, radius, sides, percent){ *// here i added the percent par* Circle.lineStyle(4,0xFFFFFF,100); Circle.moveTo(centerX + radius, centerY); for (i=0;i<=percent;i++); *// used a loop here - passed the var percent* var pointRatio = (i/sides);// *Used I instead of this.per* var xSteps = Math.cos(pointRatio*2* Math.PI); var ySteps = Math.sin(pointRatio*2*Math.PI); var pointX = centerX + xSteps * radius; var pointY = centerY + ySteps * radius; Circle.lineTo(pointX, pointY); } Tweener.addTween(Circle, to); } Now how can I relate the percentage that is returned to the drawing circle process with Tweener? Is there something wrong or something i miss? Regards -- Omar M. Fouad - Digital Emotions http://www.omarfouad.net This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. _______________________________________________ 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