Answer the question
In order to leave comments, you need to log in
How to play a video right after it's loaded in ActionScript?
How to play a video right after it's loaded in ActionScript?
There is a site where SWF video automatically plays, but with a delay of 10-12 seconds, and I need it to start playing immediately after loading.
Previously, I didn’t work with ActionScript and I can’t find the method that is responsible for this.
package noamcohen_fla
{
import fl.video.FLVPlayback;
import flash.display.MovieClip;
import flash.utils.Dictionary;
public dynamic class MainTimeline extends MovieClip
{
public var btnPlayPause:PlayPauseButton;
public var __setPropDict:Dictionary;
public var lastVisit:Object;
public var flvPlayer:FLVPlayback;
public var is24hoursUp:Boolean;
public var muteButton:MuteButton;
public var btnGotoWebsite:MovieClip;
public function MainTimeline()
{
this.__setPropDict = new Dictionary(true);
super();
addFrameScript(0,this.frame1,1,this.frame2);
}
public function removeAllCuePointsFromFLV() : *
{
var _loc1_:Object = null;
_loc1_ = new Object();
while(_loc1_ != null)
{
_loc1_ = this.flvPlayer.removeASCuePoint(1);
}
}
public function onFLVCuePoint(param1:Object) : *
{
trace("cuepoint : " + param1.info.name);
}
function frame1() : *
{
if(this.__setPropDict[this.flvPlayer] == undefined || int(this.__setPropDict[this.flvPlayer]) != 1)
{
this.__setPropDict[this.flvPlayer] = currentFrame;
this.__setProp_flvPlayer_Scene1_video_1();
}
this.lastVisit = new Object();
this.flvPlayer.bufferTime = Number(Number(0));
this.flvPlayer.playPauseButton = this.btnPlayPause;
this.flvPlayer.muteButton = this.muteButton;
this.btnPlayPause.buttonMode = true;
this.muteButton.buttonMode = true;
this.flvPlayer.addEventListener("cuePoint",this.onFLVCuePoint);
this.flvPlayer.source = "https://myoffshorecorporation.com/noamcohenintrokeyed.flv";
this.flvPlayer.addASCuePoint(104,"finished");
this.lastVisit = SharedObject.getLocal("userLastVisit");
stop();
}
function frame2() : *
{
stop();
navigateToURL(new URLRequest("javascript:hideWhenFinished(); void(0) ;"),"_self");
}
function __setProp_flvPlayer_Scene1_video_1() : *
{
try
{
this.flvPlayer["componentInspectorSetting"] = true;
}
catch(e:Error)
{
}
this.flvPlayer.align = "center";
this.flvPlayer.autoPlay = true;
this.flvPlayer.scaleMode = "maintainAspectRatio";
this.flvPlayer.skin = "";
this.flvPlayer.skinAutoHide = false;
this.flvPlayer.skinBackgroundAlpha = Number(Number(0.85));
this.flvPlayer.skinBackgroundColor = uint(uint(4697035));
this.flvPlayer.source = "https://myoffshorecorporation.com/noamcohenintrokeyed.flv";
this.flvPlayer.volume = Number(Number(1));
try
{
this.flvPlayer["componentInspectorSetting"] = false;
return;
}
catch(e:Error)
{
return;
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question