A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Flag wave effect help

  1. #1
    Member
    Join Date
    Aug 2000
    Posts
    63
    I would like to make a bitmap picture of a flag wave like in the movie below:
    http://www.flashkit.com/movies/Effec...5398/index.php

    The one selection(wave)is the one I am talking about.

    It is difficult for me to learn from that how the wave selection could be programmed. It has alot to do with math so I thought I would include this in this forum.


    I looked at another post about this same effect but saw no resolution.

    http://board.flashkit.com/board/show...hreadid=188273

    In this post they referred to a website that uses this effect in its opening.

    http://www.che-lives.com/

    Thanks!


  2. #2
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002

  3. #3
    Member
    Join Date
    Aug 2000
    Posts
    63
    Hey thanks! I think that it is going to work.

  4. #4
    Member
    Join Date
    Sep 2004
    Location
    uk
    Posts
    70

    New Problem

    Hi, i followed the tutorial link here and it didnt work.

    I need to make a black and white chequered flag in flash.

    im guessing i need sine?

    any ideas to get me going would be great!
    Trailing garbage found.

  5. #5
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    Assuming you have split your image up into slices and laid them out o stage you can use this kind of function to apply the sine wave, giving the flag effect. You will need to name your flag slices as "flag1", "flag2" ..... "flagN" etc.

    code:

    // settings //
    var numSects = 20; // Number of segments in your flag
    var startY = 20; // mid y point
    var size = 20; // size of flag movement
    var speed = 10; // smaller = faster speed
    // -------- //
    var inc = (2*Math.PI)/numSects;
    var w=0;
    // onEnterFrame action
    this.onEnterFrame = function(){
    for(i=1;i<=numSects;i++){
    this["flag"+i]._y = startY + Math.sin((w/speed)+(inc*i))*size;
    }
    w++;
    }

    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  6. #6
    Member
    Join Date
    Sep 2004
    Location
    uk
    Posts
    70
    Hi, Cheers man, thats excelent. im gonna have a go, and if you dont hear any more, thanks again.
    Trailing garbage found.

  7. #7
    Member
    Join Date
    Sep 2004
    Location
    uk
    Posts
    70
    I feel a bit lazy now because ive had to do barely anything to get what I needed to work!

    ive been having a play today, its a brilliant method. although i tweeked it a bit to get what I need.

    good work fella!

    Trailing garbage found.

  8. #8
    Monkey Moderator Lexicon's Avatar
    Join Date
    Jul 2001
    Location
    UK
    Posts
    2,038
    Enjoy

    Once you know the methods, it only takes a couple of seconds to code so no need to feel lazy
    www.lexicon-design.co.uk
    If we aren't supposed to eat animals, then why are they made of meat?
    If Vegetarians like animals so much, why do they eat all their food?

  9. #9
    Junior Member
    Join Date
    Apr 2002
    Posts
    9
    hi everyone

    an old thread, but i cant work out how to do this! need to get a nice cheqeured flag effect...any ideas?!

    thanks!

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