Código ActionScript :
//Action Script 2.0
stop();
starttime = getTimer();
MovieClip.prototype.easeTimelineTo = function(finalFrame,power){
if(power==undefined){ power=6 };
var rounding; finalFrame>barra_mc._currentframe ? rounding="ceil" : rounding="floor";
barra_mc.createEmptyMovieClip("easeTimeline_mc",4).onEnterFrame = function(){
barra_mc._parent.gotoAndStop( barra_mc._parent._currentframe + Math[rounding]((finalFrame-barra_mc._parent._currentframe)/power) );
if(barra_mc._parent._currentframe==finalFrame){ barra_mc.removeMovieClip() };
}
}
barra_mc.onEnterFrame = function(){
total = _root.getBytesTotal()/1000;
received = _root.getBytesLoaded()/1000;
bar_perc = (received/total)*300;
txt_perc = (received/total)*100;
//Establece el tiempo de Easing:
var ease = 6;
barra_mc.gotoAndStop( barra_mc._currentframe + Math.ceil((bar_perc-barra_mc._currentframe)/ease) );
barra_mc.porc.text = int(txt_perc) + "%";
if(txt_perc==100 && barra_mc._currentframe==300){
play();
delete barra_mc.onEnterFrame;
}
}
logre hacer esto.... pero no funciona nada...
Código ActionScript :
//Action Script 3.0
stop();
var starttime:Number = getTimer();
var nmc:MovieClip = new MovieClip();
nmc.name = "easeTimeline_mc",4;
MovieClip.prototype.easeTimelineTo = function(finalFrame,power){
if(power==undefined){ power=6 };
var rounding; finalFrame>barra_mc.currentFrame ? rounding="ceil" : rounding="floor";
barra_mc.addChild(nmc).addEventListener(Event.ENTER_FRAME, ef);
function ef(e:Event):void {
barra_mc.MovieClip(parent).gotoAndStop( barra_mc.MovieClip(parent).currentFrame + Math[rounding]((finalFrame-barra_mc.MovieClip(parent).currentFrame)/power) );
if(barra_mc.MovieClip(parent).currentFrame==finalFrame){ barra_mc.removeChild(nmc) };
}
}
import flash.display.*;
this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, preloader);
function preloader(event:ProgressEvent):void {
var total:Number = event.bytesTotal/1000;
var received:Number = event.bytesLoaded/1000
var bar_perc:Number = (received/total)*300;
var txt_perc:Number = (received/total)*100;
var ease = 6;
barra_mc.gotoAndStop( barra_mc.currentFrame + Math.ceil((bar_perc-barra_mc.currentFrame)/ease) );
barra_mc.porc.text = int(txt_perc) + "%";
if(txt_perc==100 && barra_mc.currentFrame==300){
play();
delete barra_mc.onEnterFrame;
}
}
Alguien sabe como hacerlo? GRACIAS DE ANTEMANO...
