You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by Takeshita Shoichiro <jl...@gmail.com> on 2020/01/09 07:31:03 UTC

Coexistence of namespaces royale/basic and mx/spark

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"
               xmlns:mx = "library://ns.apache.org/flex/mx"
               xmlns:s  = "library://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"
                initialize="onInit"
                xmlns:js="library://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

Re: Coexistence of namespaces royale/basic and mx/spark

Posted by Takeshita Shoichiro <jl...@gmail.com>.
Harbs and Carlos, thanks for the good news.

I will try to mix these namespaces to get a desired output.

On Thu, Jan 9, 2020 at 8:35 PM Carlos Rovira <ca...@apache.org>
wrote:

> To complement to Harbs's response, just let you know that namespaces are
> just for that, to ensure we can use code from a library and similar code
> from another one.
> other thing are class names and styling that can collide, depending on
> strategies, but that's another topic.
>
> El jue., 9 ene. 2020 a las 9:53, Harbs (<ha...@gmail.com>) escribió:
>
>> Typo there. Should have been:
>>
>> xmlns:js = "library://ns.apache.org/r <http://ns.apache.org/flex/mx>
>> oyale/basic”
>>
>> On Jan 9, 2020, at 10:53 AM, Harbs <ha...@gmail.com> wrote:
>>
>> xmlns:mx = "library://ns.apache.org/r <http://ns.apache.org/flex/mx>
>> oyale/basic”
>>
>>
>>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>

-- 
Shoichiro Takeshita
武下 祥一郎

Re: Coexistence of namespaces royale/basic and mx/spark

Posted by Carlos Rovira <ca...@apache.org>.
To complement to Harbs's response, just let you know that namespaces are
just for that, to ensure we can use code from a library and similar code
from another one.
other thing are class names and styling that can collide, depending on
strategies, but that's another topic.

El jue., 9 ene. 2020 a las 9:53, Harbs (<ha...@gmail.com>) escribió:

> Typo there. Should have been:
>
> xmlns:js = "library://ns.apache.org/r <http://ns.apache.org/flex/mx>
> oyale/basic”
>
> On Jan 9, 2020, at 10:53 AM, Harbs <ha...@gmail.com> wrote:
>
> xmlns:mx = "library://ns.apache.org/r <http://ns.apache.org/flex/mx>
> oyale/basic”
>
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: Coexistence of namespaces royale/basic and mx/spark

Posted by Harbs <ha...@gmail.com>.
Typo there. Should have been:

xmlns:js = "library://ns.apache.org/r <http://ns.apache.org/flex/mx>oyale/basic”

> On Jan 9, 2020, at 10:53 AM, Harbs <ha...@gmail.com> wrote:
> 
> xmlns:mx = "library://ns.apache.org/r <http://ns.apache.org/flex/mx>oyale/basic”


Re: Coexistence of namespaces royale/basic and mx/spark

Posted by Harbs <ha...@gmail.com>.
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 <jl...@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