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:
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