A Flash Developer Resource Site

Page 3 of 4 FirstFirst 1234 LastLast
Results 41 to 60 of 61

Thread: [Resolved] [Resolved] Alpha Fade Script?

  1. #41
    Ok, but you don't need layers and stuff with this, you only need one frame and the pics + a dummie mc for the counter.

    I would be happy to talk you over the different codes step by step

    Xeno

  2. #42
    Alright! I got it! The AS on the image MCs can be adjusted to change the how fast they fade.

    if (alpha>alp) {
    alpha -= 20;

    can be changed to

    if (alpha>alp) {
    alpha -= 5;

    Awesome, thanks for your help! I may have more questions thought!

  3. #43
    Hehehe, ask away Happy it worked, it was abit of a try in the dark for me to with the timer, but it worked so

    Have question, just shoot! (them, not me please)

    Xeno.

  4. #44
    To add images, I would need to adjust the AS on the dummiecounter MC right?

    onClipEvent (enterFrame) {
    timer += 1;
    _root.xt.text = timer;
    if (timer == 1) {
    _root.d.alp = 100;
    } else if (timer == 25) {
    _root.d.alp=0, _root.e.alp=100;
    } else if (timer == 50) {
    _root.e.alp=0, _root.f.alp=100;
    }else if (timer == 75) {
    _root.d.alp=0, _root.e.alp=0, _root.f.alp=100 , _root.f.alp=100
    }
    }


  5. #45
    yep, for each image you add you must dim the previous by setting there 'alpa' to 0 and maximize the one you add by setting it to 100%. like this:

    Code:
    onClipEvent (enterFrame) { 
    timer += 1; 
    _root.xt.text = timer; 
    if (timer == 1) { 
    _root.a.alp = 100; 
    } else if (timer == 25) { 
    _root.a.alp=0, _root.b.alp=100; 
    } else if (timer == 50) { 
    _root.a.alp=0, _root.b.alp=0, _root.c.alp=100; 
    }else if (timer == 75) { 
    _root.a.alp=0, _root.b.alp=0, _root.c.alp=0 , _root.d.alp=100; 
    } else if (timer == 100) { 
    _root.a.alp=0, _root.b.alp=0, _root.c.alp=0 , _root.d.alp=0,_root.e.alp=100;}
    }
    And so on

    Xeno.




  6. #46
    Sweeet! I have succesfully added images and it continued to work. Thanks Xeno and AZ for all your help on this one. I will post the finsihed product in the next couple days.

    This is the code I used Xeno:

    onClipEvent (enterFrame) {
    timer += 1;
    _root.xt.text = timer;
    if (timer == 1) {
    _root.d.alp = 100;
    } else if (timer == 25) {
    _root.d.alp=0, _root.e.alp=100;
    } else if (timer == 50) {
    _root.e.alp=0, _root.f.alp=100;
    } else if (timer == 75) {
    _root.f.alp=0, _root.g.alp=100;
    }else if (timer == 100) {
    _root.d.alp=0, _root.e.alp=0, _root.f.alp=0, _root.g.alp=100
    }
    }

  7. #47
    Ah yes, good one, the past timer events allready set the previous movies to 0, slims the code down alot

    Always happy to help

    Xeno.

  8. #48

    More help please!

    Does this look right?

    onClipEvent (enterFrame) {
    timer += 1;
    _root.xt.text = timer;
    if (timer == 1) {
    _root.a.alp = 100;
    } else if (timer == 25) {
    _root.a.alp=0, _root.b.alp=100;
    } else if (timer == 50) {
    _root.b.alp=0, _root.c.alp=100;
    } else if (timer == 75) {
    _root.c.alp=0, _root.d.alp=100;
    } else if (timer == 100) {
    _root.d.alp=0, _root.e.alp=100;
    } else if (timer == 125) {
    _root.e.alp=0, _root.f.alp=100;
    } else if (timer == 150) {
    _root.f.alp=0, _root.g.alp=100;
    } else if (timer == 175) {
    _root.g.alp=0, _root.h.alp=100;
    } else if (timer == 200) {
    _root.h.alp=0, _root.i.alp=100;
    } else if (timer == 225) {
    _root.i.alp=0, _root.j.alp=100;
    } else if (timer == 250) {
    _root.j.alp=0, _root.k.alp=100;
    } else if (timer == 275) {
    _root.k.alp=0, _root.l.alp=100;
    } else if (timer == 300) {
    _root.l.alp=0, _root.m.alp=100;
    } else if (timer == 325) {
    _root.m.alp=0, _root.n.alp=100;
    } else if (timer == 350) {
    _root.n.alp=0, _root.o.alp=100;
    } else if (timer == 375) {
    _root.o.alp=0, _root.p.alp=100;
    } else if (timer == 400) {
    _root.p.alp=0, _root.q.alp=100;
    } else if (timer == 425) {
    _root.q.alp=0, _root.r.alp=100;
    } else if (timer == 450) {
    _root.r.alp=0, _root.s.alp=100;
    } else if (timer == 475) {
    _root.s.alp=0, _root.t.alp=100;
    } else if (timer == 500) {
    _root.a.alp=0, _root.b.alp=0, _root.c.alp=0, _root.d.alp=0, _root.e.alp=0,
    _root.f.alp=0, _root.g.alp=0, _root.h.alp=0, _root.i.alp=0, _root.j.alp=0,
    _root.k.alp=0, _root.l.alp=0, _root.m.alp=0, _root.n.alp=0, _root.o.alp=0,
    _root.p.alp=0, _root.q.alp=0, _root.r.alp=0, _root.s.alp=0, _root.t.alp=0,
    _root.u.alp=100
    }
    }

    The code above is on the dummie counter MC.

    The code below is on the img MC's.

    onClipEvent (load) {
    alp = 0;
    alpha = 0;
    }
    onClipEvent (enterFrame) {
    if (alpha>alp) {
    alpha -= 5;
    } else if (alpha<alp) {
    alpha += 5;
    }
    _alpha = alpha;
    }

    Its broken!

  9. #49
    Well, It looks okay to me, migt be an overrun of code, we maybe have to declare some of the code as functions. Wanna send the source so I can dive in?

    Xeno.

  10. #50

  11. #51
    Euhm, I don't think your server allows for outside linking, I got an error of that kind, couldn't access your file...

    Xeno.

  12. #52
    Sorry, Forgot about that. Weird though, it works on my MAC.

    http://www.synaweb.com/download.html

    Thanks

  13. #53
    LOL! It still gives the same linking error

    I can recieve 3MB emails, try to mail it to me otherwise.

    Xeno.

  14. #54
    I cannot send attachments through FK.

    What is your email?

  15. #55
    Hehehe, look under my banner, via the word 'email' you can send me mail

    My email is: xenomorph@pandora.be

    Xeno.

  16. #56
    When I click the link, it takes me to a form located on flashkit. It doesnt support attachments. BTW - You got mail.

  17. #57
    Oh my, don't I feel dumb right now

  18. #58
    Yééééé, it works, fast and without error

    Well, there where a few things wrong, for one the pictures had to be aligned after each one, so the first had to lay on top (bring forward) and the last had to lay at the bottom (send to back), when I did that, the sequence ran pretty cool, but still 2 big problems:

    1. Still some images flickered on istead of fading on.
    2. During fade the counter rate (which is our fake frame rate ) ran veeeeery slowly so the fading would look very uncool.

    For those 2 errors I had to rewrite to code and add about 40 new lines of code The problem was that flash loaded all the images on top of each other at the same time, you could not see them becuase their alpha was 0 but they where there, but now I added the visibilety option to the code so all the images are loaded onto the movie one by one when we need them, not all at once, and the result is smooth and correct animation.

    I also added a preloader for the pics, I hope thats okay.

    Hope you like the result

    Ooops, almost forgot to give you the links:

    Source: http://users.pandora.be/eclips/help/america2.fla
    Demo: http://users.pandora.be/eclips/help/america2.html

    Xeno.

  19. #59
    Xeno,

    That is perfect. That was the effect I have been looking for. I appreciate all of your help with this. I will definetly learn a lot from this fla. Just one thing, I cant find the dummie count mc. Where did you hide it on the stage?

  20. #60
    Its in the second scene on the big left panel next to the pics somwhere in the middel bit hard to find I guess.

    I probaly gonna try to shrink the code down into functions so there is lesser code and easier to adapt or debug.

    Well, if you need any further help, just yell!

    Xeno.

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