flash player 10操作本地文件 |
| [来源:圣叹 blog | 作者:圣叹 | 时间:2008-05-25 | 点击: | 收藏本文 【大 中 小】] |
|
 从Lee Brimelow得知,flash player 10允许操作本地文件(读、写)。与AIR操作本地文件不同,普通flash player的本地文件操作无法悄无声息的后台进行,需要获取用户的允许方可进行。具体操作即使用fileReferce类的新方法:fileReferce.save()。此时,flash player会弹出对话框询问存储地址。 原文地址:http://www.gotoandlearn.com/player.php?id=76 视频地址:http://adobe.edgeboss.net/download/adobe/adobetv/gotoandlearn/astrofile.mov
此外flash magazine还公布了一份详细的flash player 10震撼人心的新特性列表:
New classes: Vector Class - Offers arrays with Type checking. Should (in theory) be faster than ordinary arrays and easier to debug since they'll only accept the correct data type. Lee Brimelow recently put out a Flash Player 10 tutorial where he shows how to use the new Vector type.
GraphicsBitmapFill and GraphicsEndFill Class - New classes for handling filling of bitmaps, great for creating shaders (textured triangles) on 3D models. Supports a matrix for advanced distortion as well as a smoothing option. In our interview with Adobe's Tom Barclay he mentions these features as eeither CPU or GPU accelerated.
GraphicsGradientFill, GraphicsSolidFill, GraphicsStroke and GraphicsPath Class - Same as above, but for gradients and line drawing.
GraphicsTrianglePath Class - Object for storing one single 3D triangle, complete with geometry, normals, culling and mapping data.
Shader Class - Allow you the create custom shaders for 3D graphics. A Shader applies rendering effects such as shadow, motion blur, specular highlights and other visual enhancements to 3D geometry at the time of rendering them to screen. This process makes fairly simple 3D models look visually richer than they really are. Rob Bateman has created a good example of what shaders are and what they offer for 3D in Flash. I don't know enough about shaders to tell how extensive this class is, but I expect it to provide massive speed enhancements to the current breed of community based 3D engines for Flash. This class has several supporting classes such as ShaderInput, ShaderJob, ShaderParameter, ShaderParameterType, ShaderEvent, ShaderFilter and ShaderPrecision. From looking at the ShaderParameterType class, It looks like the shaders will support up to four levels of rendering quality (antialiasing?). Very promising indeed!
SamplesCallbackEvent Class - An event class realted to audio. Allows you to get and set the position in the audio data.
Matrix3D Class - to render objects from 3D space to a 2D representation, you use a matrix function. This new matrix class is native to the Flash Player, offering a massive speed enhancement. The old matrix functions were not native so any 3D engine will get a nice speed boost just from adding support for this feature alone. The class offers a large set of methods for working with the matrix such as interpolation, decomposition and transforms. Related to this class is also the new classes Orientation3D, PerspectiveProjection, Transform, Utils3D and Vector3D.
New methods in existing classes: BitmapData Class - now supports getting and setting Vectors (getVector/setVector)
BlendMode class - provides constant values for visual blend mode effects. This class has a new static constant called SHADER. Shaders are often associated with rendering of 3D content. Interesting!
DisplayObject Class - This class handles all the display of objects in Flash (as the name implies). What's new is that EVERY single object now supports the third dimension. Where you formerly could set the X and Y position, you can now also set the Z position like this:
myMovieClip.z = 100;
Every object can rotate around the X, Y and Z axis (rotateX, rotateY, rotateZ) as opposed to formerly only being able to rotate in 2D. See Lee's 3D tutorial for an extensive example of this. You can also scale along the Z axis (scaleZ) as well as set the blendShader. Setting the blendShader sounds like it could be a way for using Pixel Bender to calculate the texture. Senocular has posted a tutorial that indicates this. This tutorial also mentions Graphics.lineShaderStyle(), a method not in the current Flash Player 10 beta, so it's clear that somebody in the community has a more recent version as well as some official documentation...
Graphics Class - Handles all the drawing of graphic primitives in the Flash Player. There's several new methods here. Some handle 3D drawing and some enhance the existing functionality. According to Adobe some of these commands can now be calculated by the users graphics card processors (GPU) for a massive speed boost.
Stage Class - has a new property for getting and setting a ColorCorrection. This is probably related to the new GPU acceleration as color fidelity isn't the best in 3D graphics cards as Flash Player engineer Tinic Uro writes.
Event Class - In AS3, we rely on events for most everything we do. New core events are related to text enditing (Clear, Copy, Cut, Select all, Paste), audio (samples_callback) as well as movie playback (Exit_frame and frame_constructed) . These latter two are especially interesting as exit_frame brings a feature many Director developers have been missing. They both give you more granular control over when your code is executed. Should prove very useful for component development and could potentially rid us of the ever annoying "When in doubt - wait one frame".
Microphone Class - This class gets new methods for getting and setting the audio codec. Flash Player 10 offers the new speex codec in addition to the existing and proprietary Nellymoser codec. Speex is a free, open source codec that is patent free so this is yet another great move towards openness from Adobe. This class now has a supporting class with constants for the two possible codecs (SoundCodec Class).
Sound class - This class has two new functions and that's all we need... The Sound.extract command will pull out audio data as a ByteArray so you can manipulate it as you please. Using samplesCallbackData, you can then write those data back to the audio stream. Keith Peters has a great sample with code on his blog.
FileReference Class - now have two new commands for loading and saving files straight from the users desktop. No more uploading to a server for manipulating files.
NetConnection and NetStream Class - These classes have several new features for anabling Peer 2 Peer (P2P) features via Flash Media Server. Some good discussion on the P2P feature at this blog with Justin Everett Church chiming in at the end to clear the air of confusion.
NetStreamInfo Class - Has been enhanced with several useful features that are probably related to the new dynamic streaming capabilities. Using the information provided by this class, other video streaming server vendors should be able to support similar features. There's two related classes that has changes as well: NetStreamPlayOptions and NetStreamPlayTransitions. These will allow for swapping streams while playing transitions, a feature I had planned to add for the AS3 version of video.maru.
Capabilities Class - gets a "hasColorCorrection" method. Probably a good idea to test agains this one before trying to set the color correction on the Stage object.
This article is not yet finished. What's remaining is essentially the new text related classes. They're very exensive! |
|
| 文章如果有错误或者缺少文件,请发邮件提交给我们 |
|
|
|
|
|
|
|
| >>> 最新评论:(共有 0 位网友发表了评论) 查看所有评论 |
|
|
| 发表评论 |
|
| ·本站发布内容均为客观表达作者观点,不代表闪无忧立场,请勿攻击和漫骂 |
| ·用户发表意见仅代表其个人意见,并且承担一切因发表内容引起的纠纷和责任 |
| ·本站管理人员有权在不通知用户的情况下删除不符合规定的评论信息或留做证据 |
| ·请客观的评价您所看到的资讯,提倡就事论事,杜绝漫骂和人身攻击等不文明行为 |
|
|
|
 |
业界杂谈 |
|
|
|
|
|
|
|