
Application Development Tips and Tricks 77
Using one camera in multiple applications
Multiple applications (SWFs) can use the same camera at the same time, provided that they are
running in the same process. Generally, multiple browser windows are all in the same process, so
in the browser environment this capability works well.
However, a camera cannot be shared between applications running in two different processes—
for example, one in the browser and one in a stand-alone player.
Client object
When attaching methods to the Client object in server-side scripts, remember that all methods on
the client object can be called by a script in the SWF file on the client. You should not include
any methods on the client object that you would not want a remote computer to invoke. For
example, you wouldn’t want a client to be able to call a method that could disconnect an
application.
NetConnection object (client-side)
If an HTML page containing a movie is accessed differently (with regard to domain names) from
the way the movie itself accesses the Flash Communication Server, then the connection will not
be successful. This is a security feature of the Flash Player. But in some cases, this may be
inconvenient.
For example, if a web page containing a movie is served on an intranet from, say, http://
deptserver.mycorp.com, it can also be accessed simply by http://deptserver. If the page is accessed
via, say, http://deptServer/tcpage.htm, but the movie specifies deptServer.mycorp.com in as
targetURI, then the movie will not make a successful connection to the server. Similarly, if the
web page and movie are accessed as http://deptserver.mycorp.com/tcpage.htm, but the movie
specifies rtmp://deptserver as
targetURI, it will not connect.
There are a few things you can do to prevent the security policies from inconveniencing you or
your users. First, and easiest, is not to include a server name in
targetURI. (This is applicable
only if the Flash Communication Server and web server are running on the same machine.) To do
so, leave off the second slash in
targetURI. For example, the following commands will make the
Flash Player attempt to connect to the same host and domain as the web server the SWF file was
served from.
nc = new NetConnection();
nc.connect("rtmp:/myApp");
Higher image quality, lower motion quality my_cam.setQuality(0,90)
LAN Lower image quality, higher motion quality my_cam.setQuality(400000,0)
Higher image quality, lower motion quality my_cam.setQuality(0,100)
Bandwidth Effect Code
Komentáře k této Příručce