Вот на AS2:

Код AS1/AS2:
if(_root.ar_comppath == undefined){
_root.ar_comppath = '';
}
var conn = new NetConnection();
conn.connect(null);
var stream = new NetStream(conn);
my_vid.attachVideo(stream);
stream.onMetaData = function(info){
_root.isPlaing = true;
_root.tg = 'click';
}
stream.play(_root.ar_comppath + '0.flv');
function _play(st, tg){
clearInterval(_root.timer);
if (st) {
stream.pause(false);
_txt.text = 'play: ok, ' + tg + ', stream = ' + stream.time;
_root.isPlaing = true;
_root.tg = tg;
return;
}
_root.timer = setTimeout(function(){
if (_root.tg != tg) return;
if (tg == 'pause') return;
stream.pause(false);
_txt.text = 'play: ok, ' + tg + ', stream = ' + stream.time;
_root.isPlaing = true;
_root.tg = tg;
}, 10);
}
function _pause(tg){
clearInterval(_root.timer);
_root.timer = setTimeout(function(){
stream.pause(true);
_txt.text = 'pause: ok, ' + tg + ', stream = ' + stream.time;
_root.isPlaing = false;
_root.tg = tg;
}, 10);
}
На паузу прошито:

Код AS1/AS2:
on(release){
if (_root.isPlaing) _pause('pause');
else _play(1, 'pause');
}
on(rollOver){
_play(0, 'pause');
}
on(rollOut){
_pause('pause');
}
На основную кнопку (занимает всу площадь ролика) прошито:

Код AS1/AS2:
on(release){
getURL(_root.link1, _root.target);
_pause('click');
}
on(rollOver){
_play(0, 'click');
}
on(rollOut){
_pause('click');
}
Вот то же самое, на AS3:

Код AS3:
import flash.events.*;
var ar_comppath = this.loaderInfo.parameters['ar_comppath'] || '',
isPlaing = false,
tg,
timer;
var conn = new NetConnection();
conn.connect(null);
var stream = new NetStream(conn);
my_vid.attachNetStream(stream);
stream.addEventListener(NetStatusEvent.NET_STATUS, errorHandler);
stream.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, errorHandler);
stream.client = {
onMetaData: function(info){
isPlaing = true;
tg = 'click';
}
}
function errorHandler(e){
_txt.text = e.info.code;
}
stream.play(ar_comppath + '0.flv');
function _play(st, t){
clearInterval(timer);
if (st) {
stream.resume();
_txt.text = 'resume from pause';
isPlaing = true;
tg = t;
return;
}
timer = setTimeout(function(){
if (tg != t) return;
if (t == 'pause') return;
stream.resume();
_txt.text = 'resume from hide';
isPlaing = true;
tg = t;
}, 10);
}
function _pause(t){
clearInterval(timer);
timer = setTimeout(function(){
stream.pause();
isPlaing = false;
_txt.text = 'pause';
tg = t;
}, 10);
}
/* buttons */
function _clickRelease(e){
_pause('click');
try {
var ie:String = ExternalInterface.call("function(){return !!window.ActiveXObject}");
var url:String = LoaderInfo(this.root.loaderInfo).parameters['link1'];
if (ie) ExternalInterface.call('window.open',url);
else navigateToURL(new URLRequest(url), '_blank');
}catch (e:Error){}
}
function _clickOver(e){
_play(0, 'click');
}
function _clickOut(e){
_pause('click');
}
_click.addEventListener(MouseEvent.CLICK, _clickRelease);
_click.addEventListener(MouseEvent.MOUSE_OVER, _clickOver);
_click.addEventListener(MouseEvent.MOUSE_OUT, _clickOut);
function _pauseRelease(e){
if (isPlaing) _pause('pause');
else _play(1, 'pause');
}
function _pauseOver(e){
_play(0, 'pause');
}
function _pauseOut(e){
_pause('pause');
}
_pB.addEventListener(MouseEvent.CLICK, _pauseRelease);
_pB.addEventListener(MouseEvent.MOUSE_OVER, _pauseOver);
_pB.addEventListener(MouseEvent.MOUSE_OUT, _pauseOut);
Добавлено через 4 часа 1 минуту
Написал багрепорт в Адоб.
Добавлено через 24 часа 51 минуту
Скажите мне кто-нибудь что это не баг флеша и что это можно как-то обойти. Может кто костыль знает?