Flash platform – обзорный курс. Лекция 3

Download Flash platform –  обзорный курс. Лекция 3

Post on 30-Dec-2015

29 views

Category:

Documents

5 download

Embed Size (px)

DESCRIPTION

Flash platform . 3. DisplayList . Display List . . DisplayObject .filters :Array flash.filters GlowFilter BlurFilter DropShadowFilter - PowerPoint PPT Presentation

TRANSCRIPT

Flash platform . 3

DisplayList Flash platform . 3Display List

DisplayObject.filters:Array flash.filtersGlowFilterBlurFilterDropShadowFilterColorMatrixFilterGradientBevelFilterGradientGlowFilterConvolutionFilterDisplacementMapFilterShaderFilter

DisplayObject.filters:Array flash.filtersGlowFilterBlurFilterDropShadowFilterColorMatrixFilterGradientBevelFilterGradientGlowFilterConvolutionFilterDisplacementMapFilterShaderFilter

myObject.filters = [new BlurFilter(), new GlowFilter(0x00FF00)];DisplayObject.mask

DisplayObject.mask:DisplayObject

var mask:Shape = new Mask();//draw maskmyObject.mask = mask;flash.display.BitmapData.draw(source:IBitmapDrawable, matrix:Matrix = null, colorTransform:flash.geom:ColorTransform = null, blendMode:String = null, clipRect:Rectangle = null, smoothing:Boolean = false):void

Display with new Bitmap().getPixels(rect:Rectangle):ByteArray . flash.utils.ByteArray - ByteArrayByteArray.length:uint.position:uint.readByte():int.readBytes(bytes:ByteArray, offset:uint = 0, length:uint = 0):void.readBoolean():Boolean.readDouble():Number, readFloat():Number, readInt():int etc.readUTF():String, .readUTFBytes(length:uint):String, .readMultiByte(length:uint, charSet:String):String.readObject():*.write*

flash.mediaSoundMicrophoneVideoCamera

-flash.media.Soundnew Sound();sound.load(new URLRequest(soundUrl.mp3));sound.play(startTime:Number = 0, loops:int = 0, sndTransform:flash.media:SoundTransform = null):SoundChannelsound.close():voidsound.extract(target:ByteArray, length:Number, startPosition:Number = -1):Numbersound.id3:ID3Info

Events:Event.OPENProgressEvent.PROGRESSEvent.COMPLETEIOErrorEvent.IO_ERROREvent.ID3SampleDataEvent.SAMPLE_DATA

flash.media.SoundTransform.volume : Number (0 1)

flash.display.SimpleButton.soundTransformflash.display.Sprite.soundTransformflash.media.Microphone.soundTransformflash.media.SoundChannel.soundTransformflash.media.SoundMixer.soundTransformflash.net.NetStream.soundTransformflash.media.SoundChannel.position:Number (in ms).soundTransform:SoundTransform.leftPeak:Number.rightPeak:Number.stop()

Events:Event.SOUND_COMPLETEflash.media.SoundMixerGlobal sound control class.soundTransform:SoundTransform.stopAll():void.computeSpectrum(outputArray:ByteArray, FFTMode:Boolean = false, stretchFactor:int = 0):void

flash.media.Microphone.getMicrophone(index:int = -1):Microphone.names:Array

Events:ActivityEvent.ACTIVITYStatusEvent.STATUSSampleDataEvent.SAMPLE_DATAflash.media.VideoExtends DisplayObject.attachCamera(camera:Camera):void.attachNetStream(netStream:NetStream):void.clear():void.videoHeight:int.videoWidth:int.smoothing:Booleanflash.media.Camera.names:Array.getCamera(name:String = null):Camera.setMode(width:int, height:int, fps:Number, favorArea:Boolean = true):void

Events:ActivityEvent.ACTIVITYStatusEvent.STATUS flash.netURLLoaderURLStreamNetConnection, NetStreamXMLSocket, Socket URLLoader.load(request:URLRequest):voidURLRequest new URLRequest(url:String = null).method URLRequestMethod.GET/URLRequestMethod.POST.data data to be sent. URLVariables/ByteArray/String

.dataFormat:String = URLLoaderDataFormat.TEXTURLLoaderDataFormat.BINARYURLLoaderDataFormat.VARIABLES. data:*.bytesTotal:uint .bytesLoaded:uintEvents:

Event.OPENProgressEvent.PROGRESSSecurityErrorEvent.SECURITY_ERRORIOErrorEvent.IO_ERRORHTTPStatusEvent.HTTP_STATUSEvent.COMPLETEvar request:URLRequest = new URLRequest(http://mydomain.com/service);var data:URLVariables = new URLVariables();data.user = nikitap;data.action = remove;/// etcrequest.data = data;request.method = URLRequestMethod.POST;var loader:URLLoader = new URLLoader(request);loader.addEventListener(Event.COMPLETE, loader_completeHandler);//.private function loader_completeHandler(event:Event):void{var loader:URLLoader = URLLoader(event.target);trace(loader.data);}

flash.net.URLStream ProgressEvent.PROGRESS ByteArray (IDataInput)flash.net.FileReference, ; .browse(typeFilter:Array = null):Boolean.load():void.download(request:URLRequest, defaultFileName:String = null):void.save(data:*, defaultFileName:String = null):void.upload(request:URLRequest, uploadDataFieldName:String = "Filedata", testUpload:Boolean = false):void.data : ByteArray.name : String.size : Number.type : Number

Events:Event.OPEN, ProgressEvent.PROGRESS, Event.COMPLETEEvent.SELECT, Event.CANCEL

flash.net.NetConnection / flash.net.NetStream .flv/.f4v HTTP Flash Remoting (BlazeDZ, ZendAMF, AMFPHP, LCDS, GraniteDS, etc)RTMP-cP2P-cflash.net.NetConnection - .f4v-var nc:NetConnection = new NetConnection();nc.connect(null);var ns:NetStream = new NetStream(ns);ns.play(http://mydomain.com/myvideo.f4v);var video:Video = new Video();video.width = 640;video.height = 480;video.attachNetStream(ns);addChild(video);flash.net.XMLSocket / flash.net.SocketTCP XMLSocket null-terminated messages

.connect(host:String, port:int):void(for XMLSocket) .send(object:*)(for Socket) the same as ByteArray

Events:Event.CONNECT, Event.CLOSE(for XMLSocket) DataEvent.DATA (.data received data)(for Socket) ProgressEvent.SOCKET_DATA

flash.media.Camera

Recommended

View more >