flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: [FlexJS] How to output <i>
Date Thu, 13 Oct 2016 21:49:58 GMT
Josh is right that you currently can't, but I'm not sure the reason is
about MXML being a higher abstraction layer.

IMO, the issue is about how FalconJX transpiles MXML.  It creates a simple
data structure and the data interpreter just takes the classes mapped to
the tag names and tries to instantiate them.  HTMLElement doesn't seem to
allow direct instantiation.  It seems to want us to call
document.createElement.  I suppose we could change the interpreter to
check for HTMLElements and instantiate them differently.

The FlexJS components that MXML currently supports all wrap HTMLElements.
I would have not wrapped HTMLElement if HTMLElement supported
instantiation via "new" and more importantly, supported subclassing via
"new", since MXML essentially creates a subclass of the top tag in an MXML
file.  If there is a way around these limitations, it would seriously
change the way we write the FlexJS framework.

So, right now, you could create FlexJS components that wrap each and every
HTMLElement.  We just haven't bothered for the low-level text-oriented
elements.  I still claim it will be faster to deal with them as innerHTML.
 Otherwise a lot of wrapping code will run to establish the same DOM.
Feel free to create those components if you want to.

I haven't tried it, but hopefully the FlexJS components support
defaultProperty properly.  Maybe the compiler needs additional smarts
around defaultProperty so you can do:

<js:MultilineLabel>
  <h3>Some Header</h3>
  This is some <i>text</i>.
</js:MultilineLabel>

And that would map the contents to the html property (it might map to the
text property today, not sure).

HTH,
-Alex



On 10/13/16, 2:22 PM, "Josh Tynjala" <joshtynjala@gmail.com> wrote:

>You can't. Think of MXML as being at a higher abstraction layer. It
>doesn't
>know anything about HTML or the Flash display list.
>
>- Josh
>
>On Thu, Oct 13, 2016 at 2:09 PM, Carlos Rovira <
>carlos.rovira@codeoscopic.com> wrote:
>
>> Thanks for the various responses, many useful.
>>
>> One more thing: Can I use HTMLElement in MXML. I'm trying without luck:
>>
>> <js:HTMLElement className="xxx" text="yyy"/>
>>
>> Thanks
>>
>> 2016-10-13 22:25 GMT+02:00 Alex Harui <aharui@adobe.com>:
>>
>> > I think we need more context to answer this question.
>> >
>> > From MXML, you should be able to put "simple" HTML as the value of
>> > Label.html, Button.html, TextInput.html and hopefully any other FlexJS
>> > framework component that displays text.  Essentially, we want all
>>FlexJS
>> > UI widgets to work with HTML as well as plain text Strings.  On the
>>SWF
>> > side, the HTML support is currently limited by flash.text.TextField.
>>On
>> > the JS side, the components should just be setting innerHTML.
>> >
>> > If you are writing AS to transpile to low-level JS, then as others
>> > answered you can create HTMLxxxElements and work with them, or also
>>just
>> > set the innerHTML of some element.
>> >
>> > I still have dreams of a component set for FlexJS with components
>>such as
>> > "I" so you could essentially in-line HTML with the rest of your MXML,
>>but
>> > that will be a bunch of work on the SWF-side, and probably not nearly
>>as
>> > efficient as havin browser take raw HTML as innerHTML.
>> >
>> > HTH,
>> > -Alex
>> >
>> > On 10/13/16, 11:55 AM, "carlos.rovira@gmail.com on behalf of Carlos
>> > Rovira" <carlos.rovira@gmail.com on behalf of
>> > carlos.rovira@codeoscopic.com> wrote:
>> >
>> > >Hi,
>> > >
>> > >I'm trying to output <i> html tag, I think it should be something
>>like
>> > >HTMLIElement or something.
>> > >Btw, Where I could find the HTMLInputElement, HTMLSpanElement and
>> others?
>> > >
>> > >Thanks
>> > >
>> > >--
>> > >
>> > >Carlos Rovira
>> > >Director General
>> > >M: +34 607 22 60 05
>> > >http://www.codeoscopic.com
>> > >http://www.avant2.es
>> > >
>> > >
>> > >Este mensaje se dirige exclusivamente a su destinatario y puede
>>contener
>> > >información privilegiada o confidencial. Si ha recibido este mensaje
>>por
>> > >error, le rogamos que nos lo comunique inmediatamente por esta misma
>> vía y
>> > >proceda a su destrucción.
>> > >
>> > >De la vigente Ley Orgánica de Protección de Datos (15/1999), le
>> > >comunicamos
>> > >que sus datos forman parte de un fichero cuyo responsable es
>>CODEOSCOPIC
>> > >S.A. La finalidad de dicho tratamiento es facilitar la prestación del
>> > >servicio o información solicitados, teniendo usted derecho de acceso,
>> > >rectificación, cancelación y oposición de sus datos dirigiéndose a
>> > >nuestras
>> > >oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la
>>documentación
>> > >necesaria.
>> >
>> >
>>
>>
>> --
>>
>> Carlos Rovira
>> Director General
>> M: +34 607 22 60 05
>> http://www.codeoscopic.com
>> http://www.avant2.es
>>
>>
>> Este mensaje se dirige exclusivamente a su destinatario y puede contener
>> información privilegiada o confidencial. Si ha recibido este mensaje por
>> error, le rogamos que nos lo comunique inmediatamente por esta misma
>>vía y
>> proceda a su destrucción.
>>
>> De la vigente Ley Orgánica de Protección de Datos (15/1999), le
>>comunicamos
>> que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
>> S.A. La finalidad de dicho tratamiento es facilitar la prestación del
>> servicio o información solicitados, teniendo usted derecho de acceso,
>> rectificación, cancelación y oposición de sus datos dirigiéndose a
>>nuestras
>> oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
>> necesaria.
>>

Mime
View raw message