0 Replies Latest reply on Jun 5, 2012 7:49 PM by balasubramaniyan.S

    Textinput issue from external file (Is it bcz of mask?)

    balasubramaniyan.S Level 1

      Hi

       

      In my AIR application, I tried to load external swf in TabNavigator. In that file, I have some input text.

       

      I can key in external file's text input after load. But i got  "Security Sandbox Violation" error.

      Here is the code

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

       

      <mx:TabNavigator width="100%" height="100%">

                <mx:Canvas>

                          <s:SWFLoader id="_swfLoader" source="C:\Users\bala\Desktop\TextSWF.swf"/>

                </mx:Canvas>

      </mx:TabNavigator>

       

      </s:WindowedApplication>

       

       

      To solve security issue, i used load swf as bytes. After load there is no security issues, but i cannot key in external file's text input.

       

      Here is the code,

       

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

       

      <fx:Script>

                          <![CDATA[

       

       

                            protected function CreationCompleteHandler(event:FlexEvent):void

                            {

                                                        var loader:URLLoader=new URLLoader();

       

       

                                                        loader.dataFormat=URLLoaderDataFormat.BINARY;

                                                        loader.addEventListener(Event.COMPLETE, onSWFLoaded);

       

       

                                                        loader.load(new URLRequest("C:\\Users\\bala\\Desktop\\TextSWF.swf"));

                            }

       

       

                            private function onSWFLoaded(e:Event):void {

       

       

                                                        var loader:URLLoader=URLLoader(e.target);

                                                        loader.removeEventListener(Event.COMPLETE, onSWFLoaded);

       

       

                                                        var context:LoaderContext=new LoaderContext(false, new ApplicationDomain());

                                                        context.allowLoadBytesCodeExecution=true;

                                                        _swfLoader.loaderContext = context;

                                                        _swfLoader.load(loader.data);

                            }

       

       

                          ]]>

      </fx:Script>

       

       

      <mx:TabNavigator width="100%" height="100%">

                  <mx:Canvas>

                                              <s:SWFLoader id="_swfLoader" />

                  </mx:Canvas>

      </mx:TabNavigator>

      </s:WindowedApplication>

       

      How can solve this issue. Is there anything to do with css?

       

      Is tabnavigator conatin default mask? How can user edit masked textinput without embed font?

       

      Thanks

       

      Regards

      Balasubramaniyan.S