flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Ent <p...@adobe.com>
Subject Re: [FlexJS] Layouts
Date Tue, 25 Apr 2017 13:25:53 GMT
The x and y properties in Flash are always relative to their parent
container. The browser world is, well I'll just say "complex" and leave it
at that.

If you do position:relative then x (left) and y (top) become positions
relative to the nearest element in the "flow" the browser lays down. That
is probably only partially accurate as I always have to run a half dozen
experiments to understand the differences. We don't have anything like
that in Flash. Eventually I want to a ConstraintLayout that makes use of
that, but probably next release.

Anyway, back to your original question. If component-specific code (i.e.,
COMPILE::JS) is not available to component authors outside the framework
space, then you are left with CSS.

If you were to give all of your sub-elements a common class name, then you
could do:

.MyComponent .commonName {

And still programmatically position them using .x and .y properties. The
Flash side will work as intended and now the JS side should as well.


On 4/25/17, 9:06 AM, "yishayw" <yishayjobs@hotmail.com> wrote:

>Peter Ent wrote
>> I first encourage you to base any new components on Group and then add
>> BasicLayout. Nothing will happen until you dispatch a layout needed
>> You should be able to add multiple children and then dispatch the event.
>That's what I'm doing right now.
>> We could also make a specialized Group subclass that has a
>> positionElement(element, x, y) function that will also set
>> position:absolute. Perhaps we could call it "BasicGroup" that would
>> make BasicLayout its default but you would not necessarily need to run
>> layout every time.
>That's not a bad idea, but again I'm curious about what we'll do for
>components that are not based off group or container. Also, what would the
>flash behavior be? AFAIK x and y in flash act like absolute in HTML, even
>without layout.
>View this message in context:
>Sent from the Apache Flex Development mailing list archive at Nabble.com.

View raw message