How to set source in VideoPlayer via actionscript?

Hi,
I'm trying to play video in spark.components.VideoPlayer by setting its source property. However, on playing the video doesn't play and comes out as garbled. Am I missing something here?
Here is the source code-
<?xml version="1.0" encoding="utf-8"?>
<!-- controls\videoplayer\VideoPlayerEvent.mxml-->
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                       xmlns:s="library://ns.adobe.com/flex/spark"
                       xmlns:mx="library://ns.adobe.com/flex/mx">
    <s:layout>
        <s:VerticalLayout/>
    </s:layout>
    <fx:Script>
        <![CDATA[
            import org.osmf.events.MediaPlayerStateChangeEvent;
            import org.osmf.events.TimeEvent;
            import spark.components.VideoPlayer;
            protected function vpCompleteHandler(event:TimeEvent):void {
                myTA.text = "Video complete - restarting."
            protected function
                vpMediaPlayerStateChangeHandler(event:MediaPlayerStateChangeEvent):void {
                if (event.state == "loading")
                    myTA.text = "loading ...";
                if (event.state == "playing")
                    myTA.text = "playing ...";
            private function onPlayVideo(): void {
                videoPlayer = new VideoPlayer();
                videoPlayer.source = "file:///D:/shared/work/data/test/original/bkb2.flv";
                playerContainer.addElement(videoPlayer);
                //player.
            private function onStopVideo(): void {
                videoPlayer.stop();
            private var videoPlayer:VideoPlayer;
        ]]>
    </fx:Script>
    <s:VGroup id="playerContainer" verticalAlign="middle">
    </s:VGroup>
    <s:HGroup>
        <s:TextArea id="myTA" width="350" height="25"/>
        <s:Button label="Play Video" click="onPlayVideo();"/>       
        <s:Button label="Stop Video" click="onStopVideo();"/>       
    </s:HGroup>
</s:WindowedApplication>
Thanks in advance,
Ramashish

You can access the columns through the dataGrid.columns array
property.
Get a reference to that array from the DG into a variable,
modify the column elements as desired through that var, then
re-assign the var to the dg.columns property. So you are close:
var aColumns:Array = dataGridID.columns;
var dgc:DataGridColumn = aColumns[1];
dgc.headerText = "this is column 1";
dataGridID.columns = aColumns; //this step is required!
Tracy
Tracy

Similar Messages

  • How to set a system property via the config tool?

    Hello,
    how can I set a system property via the config tool? Before I chose WAS from SAP I used java with option -D<name>=<value> to set the system properties.
    Very much thanks in advance.
    Regards
    Carsten

    Hi Carsten,
    WAS config tool is located under
    e.g. usr\sap\J2E\JC00\j2ee\configtool
    start configtool.bat
    there will be opened a configuration tool GUI
    Click on the instance_ID.... leaf of the tree in the left pane and then on the server_ID.... leaf.
    Java settings will appear in the right pane after this steps.
    Best Regards,
    Violeta

  • How to set pre-defined constants via FXML

    Does anymode know how to set a pre-defined constant like javafx.scene.control.Control.USE_PREF_SIZE via FXML when you create a node?
    Instead of using a fixed value like this
       <Label text="Last Name:" minWidth="100" />I would like to use one of the predefined sentinel values like this.
       <Label text="Last Name:" minWidth="USE_PREF_SIZE" />The above example does not seem to work and I have the feeling that this is currently not possible at all.

    How did you get that working? When I use the following file I only get a warning that "javafx" is not defined.
    Defining var A seems to work but it fails on var B. It seems to be impossible to access anything outside the
    java... hierarchy. Is there anything else you have to define?
    <?xml version="1.0" encoding="UTF-8" ?>
    <?language javascript?>
    <?import javafx.scene.*?>
    <?import javafx.scene.layout.*?>
    <?import javafx.scene.control.*?>
    <StackPane xmlns:fx="http://javafx.com/fxml" >
         <fx:script>
              var A = java.awt.Component.BOTTOM_ALIGNMENT;
              var B = javafx.scene.control.Control.USE_PREF_SIZE;
         </fx:script>
    </StackPane >   

  • How to set up Canon printer via Netgear print server ps121 on new macbook

    I have bought a new Macbook (OS10.4.8). The Apple store gives a good deal if you buy a Canon ip4300 with it but I am having problems figuring out how to set up the printer to work thru my Netgear print server on my Netgear network. Can anybody advise:
    1. I know my print server is on port 192.168.1.5, but what kind of settings do I use, IPP or LPT or something else?
    2. Why can I not find the driver for the ip4300, even though I have used the CD that came with the printer and run the install program and the printer DOES work when I plug it directly into the USB port. Why does the Macbook come with drivers already installed for only a few ancient BJ Canons and why won't it show me where the driver for the ip4300 is since it is obviously already on the machine?
    I know Netgear treats its customers with contempt (Linksys even worse). But I would expect a little more simplicity from Canon and Apple. I know I am an orangutan but it still seems incredibly difficult, as if they have hidden the printer driver on the computer and as if Apple does not want you to install networked printers. Please don't tell me to RTFM, I have read the Canon manual, it tells you how to network with Windows, does not even mention Mac. Any advice appreciated.
    Macbook   Mac OS X (10.4.8)   Netgear PS121, Netgear WGT624v3 router, Canon ip4300 printer

    Hi zoevancouver,
    If you are not able to set up your Canon MP460 printer, take a look at the article below.  There is a link to the Canon website and compatible printers.  Since this particular model is not on the list, you may need to contact Canon for additional support.
    OS X: Printer and scanner software available for download - Apple Support
    https://support.apple.com/en-us/HT201465
    Regards,
    - Judy

  • Studio Creator - How to set -source

    Trying to compile a Java 5 style project the studio creator suggests
    to set
    ' -source 1.5'
    Where exactly is this to be set?
    Urs

    OpenZoom currently only has limited support for Deep Zoom Collections. To find out more, check out the following two community threads:
    http://getsatisfaction.com/openzoom/topics/working_with_output_from_deepzoom_composer
    http://getsatisfaction.com/openzoom/topics/deep_zoom_collections_support_for_openzoom

  • How to set cq:noDecoration true via code in CQ5.3?

    Hi All,
    Can anyone please help with sharing the idea/code how to set cq:noDecoration to true so that extra div tags can be removed which gets generated by CQ dynamically?
    Also, is there a way to still allow editing along with setting cq:noDecoration to true?
    Any help would be much appreciated.
    Thanks.

    You can set this at component level (Only 5.4 and above). Please see [1]
    [1] http://dev.day.com/docs/en/cq/current/developing/components.html
    For CQ5.3
    componentContext.setDefaultDecorationTagName(“”);
    If you still see some component specific tag try to use
    slingRequest.setAttribute(ComponentContext.BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE, false);
    Yogesh

  • How to set  headerText in DataGrids through ActionScript

    Any help or suggestions with this appreciated. I'm populating
    a datagrid control in Flex 2 with dynamically data. The number of
    columns and column names aren't fixed. The column data itself is
    just raw values; no field names or other elements to identify what
    the column header should be.
    So when the data provider updates I need to be able to
    tweak/add the headerText for the columns. How do I access this
    setting through actionscript? I see many examples for defining
    <mx.DataGridcolumn> and properties, but I can't really do it
    that statically in advance; I don't know the column count or type
    of columns until runtime.
    Is it possible to access the headerText property with
    something like dataGridID.column[0].DataGridColumn.headerText = ""?
    This is what I'm looking for, the ability to iterate through and
    set the headerText, but I haven't found the magic incantation.
    Thanks!

    You can access the columns through the dataGrid.columns array
    property.
    Get a reference to that array from the DG into a variable,
    modify the column elements as desired through that var, then
    re-assign the var to the dg.columns property. So you are close:
    var aColumns:Array = dataGridID.columns;
    var dgc:DataGridColumn = aColumns[1];
    dgc.headerText = "this is column 1";
    dataGridID.columns = aColumns; //this step is required!
    Tracy
    Tracy

  • How to set cursor after submit via selection-screen

    hi guys,
    i would like to set cursor to certain field, after submit via selection-screen.
    eg.
    SUBMIT   z_mm_kbr_gr_label_01
                VIA SELECTION-SCREEN
                WITH p_mblnr = p_mblnr
                WITH p_zeile = p_zeile
                WITH p_gjahr = p_gjahr
                WITH p_ccode = p_ccode
                WITH p_dcode = p_dcode
                WITH p_crt = p_crt
                WITH p_print = p_print.
    i want to set cursor field 'p_ccode' after going back to
    z_mm_kbr_gr_label_01. the program always go to the first field on the screen whatever i do.
    may i know how to do this?
    thanks.

    Hi,
    Please try like below .
    at selection-screen output.
    SET CURSOR FIELD  'P_CCODE' .

  • New to workshop: how to set source file path

    Hello,
    I am new to workshop. I used to use Jdeveloper where I can set project settings to specify java source root and html source root. that way, my source code does not need to be under the standard directory app/project/src/....
    I am wondering if workshop can do the same thing?
    I tried to use import function, but it only copy the files over to its standard directory.

    Hello,
    I am new to workshop. I used to use Jdeveloper where I can set project settings to specify java source root and html source root. that way, my source code does not need to be under the standard directory app/project/src/....
    I am wondering if workshop can do the same thing?
    I tried to use import function, but it only copy the files over to its standard directory.

  • How to set source system inactive

    Hi experts,
    Can someone please tell me how to turn a source system to inactive???
    Thanks!
    Artur.

    Hi
    You cannot Inactivate the Source System -- Try removing the RFC connectivity between the systems
    In BI, SM59, delete your R/3's connection entries.
    In R/3, SM59, delete your BI's connection entries.

  • How to set layer color property via script?

    I'm looking for a way to set a layer's UI color property via script (see attached). Any help would be greatly appreciated!

    jrapczak2 wrote:
    Uhm.. wow. That's crazy complicated
    It is even more complicated to work with multi-selected layers.
    if( app.documents.length > 0 && versionCheck()  ){
         app.activeDocument.suspendHistory("Set Layer's Color", 'changeLayersColor()');
    function versionCheck()  { return app.version.match(/1[1|2]./) >= 11; };
    function changeLayersColor(){
         function setActiveLayerColor( color ) {
              var desc = new ActionDescriptor();
                   var ref = new ActionReference();
                   ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
              desc.putReference( charIDToTypeID('null'), ref );
                   var colorEnumDesc = new ActionDescriptor();
                   colorEnumDesc.putEnumerated( charIDToTypeID('Clr '), charIDToTypeID('Clr '), color );
              desc.putObject( charIDToTypeID('T   '), charIDToTypeID('Lyr '), colorEnumDesc );
              executeAction( charIDToTypeID('setd'), desc, DialogModes.NO );
         function getSelectedLayersIdx(){
                   var selectedLayers = new Array;
                   var ref = new ActionReference();
                   ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
                   var desc = executeActionGet(ref);
                   if( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) ){
                        desc = desc.getList( stringIDToTypeID( 'targetLayers' ));
                         var c = desc.count
                         var selectedLayers = new Array();
                         for(var i=0;i<c;i++){
                             try{
                                  activeDocument.backgroundLayer;
                                  selectedLayers.push(  desc.getReference( i ).getIndex() );
                             }catch(e){
                                  selectedLayers.push(  desc.getReference( i ).getIndex()+1 );
                    }else{
                        var ref = new ActionReference();
                        ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "ItmI" ));
                        ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
                        try{
                             activeDocument.backgroundLayer;
                             selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" ))-1);
                        }catch(e){
                             selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" )));
                   return selectedLayers;
         function makeActiveByIndex( idx, visible ){
              if( idx.constructor != Array ) idx = [ idx ];
              for( var i = 0; i < idx.length; i++ ){
                   var desc = new ActionDescriptor();
                   var ref = new ActionReference();
                   ref.putIndex(charIDToTypeID( "Lyr " ), idx[i] );
                   desc.putReference( charIDToTypeID( "null" ), ref );
                   if( i > 0 ) {
                        var idselectionModifier = stringIDToTypeID( "selectionModifier" );
                        var idselectionModifierType = stringIDToTypeID( "selectionModifierType" );
                        var idaddToSelection = stringIDToTypeID( "addToSelection" );
                        desc.putEnumerated( idselectionModifier, idselectionModifierType, idaddToSelection );
                   desc.putBoolean( charIDToTypeID( "MkVs" ), visible );
                   executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
         var colors = ['None','Red','Orange','Yellow','Green','Blue','Violet','Grey'];
         var colorIDs = [charIDToTypeID('None'),
                                  charIDToTypeID( "Rd  " ),
                                  charIDToTypeID( "Orng" ),
                                  charIDToTypeID( "Ylw " ),
                                  charIDToTypeID( "Grn " ),
                                  charIDToTypeID( "Bl  " ),
                                  charIDToTypeID( "Vlt " ),
                                  charIDToTypeID( "Gry " )];
         var dlg = new Window( 'dialog', 'Change Layer Color' );
         dlg.ddColors= dlg.add("dropdownlist", undefined,  colors);
         dlg.ddColors.preferredSize.width = 100;
         dlg.ddColors.items[0].selected = true;
         dlg.ok = dlg.add('button',undefined,'Ok');
         dlg.cancel = dlg.add('button',undefined,'Cancel');
         var results = dlg.show();
         if( results == 1 ){
              var selectedLayers =  getSelectedLayersIdx();
              for( var l=0;l<selectedLayers.length;l++ ){
                   makeActiveByIndex( selectedLayers[l], false );
                   setActiveLayerColor( colorIDs[dlg.ddColors.selection.index] );
              makeActiveByIndex( selectedLayers,false );

  • How to set source ip in JNDI DNS

    hello everyone,
    As we known the linux command dig can set sourceip with -b option for a dns query.
    examples:
    dig @DNSSERVER -b 202.16.32.24 www.google.cn
    so,how can i set a sourceip for a dns query in JNDI?
    Is anybody help me?

    Thanks a lot .
    it work well for me now .
    i have a another question.
    i set the nat to gloable ip .and it works.i set it by the Cisco Configuration Professional
    in the edit the static nat.
    but there is a abnormal .
    when the electronic is down. the setting change to the old one.
    so what is the problem?

  • HT3500 MacBook Air 2011/ OSX Lion 10.7.2; Epson stylus SX430W Wi-Fi Printer; USB working OK. How to set up wireless connection via USB modem??

    Cannot get wireless functions to work, neither via MBA nor Epson setup screen; not IT literate No wifi network available, have I been suckered??

    Make a "Genius" appointment at an Apple Store, or go to another authorized service provider.
    Apple recommends that you deauthorize a device in the iTunes Store before having it serviced.

  • How to set up airport M8440 via a pc (windows 7)?

    After my powerbook got broken, the company i work for gave me a HP laptop (OS is windows 7). I was using an airport m8440 with my powerbook to connect to the internet. Now I want to use the same modem with new laptop but i forgot the password for the base station. Would anyone tell me step by step what I should do to use this base station?
    Thanks a lot in advance.

    Unfortunately, to perform a "factory default" reset on the Dual Ethernet/Snow AirPort Base Station you will need both a Mac and the old AirPort Utility for Graphite and Snow 4.2.5 software utility.

  • How does one set up remote access via the internet to access files stored on the Time Capsule using airport utility 6.1

    I was just wondering if anyone can provide me with instructions please on how to set up remote access via the internet to the time capsule when away from home?
    I am running OS X Mountain Lion operating system and have Airport Utility 6.1.
    Many thanks to you all for your help.

    I think the instructions should be all in BTMM with iCloud.
    Instructions are all there.
    http://support.apple.com/kb/ht3486

Maybe you are looking for

  • Question on HttpServletRequest object

    If I have a request object (say r), am I able to remove a parameter from that object and replace it in a servet? I am trying to take a double value from a form (not a problem) and pass it into a servlet. What I want to do is in the servlet, run some

  • Dml_Handler at the Schema Level?

    Hi: I'm using 11g R2 and doing a one-way streams replication within the same database. I've got a subset of tables within the same schema setup now for capture and I'm using dml_handlers on apply. The handlers are specified on each table with a packa

  • How to add the key name to all the pictures selected

    I need to attach a key name to more than one picture and I cant , it remains attached to only one of the selected pictures. How to attach to all the selected pictures ? Tank you

  • Mythtv with systemd problems [SOLVED]

    Anyone using mythtv with systemd?  I am using the following to get systemd to start mythbackend but it attempts to start before mysqld is fully ready and thus fails: $ cat /etc/systemd/system/mythbackend.service [Unit] Description=MythTV backend serv

  • Ipod says it's connected to a dock when its not. No sound.

    My son's ipod touch says its connected to a dock connector when it's not. It won't play music and there is no sound on games. It has 5.1 installed. It's been restored and reset multiple times. Any suggestions?