A Flash Developer Resource Site

# Thread: Flag wave effect help

1. 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.

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

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

Thanks!

2. Hey thanks! I think that it is going to work.

3. ## 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!

4. 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++;
}
```

5. Hi, Cheers man, thats excelent. im gonna have a go, and if you dont hear any more, thanks again.

6. 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!

7. Enjoy

Once you know the methods, it only takes a couple of seconds to code so no need to feel lazy

8. 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
•

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap