AS2中Flash传参问题

今天,一个简单的传参,搞了大半天。一直在<noscript>加参数,怎么试都没用,Flash原来默认调用的是JS段:<script language="JavaScript" type="text/javascript">。

AS2源代码:

_root.aaa或者this.aaa

HTML源代码:

<script language="JavaScript" type="text/javascript">
 AC_FL_RunContent(
  'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
  'width', '500',
  'height', '280',
  'src', 'Record',
  'quality', 'high',
  'pluginspage', 'http://www.adobe.com/go/getflashplayer',
  'align', 'middle',
  'play', 'true',
  'loop', 'true',
  'scale', 'showall',
  'wmode', 'window',
  'devicefont', 'false',
  'id', 'Record',
  'bgcolor', '#ffffff',
  'name', 'Record',
  'menu', 'true',
  'allowFullScreen', 'false',
  'allowScriptAccess','sameDomain',
  'movie', 'Record',
  'flashvars', 'aaa=aaa',
  'salign', ''
  ); //end AC code
</script>
<noscript>
 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="500" height="280" id="Record" align="middle">
 <param name="allowScriptAccess" value="sameDomain" />
 <param name="allowFullScreen" value="false" />
 <param name="movie" value="Record.swf?aaa=aaa" />
    <param name="quality" value="high" />
    <param name="flashvars” value="aaa=aaa″ />
    <param name="bgcolor" value="#ffffff" />
    <embed src="Record.swf?aaa=aaa" flashvars="aaa=aaa" quality="high" bgcolor="#ffffff" width="500" height="280" name="Record" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
 </object>
</noscript>

了解一些FMS的基本概念

一、什么是FMS     

     Macromedia于2002年年末发布了令人惊异的FMS的前一个版本Flash Communication Server MX服务器(简称FCS)。后来该名为Flash Media Server(简称FMS),使用FMS你只需要配备Web摄像头和麦克风,并加上十几行ActionScript脚本便可以完成一个电视会议系统。

FMS给全世界的人带来一种全新的通讯方式。有了FMS服务器,您可以参加实时网络会议;使用FMS的功能在工作中进行协作以及通过Internet或企业Intranet共享信息。

还不只是这一点,Flash Player的强大功能使得实时通讯和应用程序的集成由梦想变为现实,这正是未来网络软件发展的趋势,这都是Flash Player惹的“火”。

Flash Media Server(简称FMS)服务器是用于用户之间相互通讯的新平台,它集成了Flash多媒体交互的特性,又添加了实时音频、实时视频和实时数据流等新特色,使用该平台,你可以通过网络存储录制下来的音频、视频,也可以共享数据对象,并且可以将这些音频、视频和共享数据对象传递给多个客户端,实现实时同步共享。该平台集成了通讯功能和应用程序功能,它通过Flash Player(Flash Player 6或更高)在客户端提供音频共享、视频共享和共享数据流,为用户带来了更为丰富的体验。

二、FMS的传输协议

FMS使用实时通讯协议(RTMP),RTMP 是一种未加密的TCP/IP协议,专门设计用来高速传送音频、视频和数据信息。

使用FMS可以捕获(甚至录制)用户客户端的视频和音频流。信息通过FMS使用Real-Time Messaging Protocol (RTMP)协议被传递到客户端(用户计算机上的Flash Player)。当一个Flash影片应用程序要使用 FMS时,Flash Player就连接到服务器,这样就在客户端Flash Player和FMS之间提供了往复的源源不断的信息流,称为network stream(网络流)。其他的用户也可以同时连接到相同的FMS接收信息、更新数据以及音频和视频,这些都是“网络流”。

三、FMS的特色

FMS是一个完全基于软件环境的多媒体实时通讯环境,代表了当前实时通讯领域内的发展方向,并且,其自身也融合了大量的新特色,用于创建下一代通讯应用程序,这些新特色包括:
1、它提供了一个高效高性能的运行时,该“运行时”不但可以用于执行代码、处理数据内容,并且还可以进行通讯。
2、它将内容、通讯功能和应用程序界面集成进一个通用环境,这个通用环境就是Flash Player,通过强大且分布广泛的Flash Player,使得通过FMS进行通讯变得更加便利。
3、它为交互性提供了强大、高扩展性的对象模型。在为FMS开发Flash通讯应用程序的过程中,您就会慢慢认识到FMS无处不在的面向对象开发的特点。
4、它还建立了一个高效的组件架构模型,使用该组件架构模型可以创建高效的Flash通讯组件,而使用组件和其它的可重用模块,可以使你快速的开发基于FMS的通讯应用程序。
5、它还允许使用应用程序服务器提供的web服务和数据服务,从而可以和其它的应用服务器技术结合起来以创建功能更强大、更完整的富媒体应用程序。
6、它并且可以识别那些处于连接状态和处于未连接状态的客户端,以降低网络负载。
7、使用它,你可以将通讯应用程序客户端轻松的部署在多个平台和设备上,这多亏了Flash Player的广泛使用。

