Embedding external files using [embed] (learn how to embed external files)

Source: Internet
Author: User
Embedding external files using [embed]

Posted on oldhawk reading (43) Comments (0) EDIT favorites category: Flex

OK, I learned this trick a few weeks ago from a co-worker. A user emailed me and asked if it was possible to embed an HTML/text file in a flex application rather than having to load the files at runtime, similar to how you can embed images or whatnot.

Not being certain, I asked the Team and got this response...

Foobar.

Package {
Import flash. utils. bytearray;

[Embed (Source = "test. mxml", mimetype = "application/octet-stream")]
Public class foobar extends bytearray
{
}
}

test. mxml XML version = "1.0" encoding = "UTF-8" ?>
mx: application xmlns: MX = "http://www.adobe.com/2006/mxml" creationcomplete =" testme () " >

mx: script >

Public var mytext: foobar = new foobar ();
Public Function testme (): void {
trace (mytext. tostring ();
}< br> ]>
mx: script >

</MX: Application>

Reprinted: http://www.cnblogs.com/taobataoma/archive/2008/01/13/1037021.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.