You can use both basic and mx. There is some issues with using some components with the same class names and styling, but that should not efffect the use of <js:WebBrowser> just include xmlns:mx = "library://ns.apache.org/r <http://ns.apache.org/flex/mx>oyale/basic” and you should be good to go.
> On Jan 9, 2020, at 9:31 AM, Takeshita Shoichiro <jl03...@gmail.com> wrote: > > I think "basic" cannot coexist with "mx/spark". Is my understanding correct? > > The reason why I'm asking this is to use <js:WebBrowser> component in the > mx/spark namespaces. > I tried it but failed. > > The following markup is a simplified version of our mxml. It displays A4-size > scanned image on the left side. > There are two scanned images and these are switched by clicking tab. > The application uses iFrame to dislay jpg files. > > Because iFrame is not supported by Royale, I'll try to use <js:WebBrowser>; > would like to know whether it is possible or not. > > Appreciate your advice. > > === Current MXML (simplied) === > > <?xml version="1.0" encoding="utf-8"?> > <s:Application xmlns:fx = "http://ns.adobe.com/mxml/2009 > <http://ns.adobe.com/mxml/2009>" > xmlns:mx = "library://ns.apache.org/flex/mx > <http://ns.apache.org/flex/mx>" > xmlns:s = "library://ns.apache.org/flex/spark > <http://ns.apache.org/flex/spark>" > xmlns:flex_iframe = "com.google.code.flexiframe.*"> > > <fx:Script> > <![CDATA[ > > import mx.events.FlexEvent; > > protected function tabnavigator1_clickHandler(event:MouseEvent):void > { > if(tabChange.selectedIndex == 1) > { > try > { > > }catch(e:Error) > { > } > } > } > ]]> > </fx:Script> > > <s:NavigatorContent> > <s:Scroller width="100%" height="100%"> > <s:Group> > <mx:TabNavigator x="96" y="9" width="763" height="1063" > click="tabnavigator1_clickHandler(event)"> > <s:NavigatorContent id="nav1" width="100%" height="100%" > label="Application Form 1"> > <s:Scroller id="scr1" x="0" y="0" width="763" > height="1057"> > <s:Group> > <flex_iframe:IFrame id="f1" > source="appform_1.jpg" width="763" height="1057" x="0" y="-10" /> > </s:Group> > </s:Scroller> > </s:NavigatorContent> > <s:NavigatorContent id="nav2" width="100%" height="100%" > label="Application Form 2"> > <s:Scroller id="scr2" x="0" y="0" width="763" > height="1057"> > <s:Group> > <flex_iframe:IFrame id="f2" > source="appform_2.jpg" width="763" height="1057" x="0" y="-10" /> > </s:Group> > </s:Scroller> > </s:NavigatorContent> > </mx:TabNavigator> > </s:Group> > </s:Scroller> > </s:NavigatorContent> > </s:Application> > > === <js:WebBrowser> for trial === > > <?xml version="1.0" encoding="utf-8"?> > <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009 > <http://ns.adobe.com/mxml/2009>" > initialize="onInit" > xmlns:js="library://ns.apache.org/royale/basic > <http://ns.apache.org/royale/basic>" > > > <fx:Script> > <![CDATA[ > private function onInit():void{ > COMPILE::JS{ > (iframe1.element as HTMLIFrameElement).sandbox = > "allow-top-navigation allow-forms allow-scripts allow-same-origin"; > (iframe2.element as HTMLIFrameElement).sandbox = > "allow-top-navigation allow-forms allow-scripts allow-same-origin"; > } > } > ]]> > </fx:Script> > > <js:valuesImpl> > <js:SimpleCSSValuesImpl /> > </js:valuesImpl> > > <js:initialView> > <js:View x="0" y="0" width="800" height="1078"> > <js:WebBrowser localId="iframe1" url="appform_lf.png" x="100" > y="9" width="800" height="1057"/> > <js:WebBrowser localId="iframe2" url="appform_nl.png" x="1000" > y="9" width="800" height="1057"/> > </js:View> > </js:initialView> > > </js:Application> > > > Shoichiro Takeshita