使用FMS和Flash创作环境,你可以非常轻松迅速的创建即时通讯应用程序,它可以让两个或多个的用户实现即时交流(交流可以使用文字、音频和视频)。例如,你可以使用FMS创建会议系统、在线社区、客户支持、销售支持、培训、远程展示或者即时消息系统。FMS是一个实时数据流平台,使用该平台加上客户端Flash Player的支持,可以将实时的数据流通过网络传递到Internet、PDA、iTV或者其它的设备上。

FMS的功能平台由两部分组成:服务器提供通讯方式;Flash影片应用程序(SWF文件)提供终端用户界面。你可以使用Flash创作工具作为开发环境创建Flash影片应用程序,该影片应用程序使用FMS提供的服务(也就是位于FMS上的Flash通讯应用程序)。有时你也可以编写服务端脚本为通讯应用程序添加新的功能,使用服务端脚本可以更灵活的控制共享状态信息,并且可以作为一个负载平衡器调节多用户之间的实时交互。

注:以上内容主要来自互联网和相关书籍,如有相同之处,纯属巧合。

Java运行时环境初始化时出现错误,你可能需要重新安装Flash

继续上一个帖子,CS4好了一段时间后那个问题又出现了,转用CS3,一切正常,一段后又出现了,问题,再次Google,解决方法如下:

1.安装JRE。

2.在Flash安装目录下建立JVM目录。

3.将JRE安装目录下的所有文件复制到Flash\JVM目录下即可解决问题。

奇怪的Flash bug

今天接到Daniel的AMG Flash,发布时一直报错:"Error initializing Java Runtime Environment - You may need to reinstall Flash"。

PS:5005: Unknown error optimizing byte code

开始,以为是环境问题,查了Google也说是Java和Flash的配置有冲突,可能是装了新的JAVA导致的。所以回家后重装了Flash,还是老样子,没有用。

然后,就想,一定是那个Flash的问题,新建一个新的文件,把库导进入,但是发现元件都很大,一起导入会hand,只能一小批一小批导入,导到一个有70几张1360X768的图片的元件,一个一个也hand,只能找Daniel帮忙,也是花了九牛二虎导入完成,发现还是会有问题。

再后,肯定是原件上的问题,一个一个元件删除,每删除一批,还要重启Flash,才能在发布验证。最后把那个有70几张大图的几个元件都删掉才好。

再然后,问题渐渐清楚了,可能是图片大小的问题。查看内存还有1G多,不可能资源不够。再到Google上结合图片资源等一查,找到了一个帖子:http://www.negush.net/blog/5005-unknown-error-optimizing-byte-code/comment-page-1/#comment-3573。在这个帖子的回复里找到叫JAVA_TOOL_OPTIONS的环境变量,心想可能有关,就胡乱改改吧,从-Xmx1024M改到-Xmx64M,不行,重启Flash才能测试效果,真是费时啊。直接改到-Xmx8M,不报错了,但是发布出来一片空白。。。唉,还是规矩点,改-Xmx32M,没想到成了,重新测试几次,没有问题,哈哈。。。终于。。。

最后,查了一下JAVA_TOOL_OPTIONS的-Xmx属性,Java核心文件估计大小有关,见下:

The size of the-Xmx option affects the core file size. Use these rules to estimate the size of the Java core
file:
• -Xmx is less than 1,500 MB. The core file will be less than or equal to 2 GB.
• -Xmx is between 1,500 and 2,400 MB. The core file will be less than or equal to 3 GB.
• -Xmx is greater than 2,400 MB. The core file will be less than or equal to 4 GB.

Data Visualization for the Web

Flare is an ActionScript library for creating visualizations that run in the Adobe Flash Player. From basic charts and graphs to complex interactive graphics, the toolkit supports data management, visual encoding, animation, and interaction techniques. Even better, flare features a modular design that lets developers create customized visualization techniques without having to reinvent the wheel.

http://flare.prefuse.org/demo

Silverlight vs. Flash – An Analysis Report

Silverlight

