SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2007
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mc fades in uneven at 100 alpha- it blinks not fades

    the word "communications" in the flash logo fades in, but it sort of bumps into full transparency right at the end. I'd like the fade-in to stay consistent. this was done in AS2.

    http://www.olanbrewer.com/flashtest.html

    here's the code for the last frame of the animation:

    stop();
    (comm_mc is the instance name)
    comm_mc.onEnterFrame = function(){
    if(this._alpha < 100){
    this._alpha += 2;
    trace(this._alpha);
    }
    }

    the trace statement shows that the rate it's fading in is at @1.95/frame and not the 2. what's with that? I tried using Math.round to no avail.
    ex:1.953125, 3.90625, 5.859375...
    as soon as it crosses 100 it's popping full brightness.

    R

  2. #2
    SitePoint Guru Dijup's Avatar
    Join Date
    Jun 2006
    Location
    Kathmandu, Nepal
    Posts
    790
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i think it is better you use tewwn class for this type of use it is more better and cool one too.

  3. #3
    SitePoint Member
    Join Date
    Apr 2008
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your code is just more or less working but it wastes ressources and your logic is also a bit beside the point try this instead:

    Code:
    comm_mc.onEnterFrame = function(){
    this._alpha += 2;
    if(this._alpha>=100){
    delete this.onEnterFrame;
    }
    }


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
  •