ActionScript 3 Papervision3D - 在Flex中嵌入DAE / Collada文件

[Embed(source="yourthing.DAE", mimeType="application/octet-stream")]
private var theModel:Class;
var byteArray:ByteArray = new theModel();
var yourDAE:DAE = new DAE();
yourDAE.load(byteArray, materal);
scene.addChild(yourDAE);

ActionScript 3 的DropShadowFilter

newFilter:DropShadowFilter = new DropShadowFilter(3, 45, 0x000000, .7, 8, 8, 1, 3);
object.filters = [newFilter];

ActionScript 3 flash中FLV视频的actionscript cuepoint监听器

// add an event listener to the video to listen for cuepoints
// in this case the videoclip instance name is 'vid' and the 
// function to be triggered by the listener is 'vidstuff'
// if you change the instance name change the code accordingly
this.vid.addEventListener(MetadataEvent.CUE_POINT, vidstuff);

// function triggered by the listener when we hit a cuepoint
function vidstuff(event:MetadataEvent):void
{

// stuff the function does goes below here


// stuff the function does goes above here
	
}
// end function triggered by the listener when we hit a cuepoint

ActionScript 3 导入必要的动作脚本以使用FLV和元数据[即。中cuePoints]

// this should be the first bit of code at the top of your
// actionscript for interactive video code.  this stuff needs to
// loaded and be ready for action before anything else
 
// import the necessary actionscript code for dealing
// with metadata embedded in video [ie. cuepoints]
import fl.video.*; 
import fl.video.MetadataEvent;
// import the necessary actionscript code for dealing
// with metadata embedded in video [ie. cuepoints]

ActionScript 3 actionscript3 - 跟踪动作以获取有关FLV视频中提示点的信息

/* ||||||||||||||||| CUEPOINT TRACES ||||||||||||||||||||
these trace actions are handy for returning the info that flash has about any cuepoints it encounters, embedded in an FLV [flash video] file. put these traces inside a cuepoint listener function to test whether flash is picking up the cuepoints in the first place, before you add any more complicated code.  these traces will display:

- the 'event' the listener has detected [ie. a cuepoint]
- the name of the cuepoint
- the type of the cuepoint [ie. 'event' or 'navigation']
- the time the cuepoint sits at in the video

[note: this code assumes your FLV video file has an instance name of 'vid'.  if you change the instance name change the "this.vid.playheadTime" part of the code accordingly]

this is the same trace code i demo'd in class.  i've just tidied it up a bit by adding in a few tabs [\t] and a linebreak [\n]at the end, so it formats up neater.  i cannae help it - i'm just such a perfectionist!
||||||||||||||||||||||||||||||||||||||||||| */

// begin traces
trace("listener detected: \t"+event.type);
trace("cuepoint is called: \t"+event.info.name);
trace("cuepoint is of type: \t"+event.info.type);
trace("vid playhead time: \t"+this.vid.playheadTime);
trace("------\n");
// end traces

ActionScript 3 Away3D本地3d到全球2d点

var sv:ScreenVertex = camera.screen(object3d);
var globalX:Number = sc.x + view.x;
var globalY:Number = sc.y + view.y;

ActionScript 3 使用sprite作为数组来保存对象

for(var i:int = 0; i<someContainerSprite.numChildren; i++){
    sTemp:Sprite = someContaier.getChildAt(i);
}

ActionScript 3 getMicrophone()

var deviceArray:Array = Microphone.names;
trace("Available sound input devices:");
for (var i:int = 0; i < deviceArray.length; i++)
{
trace(" " + deviceArray[i]);
}

var mic:Microphone = Microphone.getMicrophone();
mic.gain = 60;
mic.rate = 11;
mic.setUseEchoSuppression(true);
mic.setLoopBack(true);
mic.setSilenceLevel(5, 1000);

mic.addEventListener(ActivityEvent.ACTIVITY, this.onMicActivity);
mic.addEventListener(StatusEvent.STATUS, this.onMicStatus);

var micDetails:String = "Sound input device name: " + mic.name + '\n';
micDetails += "Gain: " + mic.gain + '\n';
micDetails += "Rate: " + mic.rate + " kHz" + '\n';
micDetails += "Muted: " + mic.muted + '\n';
micDetails += "Silence level: " + mic.silenceLevel + '\n';
micDetails += "Silence timeout: " + mic.silenceTimeout + '\n';
micDetails += "Echo suppression: " + mic.useEchoSuppression + '\n';
micText1.text = micDetails;

function onMicActivity(evt:ActivityEvent):void
{
trace("activating=" + evt.activating + ", activityLevel=" + mic.activityLevel);
meter_mc.mask_mc.scaleX = mic.activityLevel
}

function onMicStatus(evt:StatusEvent):void
{
trace("status: level=" + evt.level + ", code=" + evt.code);
}

ActionScript 3 loaderinfo变量

var keyStr:String;
var valueStr:String;
var theVars:Array = new Array();



try {
    
    var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
   	for (keyStr in paramObj) {
        valueStr = String(paramObj[keyStr]);
		theVars.push({key:keyStr, val:valueStr});
	
   }
    
   init();
} catch (error:Error) {
    trace(error.toString());
}

ActionScript 3 画一个向下的三角形

var _arrow:Shape = new Shape();			
_arrow.graphics.lineStyle(1, Colors.WHITE);
_arrow.graphics.beginFill(Colors.GREY, 1);
_arrow.graphics.moveTo(0, 0);
_arrow.graphics.lineTo(0, 0);
_arrow.graphics.lineTo(10, 0);
_arrow.graphics.lineTo(5, 7);
_arrow.graphics.endFill();
addChild(_arrow);