3 Replies Latest reply on Sep 19, 2011 5:28 AM by xuzhike19791109

    please help: <s:VideoDisplay cannot work in <s:Module in Flex 4.5

    xuzhike19791109

      Hi, I am a beginner to Flex. and I created a simple Flex desktop application by using module,

       

      1: application Main.mxml:

      <?xml version="1.0" encoding="utf-8"?>

      <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"

                                                           width="800" height="600"

                                                           >

                <fx:Declarations>


                </fx:Declarations>

           <s:ModuleLoader id="MainModuleLoader" width="100%" height="100%" horizontalCenter="100"

                                                         url="loginModel.swf" verticalCenter="54">

                 </s:ModuleLoader>

      </s:WindowedApplication>

       

      2: module file loginModel.mxml

      <?xml version="1.0" encoding="utf-8"?>

      <s:Module xmlns:fx="http://ns.adobe.com/mxml/2009"

                            xmlns:s="library://ns.adobe.com/flex/spark"

                            xmlns:mx="library://ns.adobe.com/flex/mx" width="800" height="600" creationComplete="initComplete()" xmlns:local="*">

                <fx:Declarations>

                </fx:Declarations>

                <s:Label x="255" y="355" text="here is a video"/>

                <s:VideoDisplay x="217" y="375" width="496" height="335" source="assets\sample_vid.flv" autoPlay="true"/>

      </s:Module>

       

      question:

      when I run the application, the video CANNOT play.

      if  <s:VideoDisplay x="217" y="375" width="496" height="335" source="assets\sample_vid.flv" autoPlay="true"/> locates in Main.mxml, it plays.

      or  use <mx.VideoDisplay instead of <s:VideoDisplay in Model file, it also plays.

       

      does it mean <s:VideoDisplay cannot work in <s:Module, or I miss someting important?

       

      thx for your help