Thank you, Justin.
I made your earlier code the only Application and the only MXML file. I still 
got the same compiler complaint, that's why I am confused.

But I should really put your current code in a separate MXML file and call it 
in main application anyway.
Thanks,
Allen



Sent via the Samsung Galaxy S7, an AT&T 4G LTE smartphone


-------- Original message --------
From: Justin Mclean <jus...@classsoftware.com>
Date: 7/9/17 10:05 PM (GMT-05:00)
To: dev@flex.apache.org
Subject: Re: [FlexJS] question about porting an Adobe Flex 3 project to HTML+JS

Hi,

I’d guess you have an js:Application tag elsewhere in your application and this 
is just a component right?

To use as a component try this instead (again untested):

<?xml version="1.0" encoding="utf-8"?>
<js:View xmlns:fx="http://ns.adobe.com/mxml/2009";
               xmlns:js="library://ns.apache.org/flexjs/basic">
  <fx:Script>
     <![CDATA[

     [Bindable]
     public var target:ISearchable;

     ]]>
  </fx:Script>

  <js:beads>
     <js:SimpleBinding />
  </js:beads>

  <js:HContainer>
     <js:Label text="Search:" />
     <js:TextInput id="searchInput" change="{target.find(searchInput.text)}" 
width="207">
        <js:beads>
           <js:ToolTip text="Live search" />
           <js:SimpleCSSStyles backgroundColor="{!target.searchString || 
target.found ? 0xffffff:0xff0000}" />
           <js:BindableCSSStyles />
        </js:beads>
     </js:TextInput>
     <js:TextButton id="previousButton"  text="&lt;" 
click="{target.findPrevious()}">
        <js:beads>
           <js:ToolTip text="Previous" />
           <js:DisableBead disabled="{target.searchString == null}" />
           <js:SimpleBinding />
        </js:beads>
     </js:TextButton>
     <js:TextButton id="nextButton" text="&gt;" click="{target.findNext()}">
        <js:beads>
           <js:ToolTip text="Next" />
           <js:DisableBead disabled="{target.searchString == null}" />
           <js:SimpleBinding />
        </js:beads>
     </js:TextButton>
  </js:HContainer>

</js:View>

You could test it with this snippet replacing SearchClass() with your class, 
you may need an import as well.

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
               xmlns:js="library://ns.apache.org/flexjs/basic"
               xmlns:comp="*">

   <js:valuesImpl>
       <js:SimpleCSSValuesImpl/>
   </js:valuesImpl>

   <js:initialView>
       <comp:Search target="{new SearchClass()}” />
   </js:initialView>

</js:Application>

Thanks,
Justin


________________________________

Ce message, ainsi que tous les fichiers joints à ce message, peuvent contenir 
des informations sensibles et/ ou confidentielles ne devant pas être 
divulguées. Si vous n'êtes pas le destinataire de ce message (ou que vous 
recevez ce message par erreur), nous vous remercions de le notifier 
immédiatement à son expéditeur, et de détruire ce message. Toute copie, 
divulgation, modification, utilisation ou diffusion, non autorisée, directe ou 
indirecte, de tout ou partie de ce message, est strictement interdite.


This e-mail, and any document attached hereby, may contain confidential and/or 
privileged information. If you are not the intended recipient (or have received 
this e-mail in error) please notify the sender immediately and destroy this 
e-mail. Any unauthorized, direct or indirect, copying, disclosure, distribution 
or other use of the material or parts thereof is strictly forbidden.

Reply via email to