试图找到一个直接的答案.我将在actionscript 3中创建一些子类.我想知道是否可以覆盖父类.如果是这样,我是否需要在父类方法或什么方面放置覆盖分配器.
多谢你们
我正在使用flex测试Adobe AIR,我想通过打开文件对话框播放mp3,我这样做:
import flash.filesystem.*;
import flash.events.Event;
import flash.media.*;
import mx.core.SoundAsset;
public var loadedFile:File;
public var channel:SoundChannel;
public var song:SoundAsset;
private function loadFile():void {
loadedFile = new File();
loadedFile.browseForOpen("Open multimedia File");
loadedFile.addEventListener(Event.SELECT, fileSelected);
}
private function fileSelected(event:Event):void {
song = new SoundAsset()
song.load(URLRequest(loadedFile.url));
channel = song.play();
}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试打开文件时,在打开文件对话框关闭后,我收到此错误:
TypeError: Error #1034: Type Coercion failed: cannot convert "file:///C:/Users/Kedare/Music/05-Scene%20V%20~%20Prelude.mp3" to flash.net.URLRequest.
Run Code Online (Sandbox Code Playgroud)
我在谷歌或其他文档上找不到与此相关的任何内容,我发现的所有文档都与使用URL而不是本地文件播放声音有关:(
知道可能是什么问题吗?我能做什么 ?
谢谢 !
首先让我澄清一下,我是一个快手,这是我为某人做的一份自由职业。
我有一个带有符号的 flash 文件,我需要将其导出为 PNG 图像,出于某种原因,导出的图像的宽度和高度与 flash 文件中指示的不同。检查后我发现新尺寸甚至没有保持高度和宽度之间的原始比例。这发生在不同大小的几个符号上。这可能是什么原因?
我也考虑过找到一种方法来从 Flash 电影中的一个片段的 Flash 中拍摄快照,这可能吗?
了解我无法手动拍摄快照,因为我需要在大量符号上完成此操作。
谢谢
为什么不简单!
我只想限制输入文本仅允许带有 2 位小数的数字示例 22.44 10.55 6.00 55.72
我怎样才能用actionscript 2.0做到这一点?
祝福会加薪的帮手!
我看到有人使用label作为DataGrid的ItemRenderer,代码就在这里.我只是不明白1)这里的"@"是什么意思:"数据.@价格"2)"数据"的类型是什么,我怎么能用它?为了理解这一点,我应该搜索哪个关键字?
package {
import mx.controls.Label;
import mx.controls.listClasses.*;
public class PriceLabel extends Label {
private const POSITIVE_COLOR:uint = 0x000000; // Black
private const NEGATIVE_COLOR:uint = 0xFF0000; // Red
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
super.updateDisplayList(unscaledWidth, unscaledHeight);
/* Set the font color based on the item price. */
setStyle("color", (parseFloat(data.@price) <= 0) ? NEGATIVE_COLOR : POSITIVE_COLOR);
}
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢
我希望音乐总能播放,并且能够将不同的部分静音.这是一个项目,你点击不同的人,他们来生活播放音乐.停止和玩耍不会让他们陷入困境.我没有长时间使用动作脚本
var my_sound:Sound = new Sound();
my_sound.load(new URLRequest("triumphant.mp3" ) );
function setMute(vol){
var sTransform:SoundTransform = new SoundTransform(0);
sTransform.volume = vol;
SoundMixer.soundTransform = sTransform;
}
my_sound.play();
setMute(0)
//2.
//3.
var Mute:Boolean = true;
play_btn.addEventListener(MouseEvent.CLICK, toggleMuteBtn)
function toggleMuteBtn(event:Event) {
if (Mute) {
Mute = false;
setMute(1);
}
else{ Mute = true; setMute(0 );
}
}
我有一个Loader对象的Bitmap数据,我想把它切成32x32方块用作tile.最有效的方法是什么?
如何衡量在ActionScript 2.0中执行函数所需的时间?
ActionScript 3.0中有一种方法可以:
由于我的应用程序包含由其他开发人员编译的SWC文件,因此我无法直接访问创建URL请求和RTMP连接的ActionScript.
谢谢你的时间.
为什么我1120: Access of undefined property arrMonth.在线上出错arrMonth.push并如何纠正?
<fx:Script>
<![CDATA[
[Bindable]
public var arrMonth:Array = new Array();
arrMonth.push({label: "January"});
]]>
</fx:Script>
Run Code Online (Sandbox Code Playgroud) actionscript ×10
flash ×6
apache-flex ×3
image ×2
urlrequest ×2
action ×1
adobe ×1
air ×1
export ×1
itemrenderer ×1
mxml ×1
performance ×1
regex ×1
rtmp ×1
symbols ×1