Chapter 11
310
The steps required to communicate with Flash Communication Server MX are identical to those
you would use in ActionScript.
To create a NetConnection object:
•
Use the Lingo
newObject()
command.
myNetConObject = sprite(1).newObject("NetConnection")
To create a NetStream object:
•
Use the
newObject()
command and include the
NetConnection
object as a parameter:
myStream = sprite(1).newObject("NetStream", myNetConObject)
The
NetStream
object can send text messages without the need for a Flash sprite on the Stage.
To create a global NetConnection object that does not require a sprite reference:
•
Use the Lingo
newObject()
command and omit the sprite reference.
myNetConObject = newObject("NetConnection")
To create a global NetStream object that does not require a sprite reference:
•
Use the
newObject()
command and include the
NetConnection
object as a parameter, and
omit the sprite reference:
myStream = newObject("NetStream", myNetConObject)
To send text messages with the NetStream object:
•
Use the send command.
myStream.send(
handlerName
{,
p1
, ...,
pN
})
To send audio or video, you need to associate a camera and microphone with the
NetStream
object.
To associate a video camera with the NetStream object:
•
Use the ActionScript attachVideo command.
myStream.attachVideo(
source
)
To associate a microphone with the NetStream object:
•
Use the ActionScript attachAudio command.
myStream.attachAudio(
source
)
To publish a video, audio, or other data stream with the NetStream object:
•
Use the ActionScript publish command.
mystream.publish(
whatToPublish
)
To play a non-video data stream from the server with the NetStream object:
•
Use the ActionScript play command
mystream.play(
whatToPlay
)
Содержание DIRECTOR MX-USING DIRECTOR MX
Страница 1: ...Using Director MX Macromedia Director MX...
Страница 12: ...Contents 12...
Страница 156: ...Chapter 4 156...
Страница 202: ...Chapter 6 202...
Страница 244: ...Chapter 7 244...
Страница 292: ...Chapter 10 292...
Страница 330: ...Chapter 12 330...
Страница 356: ...Chapter 13 356...
Страница 372: ...Chapter 14 372...
Страница 442: ...Chapter 16 442...
Страница 472: ...Chapter 18 472...
Страница 520: ...Chapter 19 520...
Страница 536: ...Chapter 20 536...
Страница 562: ...Chapter 23 562...
Страница 566: ...Chapter 24 566...
Страница 602: ...Chapter 27 602...