[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash] ActionScript on gnash
From: |
Meryl Silverburgh |
Subject: |
[Gnash] ActionScript on gnash |
Date: |
Sat, 10 Feb 2007 14:46:36 -0600 |
Hi,
Can you please tell me if gnash currently supports anonymous function like this:
var v1 = function () {
....
}
or this:
this.ns.onMetaData = function (obj) {
...
}
movieClip 142 __Packages.logic.MovieLoader {
#initclip
if (!_global.logic) {
_global.logic = new Object();
}
if (!_global.logic.MovieLoader) {
var v1 = function () {
this.started = false;
this.nc = new NetConnection();
this.nc.connect(null);
this.ns = new NetStream(this.nc);
this.ns.setBufferTime(2);
var o = this;
this.ns.onMetaData = function (obj) {
if (obj.duration != undefined) {
o.movieTime = obj.duration;
if (obj.keyframes) {
o.cues = {'times': obj.keyframes.times, 'positions':
obj.keyframes.filepositions};
}
} else {
o.movieTime == undefined;
o.cues = undefined;
}
};
this.ns.onStatus = function (object) {
if (object.code == 'NetStream.Play.Stop') {
if (o.movie.is_playing) {
o.movie.endMovie();
}
} else {
if (object.code == 'NetStream.Play.Start') {
o.started = true;
o.movie.overlay.hide();
} else {
if (object.code == 'NetStream.Buffer.Full') {
if (o.movieTime && o.movie.movieTime == undefined) {
o.movie.movieTime = o.movieTime;
} else {
if (o.movie.movieTime == undefined && !o.api_loaded) {
o.movie.getMovieInfo();
}
}
} else {
if (object.code == 'NetStream.Play.StreamNotFound') {
if (o.movie.is_embed && !o.movie.api_loaded) {
o.movie.getMovieInfo();
}
o.loadLater();
}
}
}
}
};
};
logic.MovieLoader = v1;
var v2 = v1.prototype;
v2.loadLater = function () {
if (this.interval_id) {
this.ns.play(this.file + this.append_vars);
this.ns.pause(!this.started);
clearInterval(this.interval_id);
this.interval_id = undefined;
} else {
this.interval_id = setInterval(this, 'loadLater',
this.wait_time * 1000);
this.wait_time *= 5;
}
};
v2.load = function (base_url, video_id, track_id, _append_vars) {
var v2 = base_url + 'get_video?video_id=' + video_id + '&t='
+ track_id;
if (this.interval_id) {
clearInterval(this.interval_id);
this.interval_id = undefined;
}
if (v2 != this.file) {
this.append_vars = _append_vars;
this.file = v2;
this.movieTime = undefined;
this.wait_time = 5;
this.started = false;
}
};
v2.setMovie = function (m) {
this.movie = m;
};
v2.die = function () {
this.started = false;
this.ns.close();
if (this.interval_id) {
clearInterval(this.interval_id);
}
};
v2.preLoad = function () {
this.ns.play(this.file + this.append_vars);
this.ns.pause(true);
};
v2.start = function () {
this.ns.play(this.file + this.append_vars);
this.started = true;
};
ASSetPropFlags(logic.MovieLoader.prototype, null, 1);
}
#endinitclip
}
movieClip 143 __Packages.logic.SoundController {
#initclip
if (!_global.logic) {
_global.logic = new Object();
}
if (!_global.logic.SoundController) {
var v1 = function () {
super();
var o = this;
var v4 = function () {
o.knob.highLight();
o.onEnterFrame = function () {
var v2 = this._xmouse - o.sound_bar._x;
if (v2 < 0) {
v2 = 0;
} else {
if (v2 > o.sound_bar._width) {
v2 = o.sound_bar._width;
}
}
this.hideMute();
this.knob._x = v2 + o.sound_bar._x;
o.movie.setVolume(o.getSoundPos(this.knob._x));
};
};
this.sound_bar.onPress = v4;
this.knob.onPress = v4;
var v6 = function () {
o.knob.normal();
var v2 = o.getSoundPos(o.knob._x);
o.movie.setVolume(v2);
delete this._parent.onEnterFrame;
};
this.knob.onReleaseOutside = v6;
this.knob.onRelease = this.knob.onReleaseOutside;
this.sound_bar.onReleaseOutside = this.knob.onReleaseOutside;
this.sound_bar.onRelease = this.knob.onReleaseOutside;
this.sound_button.onRelease = function () {
o.movie.toggleMute();
};
};
logic.SoundController = v1;
logic.SoundController extends MovieClip;
var v2 = v1.prototype;
v2.registerMovie = function (m) {
this.movie = m;
var o = this;
m.onShowMute = function () {
o.showMute();
};
m.onShowVolume = function (v) {
o.hideMute();
o.showVolume(v);
};
};
v2.getSoundPos = function (pos) {
var v2 = Math.round((pos - this.sound_bar._x) * 100 /
this.sound_bar._width);
v2 = Math.min(v2, 100);
return Math.max(v2, 0);
};
v2.showMute = function () {
this.showVolume(0);
};
v2.hideMute = function () {};
v2.showVolume = function (v) {
var v3 = v * this.sound_bar._width / 100 + this.sound_bar._x;
this.knob._x = v3;
this.showBars(v);
};
v2.showBars = function (v) {
var v3 = Math.round(v * this.num_bars / 100);
var v2 = 1;
while (v2 <= this.num_bars) {
if (v2 <= v3) {
this['v' + v2]._visible = true;
} else {
this['v' + v2]._visible = false;
}
++v2;
}
if (v3 == 0) {
this.sound_button._alpha = 50;
} else {
this.sound_button._alpha = 100;
}
};
v2.num_bars = 4;
v2.volume_spacer = 5;
v2.vs_space = 5;
v2.muted = false;
ASSetPropFlags(logic.SoundController.prototype, null, 1);
}
#endinitclip
}
- [Gnash] ActionScript on gnash,
Meryl Silverburgh <=
- Re: [Gnash] ActionScript on gnash, strk, 2007/02/11
- Re: [Gnash] ActionScript on gnash, ann, 2007/02/11
- Re: [Gnash] ActionScript on gnash, Meryl Silverburgh, 2007/02/11
- Re: [Gnash] ActionScript on gnash, strk, 2007/02/11
- Re: [Gnash] ActionScript on gnash, Meryl Silverburgh, 2007/02/11
- Re: [Gnash] ActionScript on gnash, strk, 2007/02/11
- Re: [Gnash] ActionScript on gnash, Meryl Silverburgh, 2007/02/13
- Re: [Gnash] ActionScript on gnash, strk, 2007/02/13
- Message not available
- Message not available
- [Gnash] ActionScript on gnash, Meryl Silverburgh, 2007/02/19
- Re: [Gnash] ActionScript on gnash, strk, 2007/02/19