[Tweener] onComplete Help!

Zeh Fernando zeh at zehfernando.com
Fri Feb 13 10:42:11 PST 2009


First thing I can think of: change "delete onEnterFrame;" to "delete
this.onEnterFrame;". Make sure it's removing the function after it's loaded.

Also, as ludicrous as this sounds, instead of checking for whether
bytesLoaded == bytesTotal, use bytesLoaded >= bytesTotal. More than one
time, I had to deal with servers/files that actually reported the loaded
bytes as being more than the total. I'm not even sure why that happened
though, but it did, so you may want to log that for a while into some
textfield and see whether it's the case here.

Zeh

On Fri, Feb 13, 2009 at 3:28 PM, Alejandro Yanaculis <
ayanaculis at shoclabs.com> wrote:

>
>
> I have been using tweener for a while now, but it's the first time I've
> encountered this problem:
>
>
>
> I have the following as2 code that fades the preloader after it has
> finished loading an external swf :
>
>
>
> stop();
>
> import caurina.transitions.Tweener;
>
> nextStep = function () {
>
>                 gotoAndPlay("content");
>
> };
>
> loadMovie(this.sectionToLoad+".swf", this.loadMC);
>
> //preloader
>
> mainLoader.onEnterFrame = function() {
>
>                 if (!loaded && loadMC._url != _root._url) {
>
>                                total = loadMC.getBytesTotal();
>
>                                loadedMC = loadMC.getBytesLoaded();
>
>                                percent = int(loadedMC/total*100);
>
>                                mainLoader.Text = percent+"%";
>
>                                mainLoader.gotoAndPlay(percent);
>
>                                if (loadMC.getBytesLoaded() ==
> loadMC.getBytesTotal()) {
>
>                                                delete onEnterFrame;
>
>                                                Tweener.addTween(mainLoader,{_alpha:0,
> time:1, transition:"easeOutQuint", onComplete:nextStep});
>
>                                }
>
>                 }
>
> };
>
>
>
> The problem is that the preloader actually fades out when the loading is
> complete, but the nextStep function (which makes the main timeline jump to
> frame "content") is not executed once the tween is complete.
>
>
>
> I've tried everything I could think of , so any help would be appreciated.
>
>
>
> Thanks,
>
>
>
>
>
> <http://www.shoclabs.com/>
>
> Web Image Solutions <http://www.shoclabs.com>
> *ShocLabs*
> *Alejandro Yanaculis*
> ayanaculis at shoclabs.com
> Esparza Oteo 14 - 3er piso
> Guadalupe Inn, 04530
> México D.F.
> tel: +52 +55 5661 4323
> fax: +52 +55 5661 4323
> mobile: +52 +55 2756 6588
> http://www.shoclabs.com
> Skype ID:ayanaculis
>
>
>
> *Want a signature like this?*<http://www.plaxo.com/signature?src=client_sig_212_1_simple_sig&lang=en>
>
>
>
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20090213/45e7607f/attachment-0001.htm>


More information about the Tweener mailing list