transitionButton.onRelease = rontarClickHandler;
closeButton.onRelease = closeBanner;
function closeBanner(evt:Object)
{
flash.external.ExternalInterface.call("rontar.plugins.fullScreen.close");
}
function rontarClickHandler(e)
{
if(_root.target == "_blank")
{
getURL(_root.link1, _root.target);
flash.external.ExternalInterface.call("rontar.plugins.fullScreen.close");
}
else
{
getURL(_root.link1, _root.target);
}
}
|
var timerSeconds = _root.timerClose;
var rontarTimerId;
function startTimer()
{
rontarTimerId = setInterval(showTimer ,1000)
}
function showTimer()
{
_root.fullscreenPanel.panelText.text = "возврат на сайт через " + timerSeconds + " секунд";
timerSeconds--;
if(timerSeconds == 0)
{
clearInterval(rontarTimerId);
flash.external.ExternalInterface.call("rontar.plugins.fullScreen.close");
}
}
function pauseTimer()
{
clearInterval(rontarTimerId);
}
Для старта обратного отсчёта вызовите функцию:
startTimer();
|
import flash.utils.Timer;
import flash.events.TimerEvent;
var flashVars = this.root.loaderInfo.parameters;
transitionButton.addEventListener(MouseEvent.CLICK, rontarClickHandler);
//transitionButton.buttonMode = true; //если в качестве кнопки используется мувиклип, раскомментируйте эту строку.
closeButton.addEventListener(MouseEvent.CLICK, closeBanner);
closeButton.buttonMode = true;
function closeBanner(evt:Object)
{
flash.external.ExternalInterface.call("rontar.plugins.fullScreen.close");
}
function rontarClickHandler(evt:MouseEvent)
{
if(flashVars.target == "_blank")
{
navigateToURL(new URLRequest(flashVars.link1), flashVars.target);
flash.external.ExternalInterface.call("rontar.plugins.fullScreen.close");
}
else
{
navigateToURL(new URLRequest(flashVars.link1), flashVars.target);
}
}
|
import flash.utils.Timer;
import flash.events.TimerEvent;
var flashVars = this.root.loaderInfo.parameters;
var rontarTimer:Timer = new Timer(1000, flashVars.timerClose);
rontarTimer.addEventListener(TimerEvent.TIMER, executeTimer);
rontarTimer.start();
fullscreenPanel.panelText.text = "Переход на сайт через " + flashVars.timerClose + " секунд";
function executeTimer(evt:TimerEvent)
{
fullscreenPanel.panelText.text = "Переход на сайт через " +(flashVars.timerClose - evt.target.currentCount)+ " секунд";
if(evt.target.currentCount == evt.target.repeatCount)
flash.external.ExternalInterface.call("rontar.plugins.fullScreen.close");
}
|