# NetStream and basic AS fade in

**URL:** <https://forum.kirupa.com/t/netstream-and-basic-as-fade-in/222890>\
**Category:** flash\
**Created:** [April 17, 2007, 7:31pm UTC](https://forum.kirupa.com/t/netstream-and-basic-as-fade-in/222890 "2007-04-17T19:31:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![intrinsik](https://avatars.discourse-cdn.com/v4/letter/i/e36b37/32.png) [@intrinsik](https://forum.kirupa.com/u/intrinsik)\
**Post date:** [April 17, 2007, 7:31pm UTC](https://forum.kirupa.com/t/netstream-and-basic-as-fade-in/222890/1 "2007-04-17T19:31:13Z")

</div>

Hello,

Im a beginner at flash video, and have been using the built in FLV component which I can apply actionscript fades to easily. However I don’t seem to be able to use them when I use the better method… NetStream. Here is an example fade:

```php
Movieclip.prototype.colorFadeIn = function() {
    var t = 0;
    var ease = 10;
    var myColor = new Color(this);
    var cto = myColor.getTransform();
    myColor.setTransform({ra:100, rb:255, ga:100, gb:255, ba:100, bb:255, aa:100, ab:0});
    var cWhite = myColor.getTransform();
    this._alpha = 0;
    this.onEnterFrame = function() {
        this._alpha += 10;
        if (this._alpha>100) {
            this._alpha = 100;
            t++;
            for (var c in cWhite) {
                cWhite[c] += (cto[c]-cWhite[c])/ease;
            }
            myColor.setTransform(cWhite);
            if (t>400) {
                myColor.setTransform(cto);
                delete this.onEnterFrame;
            }
        }
    };
};
 
var my_nc:NetConnection = new NetConnection();
my_nc.connect(null);
var my_ns:NetStream = new NetStream(my_nc);
my_video.attachVideo(my_ns);
my_ns.setBufferTime(5);
 
my_ns.play("http://www.helpexamples.com/flash/video/clouds.flv");
my_video.colorFadeIn();

```

Anyone got any ideas?

Thanks
