Results 1 to 3 of 3

Thread: preloader and onMotionFinished problem

  1. #1
    Join Date
    Aug 2006
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default preloader and onMotionFinished problem

    hello, I've been working on a site for some time now and I just created a preloader for the swf, at the same time as its preloading the swf will do tween on a object but heres the problem:
    When the preloader is done it will jump to the other frame (frame 2) and it wont complete the tween unless you have to load longer then the tween is so I though I would also use an onMotionFinished but it doesnt work, this is how it looks like:

    Code:
    var slide:Tween = new Tween(holder, "_x",Regular.easeOut, 800, Stage.width / 2, 0.5, true);
    
    this.onEnterFrame = function()  {
    var amount:Number = this.getBytesLoaded() / this.getBytesTotal() * 100;
    holder.loader._xscale = amount;
    var loader_text = Math.floor(amount);
    holder.load_text.text = loader_text + "%";
    if(amount == 100) {
    slide.onMotionFinished = function() {
    this.gotoAndStop(2);
    delete this.onEnterFrame;
    }
    }
    }
    I cant really figure out how to fix this so would really appreciate if someone could point me to the right direction.

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    1. What is the object that you're trying to tween across the screen? Is a progress bar? If so, post back because there is a much better way to do it than a tween.

    2. it should be var slide:Object

  3. #3
    Join Date
    Aug 2006
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yeah its the progress bar but also the background, how come it should be Object and not tween, im fairly new to flash so dont have a lot of experience

    edit:
    I just found out that my tween doesnt work if I use "export frame to classes <the frame after the loading>" which I have to select if I want the loading to work properly.
    Last edited by Dennis_Gull; 06-11-2007 at 02:42 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •