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 Image.source
Date Mon, 08 Aug 2016 15:37:58 GMT


On 8/8/16, 7:53 AM, "Harbs" <harbs.lists@gmail.com> wrote:

>I just pushed my changes to Image to sprite-refactor. Take a look.
>
>I think less than ten lines of code is a pretty small price to pay for
>this.

It isn't 10 lines.  Our basic Image example of loading an image from some
URL (if we had one) would now be bringing in URLUtils.  As a nit, the 10
lines don't allow for alternative implementations of Blob.

>
>If you want to make this separate components, there should be a base
>class which has the core functionality, or the “binary enabled” version
>should maybe subclass the basic version.

Please see my prior post.  Having a base class is fine, but often all you
need is replaceable models and views.

>
>You will generally want the binary version to support normal URL sources
>as well.

If you find yourself using "generally" then consider that usually doesn't
mean lightweight.  You can aggregate up to more general components.  But
we should make sure we have the right, separate, building blocks for doing
that.  Folks "generally" have text in buttons, but lots of buttons don't.
The scrollbar arrows should not be thinking about what text to display.
So we have different models and views for buttons with just images, just
text, images and text, and some day more.  IMO, we should do the same for
Images.

>
>If we did not have to worry about Flash, we could really just convert the
>binary to an ObjectURL using a utility class, but that would not make for
>easy manipulation of the underlying binary data later on.

Actually, I don't care as much about how heavy the Flash implementation
is.  The Basic set's job is to thinly wrap HTML/JS/CSS so the result is
the lowest overhead compared to manually writing a vanilla JS app
yourself.  The Flash side is going to be running AS to emulate CSS that
the Browser does for you.


Please refactor these changes into a model and view (and maybe a wrapping
component) with this extra functionality.

Thanks,
-Alex

Mime
View raw message