In my opinion, it wouldn't necessarily be considered a best practice to use
[Embed] with JavaScript output, but it could be useful in some
circumstances.

SWF, as a format, was great for distributing games because you could easily
download and pass around one file that can be deployed pretty much as-is on
various game portals. Games built on HTML/CSS/JS tend to be a little more
cumbersome because they usually involve multiple files. Technically,
though, you could put everything into a single HTML file. Scripts and
styles could be placed into the page using <script> and <style> tags.
Images, and maybe even other assets (like audio?), could be base64 encoded
and included in the same page too.

In response to Mike, here is some relevant documentation from Mozilla that
explains "data URIs", which is the proper name for what we're talking about
here.

https://developer.mozilla.org/en-US/docs/Web/HTTP/data_URIs

In response to Om, browsers can start rendering an HTML page before it
fully loads. With the right organization, you could essentially build the
HTML equivalent of a preloader animation that loads quickly, allowing
something interesting to be displayed while the rest of the page loads.

I agree, though, that for many use cases, loading external assets is the
better choice. I just wanted to explain that there is a relevant use-case
for embedded files.

- Josh

On Thu, Jan 21, 2016 at 8:53 AM, OmPrakash Muppirala <bigosma...@gmail.com>
wrote:

> Any reason we want to embed images?  It makes sense in a swf because it is
> a compact file format.
>
> For the HTML version if we stick a big base 64 image in the minified code,
> we are unnecessarily making the initial download size bigger.
>
> A better approach would be to use spritesheets when dealing with image
> data.   These spritesheets should be downloaded on demand like all other
> assets.
>
> Thanks,
> Om
> On Jan 21, 2016 8:43 AM, "Alex Harui" <aha...@adobe.com> wrote:
>
> >
> >
> > On 1/21/16, 8:24 AM, "Michael Schmalle" <teotigraphix...@gmail.com>
> wrote:
> >
> > >If/when you have time, could you make a JIRA that sort of outlined the
> > >process for the base64 encoding? I am good at somethings but something
> > >like
> > >this I really don't have any experience, I know the hooks in the
> compiler
> > >and such but what would actually be involved in getting the bytes to
> emit
> > >out.
> >
> > I would have to do research as well.  Maybe Josh can provide more detail.
> > My concern is, if overused, embeds could make the html file really huge.
> >
> > -Alex
> >
> >
>

Reply via email to