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 {
    position:absolute;
}

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.

‹peter

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

>Peter Ent wrote
>> I first encourage you to base any new components on Group and then add
>>in
>> BasicLayout. Nothing will happen until you dispatch a layout needed
>>event.
>> 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
>>also 
>> make BasicLayout its default but you would not necessarily need to run
>>the 
>> 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:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-development.2333347.n4.nabble.com%2FFlexJS-Layouts-tp61120p61332.html&da
>ta=02%7C01%7C%7C15aa43a0230b4d7e725c08d48bdd724c%7Cfa7b1b5a7b34438794aed2c
>178decee1%7C0%7C0%7C636287230601148452&sdata=OPPvWFPqY4d44ZyVe0OH7Cz5LOThR
>CIo1LuXZMnUBws%3D&reserved=0
>Sent from the Apache Flex Development mailing list archive at Nabble.com.

Reply via email to