= Embedding the player in Flex = As of version 4.2 of the JW Player, it is possible to embed the Player inside of a Flex application. This brief tutorial explains how. If you're an experienced Flex developer who wants to use the JW Player inside one of your applications, this document is for you. People have had difficulty in the past embedding the Player into a Flex application. The simplest way to pull the player into Flex was by using a SWFLoader to load in the compiled Player, but since the Player expected to be by itself on the Flash stage, resizing was a problem. == Getting started == Before you start, you'll need the latest version of the JW Player. It can be downloaded with Subversion: {{{ svn co http://developer.longtailvideo.com/svn/trunk }}} Next, create an empty Flex application. You'll then need to add the Player's source code tree to your application's source path. Right-click on your new Flex project, choose "Flex Build Path" and click the "Add Folder..." button. Navigate to the folder where you downloaded the player, and add it to the project. Then, copy the ''player.swf'' and ''video.flv'' files to your Flex Project's source path. == Code == Next, you can create applications that embed the player. Here is an example: {{{ 3.0) { // Pause the video after 3 seconds) playerObject.view.sendEvent(ViewEvent.PLAY, false); } timelabel.text = "Time tracker: " + evt.data.position; } ]]> }}} That's all there is to it. Note the divided horizontal box allows you to resize the width of the player as desired. == Player API == Through the '''playerObject''' set up in this application, you can access the [wiki:FlashAPI full API of the player], just like from javascript or from plugins.