转换为AS3 AS2 [英] Converting AS3 to AS2

查看:203
本文介绍了转换为AS3 AS2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个问题。有一面旗帜是code与AS3,我们的系统只显示横幅最多的Flash Player 9,但Flash播放器9不支持AS3。那么,有没有办法做到这一点的最简单的方法?或者,我不得不重写它AS2?这里是code。

 进口对象类型:flash.events.Event;
进口flash.net.URLRequest;
进口flash.events.MouseEvent;
进口flash.media.SoundTransform;
进口flash.media.SoundMixer;


cierre.gotoAndStop(1);
SoundMixer.soundTransform =新的SoundTransform(0);
    video_player.autoPlay = TRUE;
video_player.source =video_500x374.f4v;

video_player.addEventListener(引发Event.COMPLETE,finVideo);

停止();


b2_btn.buttonMode = TRUE;

buttonclose.addEventListener(MouseEvent.CLICK,buttoncl);


功能buttoncl(五:事件):无效{
video_player.stop();
this.gotoAndStop(1);
}






VAR paramList:对象= this.root.loaderInfo.parameters;

b2_btn.addEventListener(MouseEvent.CLICK,的OpenURL);

功能的OpenURL(evtObj:MouseEvent)方法:无效{
VAR要求:的URLRequest =新的URLRequest(paramList [的clickTag]);
navigateToURL(请求_blank);
}





功能aBanner1(五:事件):无效{
video_player.stop();
this.gotoAndStop(1);
}

功能finVideo(五:事件):无效{
video_player.stop();
cierre.play();
}

功能setMute(体积){
VAR sTransform:的SoundTransform =新的SoundTransform(0,1);
sTransform.volume =卷;
SoundMixer.soundTransform = sTransform;
}
VAR静音:布尔= FALSE;
mutebutton.addEventListener(MouseEvent.CLICK,toggleMuteBtn);


功能toggleMuteBtn(事件:事件){
如果(静音){
    静音=假;
    setMute(0);

}其他{
    静音= TRUE;
    setMute(1);
}
}
 

解决方案

您需要使用AS2 FLV播放组件。你应该开始用干净的新AS2 FLA,并开始复制过的一切,除了组件的东西。

I have this problem. Have a banner which is code with AS3, and our system only displays banners up to Flash Player 9. But Flash Player 9 does not support AS3 . So is there a way to do it on the easy way? Or I have to rewrite it on AS2 ? Here is the code.

import flash.events.Event;
import flash.net.URLRequest;
import flash.events.MouseEvent;
import flash.media.SoundTransform;
import flash.media.SoundMixer;


cierre.gotoAndStop(1);
SoundMixer.soundTransform = new SoundTransform(0); 
    video_player.autoPlay = true;
video_player.source = "video_500x374.f4v";

video_player.addEventListener(Event.COMPLETE, finVideo);

stop();


b2_btn.buttonMode = true;

buttonclose.addEventListener(MouseEvent.CLICK,buttoncl);


function buttoncl(e:Event):void{
video_player.stop();
this.gotoAndStop(1);
}






var paramList:Object = this.root.loaderInfo.parameters;

b2_btn.addEventListener(MouseEvent.CLICK, openURL);

function openURL(evtObj:MouseEvent):void {
var request:URLRequest = new URLRequest(paramList["clickTag"]);
navigateToURL(request, "_blank");
}





function aBanner1(e:Event):void{
video_player.stop();
this.gotoAndStop(1);
}

function finVideo(e:Event):void{
video_player.stop();
cierre.play();
}

function setMute(vol) {
var sTransform:SoundTransform = new SoundTransform (0,1);
sTransform.volume = vol;
SoundMixer.soundTransform = sTransform; 
}
var Mute:Boolean = false;
mutebutton.addEventListener (MouseEvent.CLICK,toggleMuteBtn);


function toggleMuteBtn (event:Event) {
if(Mute) {
    Mute = false;
    setMute(0);

}else{
    Mute = true;
    setMute(1);
}
}

解决方案

You need to use the AS2 FLV Playback component. You should start with a clean new AS2 fla and start copying everything over except the components stuff.

这篇关于转换为AS3 AS2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