Flash
Silverlight Limitations:
Silverlight is missing Linux support, so people using Linux machine cannot run it on their machines and will have to stick to Windows and MAC OS. This limitation doesn’t exist with Flash.
Silverlight will (naturally) be using the WMV and Silverlight will add to the use of the WMV file format. Using the WMV video format essentially makes Silverlight useless for the vast majority of video websites such as YouTube. It cannot play .avi and .mov file. Flash Video turned Flash into a mechanism for delivering media with far more potential than any other solution that is .flv, no doubt Flash has also limitation to play other video file. For that Flash required codex for that player installed on Client machine.
Silverlight has no support for binding to models, binding to data, or even connecting to network resources to obtain data. Even flash is also lacking this area. Flash can read data source in terms of XML or text from some URL and can use it. Same thing silverlight also can read.
Silverlight doesn't even have support for things that should be considered a stock part of any library such as buttons, checkboxes, list boxes, list views, grids, etc. Probably in future release may Microsoft support it. Flash has rich set of control library.
Once the accessibility features are provided with Silverlight versions, any existing test tools that support driving UI through Accessibility will be fully enabled to automate Silverlight applications Flash test tools are already in place.
Silverlight 1.0 does not support GIF-file format. Even it doesn’t support BMP and other file format. It supports only JPG and PNG file format. Support all image formats.
Can’t do sound processing. With some media file sound processing can possible.
Socket programming is not possible. Flash allows creating XML Socket object.
Per pixel bitmap editing, bitmap filters (convolution, color matrix, etc), bitmap effects (drop shadow, blur, glow) cannot be done. Can do that.
Webcam and Microphone support it not there. Flash supports it.
Built in file upload/download support is not available. Inbuilt Upload/download support is there.
The performance of Silverlight and Flash will be nearly the same. While Silverlight is using XAML as description language in a non-compressed format size of Silverlight component is large.In practical implementation of similar component in Flash and Silverlight it has found that size of Silverlight component is approximately 10-20 times larger than Flash component. Size of flash component is smaller.
To deploy Silverlight to client browser more than one components ship. (1) XAML files (2) .dll if using C# (3) Silverlight.js (4) Custom JavaScript file. Images/videos/sounds also required deploy separately. Flash ships in single component that is .swf. Images/video/sounds also incorporated in single .swf package.
It has found in practical implementation of image animation, at some extent flickering occurs on image. To avoid this type of flickering in flash, refresh layout or cache bitmap functionalities are available.
It has found in practical implementation of video play, audio may start playing before showing movie on screen. It has also found video can still continue to play after redirecting to other page. It may be it is bug of current beta release. Flash doesn’t face these types of issues.
Right now not any support to play Silverlight object as Windows application. Flash can be played as Windows application also by downloading player for it. Flash can be also packaged as .exe which can be deploying standalone.
Silverlight is new in market and required time to get acceptance in market. Flash is exist from many years and have strong acceptance in market.
Silverlight Feature comparison with Flash Features:
Animation - Silverlight supports the WPF animation model, which is not only time based instead of frame based, but lets you define the start and end conditions and it will figure out how to get there for you. No need to deal with matrixes like in flash. Also no need to calculate positions on various frames. It just works.  The animation model is frame based.
Silverlight uses XAML. XAML is text based and can be output using a simple XML object. Flash stores its shapes using binary shape records. In order to write shape definitions, you will need to either license a 3rd party Flash file format SDK, or build your own. It isn’t too difficult, but it does require a bit of a learning curve.
The debugging with Silverlight is simpler than with flash. The debugging with flash is harder than Silverlight.
Silverlight lets you embed true type font information directly into your projects, and download that information with the downloader object.       Dealing with fonts is fairly complex with flash.
Rich set of development languages are available for Silverlight. Developer can use JavaScript as well as managed code VB.Net, C# for Silverlight development. Only Action Script can be used as programming tool in Flash.
XAML is declarative while ActionScript is imperative. Using imperative languages to build UIs goes back to the early days of DOS and Windows, when developers had to manage all of the API nuances when interacting with graphical panes. ActionScript is an imperative language, which brings itself the pitfalls of imperative languages when compared with declarative languages.
Web Services support for Silverlight Streaming:The services provided by Microsoft, called Silverlight Streaming, it allows users and developers to host their Silverlight content and apps with Microsoft, taking advantage of their extensive global network of datacenters and their content delivery network. Best of all, this service is free, and while currently it is only in alpha it allows users to upload up to 4GB of content, and to stream up to 1 million minutes of online video delivery at 700kbps, around DVD quality. Starting right now, you can build a total video content site using Silverlight at no cost. The future for this service looks good as they will incorporate Silverlight Streaming with the MSN Video ad network to allow you to easily monetize your video streams and participate in a revenue sharing opportunity with Microsoft while removing your distribution costs. There will also be a premium level of content delivery where you will be able to pay for higher levels of usage - the cost for this service is as yet unknown but expect it to be very low. There is not any such service provided by Flash to host the content and application with them. Because of the absence of any such service, building a video site based on Flash is not as cost effective as building a video content site using Silverlight. Moreover, because of the Silverlight Streaming service, the existing Video Content sites might be moving to Silverlight site.
Additional Support for mobile devices with desktop and desktop browsers:Silverlight is supported by Windows mobile device as part of a new service that the NBL have built. Silverlight applications and media streaming can be run on a mobile phone - so Silverlight even at this stage is about more than just the desktop browser and desktop market.  Silverlight may be seen soon on the Symbian OS too. Flash is not spread as across the vast majority of both desktops and mobiles platforms, as compared to Silverlight. Flash requires Flash Lite preinstalled on mobile devices.
Silverlight does not require video codec to run industry standard videos like .WMV Flash requires video codec to run .WMV videos.
Silverlight supports scalable video formats from HD to mobile. Flash does not support scalable video formats from HD to mobile
Silverlight supports Hardware-assisted editing and encoding solutions. Flash does not support Hardware-assisted editing and encoding solutions.
Silverlight has XAML based presentation layer for SEO.  Flash does not have XAML based presentation layer for SEO. 
Silverlight provides End-to-end server and application platform. Flash does not provide End-to-end server and application platform.
Media server licensing is cheaper than flash. Media server licensing is costlier than Silverlight.
Silverlight supports Scalable full screen video. Flash does not support Scalable full screen video.