MXML is an XML-based user interface markup language first introduced by Macromedia in March 2004. Adobe Systems (which acquired Macromedia in December 2005) gives no official meaning for the acronym, but some developers suggest it should stand for "Magic eXtensible Markup Language" (which is a backronym).
MXML其实就类似于xhtml,xml用于定义控件及其属性,actionscript用来定义一些复杂的操作,类似的MXML也是事件驱动的,由event触发actionscript。
但是MXML比起xhtml的优势又在于哪里呢?
跨浏览器,更丰富的图形操作媒体播放能力。
关于ShareObject的开发,关键是先创建NetConnection,在其连接成功后用其创建一个share object(SharedObject.getRemote)。监听share object的SyncEvent.SYNC事件可以获取更新,修改share object可以对其进行更新。
对于如何录制视频,关键在于使用NetStream,将NetConnection,Camera和Microphone设置到NetStream上,然后调用他的publish()方法。
播放使用VideoDisplay控件,设置它的source属性然后调用它的play()方法,或者创建一个NetStream连接到媒体流上,然后调用video display的attachNetStream()和net stream的play()方法。
播放自己摄像头的图像使用VideoDisplay的attachCamera方法。
Application类有几个重要事件如下:
Application.onAppStart 当这个应用程序被服务器装载时调用。
Application.onAppStop 当这个应用程序被服务器卸载时调用。
Application.onConnect 当一个客户机连接到这个应用程序时调用。
Application.onDisconnect 当一个客户机从这个应用程序断开连接时调用。
Application类有几个重要方法如下:
Application.acceptConnection() 接受一个来自客户机的至一个应用程序的连接。
Application.broadcastMsg() 向所有连接的客户机广播一条消息。
Application.disconnect() 从服务器断开一个客户机的连接。
Application.rejectConnection() 拒绝至一个应用程序的连接。
NetConnection用于客户端(主动发起连接的一方,所以也可能是服务器连接另一台服务器)
NetConnection.client上的方法可以被连接的另一方调用(所以flash上经常有netConnection.client = this的方法)
NetConnection.call()用于调用对方的方法。
Client用于服务器端(被动连接的一方)
Client上的方法可以被连接的另一方调用。
Client.call用于调用对方的方法。
做视频聊天是需要综合利用上面提到各个类,除此之外还需要维护一个参加聊天的用户列表,在用户加入/离开时更新所有客户端。
Red5的ApplicationAdapter默认已经实现了各种功能,比如媒体录制、播放、共享对象等等,所以只有真的有需要才重载它的方法。
ApplicationAdapter的子类上所有的(public?)方法都可以被客户端call,要call客户端的方法就要把IConnection转成IServiceCapableConnection。
分享到:
相关推荐
About MXML programming files and Flex usage.
这是Ulrich Drepper的经典文章的英文原版,Ulrich Drepper是著名的德国工程师,是Glibc的第一代大当家(由于独断专行现在已经被褫夺了全力)。此文图文并茂的介绍了 RAM/DRAM的硬件原理、CPU的多级缓存机制、DMA原理...
Here you find all the data sets described and analysed in the textbook: "Complex Networks: Principles, Methods and Applications", V. Latora, V. Nicosia, G. Russo (Cambridge University Press, 2017) ...
this pdf talk about flex and compiler
Now, even programmers who know close to nothing about this technology can use simple, efficient tools to implement programs capable of learning from data. This practical book shows you how. By using...
This library allows to generate beautiful About Pages with less effort, it's fully customizable and supports opening specific intent View aboutPage = new AboutPage(this) .isRTL(false) .setImage(R....
谈论C语言及如何学习C语言。适合于C语言初学者学习,快速掌握编程能力。
A modern About Box for an Android App built on the daniel-stoneuk/material-about-library. Easily display the common items of an About Box in a modern Android friendly way About Android About Box is ...
He strongly believes that Flash Developers and Designers should be as comfortable with and passionate about code as they are about aesthetics and design. \"Flash allows you to bring everything ...
If-customer-from-A-no.-and-query-about-B-then-tagging-will-done-on-A-and-B-no.-will-be-captu 标记
Developing-Android-Apps-course ...Lesson 1 - Creating Project Sunshine - Learn how to create and run a simple ...- Learn about threading and how to make requests without slowing down your app - Learn how t
Create visually appealing and feature-rich applications by using Qt 5 and the C++ language Qt 5, the latest version of Qt, enables you to develop applications with complex user interfaces for multiple...
Everything about Transfer Learning and Domain Adaptation--迁移学习
He focuses on Flex, AIR, and Flex Builder. You can follow him on his blog http://corlan.org or twitter http://twitter.com/mcorlan Alin Achim is computer scientist with Adobe Systems. He is part of a ...
In this chapter, we think about stack and heap memory. Chapter 4, Lists, Lists, and More Lists, covers the first data structures: lists. Using several examples, this chapter goes into variations of ...
Pete Loshin writes and consults about Internet protocols and open source network technologies. Formerly on staff at BYTE Magazine, Information Security Magazine and other publications, his work ...
Part of the popular "Adobe Developer Library" co-published by O'Reilly and Adobe, "Enterprise Development with Flex" goes well beyond Flex tutorials and product documentation to suggest best ...
Chapter 5, Deployment Mode - Learn about the new and user friendly deployment model and several ways of deploying a service in Axis2. Chapter 6, Information Model - Learn how Axis2 stores it static ...
5. Extensions and Intensions 23 6. Extensions and Intensions of Sentences 25 7. Individual Descriptions 32 8. Frege's Method for Descriptions 35 9. Extensions and Intensions of Individual Expressions ...