当前位置:首页>>平面设计教程>>Flash教程>>正文

用 JavaScript 控制 Flash 播放器的方法汇总

文章出处: 作者: 发布时间:2007-06-15 收藏到QQ书签

说明:含例句的方法我已作了测试。
  
播放动画:Play()

  例:(网页中的 Flash id).Play();

停止动画:StopPlay()

动画是否正在播放:IsPlaying()

跳转到某帧:GotoFrame(frame_number)

获取动画总帧数:TotalFrames()

回传当前动画所在帧数:CurrentFrame()

使动画返回第一帧:Rewind()

放大指定区域:SetZoomRect(left,top,right,buttom)

改变动画大小:Zoom(percent)

使动画在 x,y 方向上平移:Pan(x_position,y_position,unit)

返回动画被载入的百分比:PercentLoaded()

加载动画:LoadMovie(level_number,path)

  例:(网页中的 Flash id).LoadMovie(0, "***/***.swf");

movie_clip 跳转到指定帧数:TGotoFrame(movie_clip,frame_number)

  例:(网页中的 Flash id).TGotoFrame("_root.实例名.次实例名",帧数);

movie_clip 跳转到指定标签:TGotoLabel(movie_clip,label_name)

  例:(网页中的 Flash id).TGotoLabel("_root.实例名.次实例名","标签名");

回传 movie_clip 当前帧:TCurrentFrame(movie_clip)

回传 movie_clip 当前标签:TCurrentLabel(movie_clip)

播放 movie_clip:TPlay(movie_clip)

停止 movie_clip 的播放:TStopPlay(movie_clip)

获取变量:GetVariable(variable_name)

变量赋值:SetVariable(variable_name,value)

call 指定帧上的 action:TCallFrame(movie_clip,frame_number)

call 指定标签上的 action:TCallLabel(movie_clip,label)

获取 movie_clip 的指定属性:TGetProperty(movie_clip,property)

设置 movie_clip 的指定属性:TSetProperty(movie_clip,property,number)


Google