[ Team LiB ] |
Recipe 14.3 Adding a Video Object at Runtime14.3.1 ProblemYou want to add video (and audio) to a Flash movie at runtime. 14.3.2 SolutionCreate a movie clip symbol with an embedded Video object and set it to export for ActionScript. 14.3.3 DiscussionAlthough there is no way to create a Video object at runtime, you can create a movie clip with an embedded video at authoring time. If you set the movie clip symbol to export for ActionScript, you can add instances of the movie clip (including the embedded video) to your Flash movie at runtime with an attachMovie( ) method, as you would with any other exported movie clip. Here are the steps you should follow:
There are occasions when it is appropriate to create all the video instances at authoring time. However, in other cases it may be desirable or even imperative to add video instances dynamically at runtime. For example, to create a video conferencing application that can accept any number of clients, you must add video instances using the technique discussed in this recipe. 14.3.4 See AlsoRecipe 7.19. Note that adding the video symbol to the movie doesn't play any content. To play a video, you must add video content, as shown in step 6. For information on adding local video content to a video object, see Recipe 14.4. For information on adding video content from a net stream (content from the FlashCom server), see Recipe 14.7. |
[ Team LiB ] |