dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: A slow fade in

  1. #1
    Senior Member
    Join Date
    Oct 2001
    Posts
    219

    A slow fade in

    I'm making(attempting, rather) a preloader that has a photo that slowly fades in based on the percentage loaded. Obviously it won't work or I wouldn't be here bothering you guys. Here one of the variations of the Actionscript I've tried....all that seems to happen is the pic suddenly pops in when the movie is fully loaded... no fade in. Again, thanks for your time and advice.

    onClipEvent (load) {
    this._alpha = 0;
    bl = _root.getBytesLoaded();
    bt = _root.getBytesTotal();
    perc = (bl/bt)*100;
    }
    onClipEvent (enterFrame) {
    this._alpha = perc;
    }

  2. #2
    Senior Member suehami's Avatar
    Join Date
    Jun 2003
    Location
    asmania
    Posts
    224
    I hope this isnt a silly answer but have you do have a gotoAndPlay action on frame 2 dont you. And you need some kind of if statement, sorry its a bit late here, i'll think about it a bit.
    Another way to do this might be to adapt this preloader tutorial ...
    link here
    Only after the last tree has been cut down, after the last river has been poisoned, after the last fish has been caught, then will you find that money cannot be eaten. Cree Indian Prophecy.

  3. #3
    Senior Member
    Join Date
    Oct 2001
    Posts
    219
    Yes..I have the goAndPlay(1) in the second frame

  4. #4
    Senior Member suehami's Avatar
    Join Date
    Jun 2003
    Location
    asmania
    Posts
    224
    i thought you must have but thought i'd check anyway (you never know ))
    Only after the last tree has been cut down, after the last river has been poisoned, after the last fish has been caught, then will you find that money cannot be eaten. Cree Indian Prophecy.

  5. #5
    Senior Member
    Join Date
    Feb 2003
    Location
    Out There...
    Posts
    162
    Hmm. I'm testing this out and it seems to be that the picture you want to fade in has to be loaded itself first. Thats why it just appears once its done. By the time it finishes loading the picture its done loading all together. Did that make sense?

  6. #6
    Senior Member
    Join Date
    Oct 2001
    Posts
    219
    I think you may be right....I'll try cutting way back on the jpeg "weight" and see if that helps. If all else fails - I can make a pseudo fade in by :
    onClipEvent(load){
    this._alpha = 0
    }
    onClipEvent(enterFrame){
    if(this.alpha<100){
    this.alpha += 2;
    }
    }
    Thanks to you guys for giving me something to think about.

  7. #7
    Senior Member
    Join Date
    Feb 2003
    Location
    Out There...
    Posts
    162
    I'd personally just either a.) ditch the JPEG graphic (if you can't scale it down to a pretty tiny size). or b.) use a vector graphic to fade in, like your logo but made in flash or something.
    Just remember that the picture is apart of your total KBs, so even if it's only 5% of everything, once it get loaded its going to "jump" in at 5% transparancy; which you don't want.
    The last thing I thought of was you could load the pic you want to fade in first, and then use it for your loader, but that's just kind of tedious and is only going to make people viewing your stuff wait longer. Plus is sounds kind of dumb to be "loading the preloader"

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center