Tag Archive for 'embed'

01
Apr

Embedding fonts in a Flex application using Embed metadata (redux)

In a previous example, “Embedding fonts in a Flex application using Embed metadata”, we saw how you could embed fonts using the [Embed] metadata with the source attribute.

The following example shows how you can embed system fonts in a Flex application using the [Embed] metadata with the systemFont attribute.

Full code after the jump.

Continue reading ‘Embedding fonts in a Flex application using Embed metadata (redux)’

29
Feb

Setting a Button control’s icon to an asset from a SWF file in Flex

The following example shows how you can set a Flex Button control’s icon style to an asset from a SWF file using MXML or ActionScript.

Full code after the jump.

Continue reading ‘Setting a Button control’s icon to an asset from a SWF file in Flex’

07
Feb

Embedding fonts in a Flex application using Embed metadata

The following example shows how you can embed a font using ActionScript and the [Embed] metadata.

Full code after the jump.

Continue reading ‘Embedding fonts in a Flex application using Embed metadata’

25
Oct

Embedding fonts from a Flash SWF file into a Flex application

The following examples show how you can embed a font from a Flash SWF into a Flex application using @font-face in a <mx:Style /> block, or using the [Embed] metadata.

Full code after the jump.

Continue reading ‘Embedding fonts from a Flash SWF file into a Flex application’

31
Aug

Setting custom status messages in a Flex Panel container

The following example shows how you can set custom status messages in a Flex Panel container by setting the aptly named status property.

Full code after the jump.

Continue reading ‘Setting custom status messages in a Flex Panel container’

05
Aug

Building a basic controller for the VideoDisplay control

OK, this is probably one of my more elaborate samples on the site so far. It covers a few different areas which I probably haven’t covered (or covered well) up to this point. We look at things like embedding fonts (so we can use the fade effect on a nested text field), embedding images for button skins, and overlaying a simple set of buttons when you move your mouse cursor over a video (which I believe iTunes and many other video players do). Basically it lets you create a nice little video player that gets overlayed on the video so you don’t have additional space taken up by play/pause buttons.

Full code after the jump.

Continue reading ‘Building a basic controller for the VideoDisplay control’

02
Aug

Adding icons to Panel containers

Personally, I’m amazed I can write an entire post around setting a single (and simple) style, but yet here I am. The following example shows how you can place an icon of your choosing in the upper-left corner of a Panel container. As an added bonus, at least I create the Panel in both MXML and ActionScript.

Full code after the jump.

Continue reading ‘Adding icons to Panel containers’

27
Jul

Converting an image to black and white using the ColorMatrixFilter

A quick example of converting an image to black and white using the ColorMatrixFilter class. This was originally written for the Flash documentation’s “Learning ActionScript 2.0″ book (click here), but I ported our sample to Flex below.

For more information on the ColorMatrixFilter in ActionScript 3.0, check out the Flex 3 Beta documentation on LiveDocs at: ColorMatrixFilter - Flex 3 Language Reference.

Continue reading ‘Converting an image to black and white using the ColorMatrixFilter’

25
Jul

Embedding assets from SWF files

Another cool way to embed assets into a Flex application is to load a SWF file and embed specific library assets using the [Embed] metadata and specifying the library symbol to embed.

Full code after the jump.

Continue reading ‘Embedding assets from SWF files’

25
Jul

Embedding images using style sheets and the <mx:Style> tag

Just when you thought I may have run out of Embed examples… Here’s a quick example of embedding an PNG icon using an <mx:Style> block.

Full code after the jump.

Continue reading ‘Embedding images using style sheets and the <mx:Style> tag’

24
Jul

Embedding external files using [Embed]

OK, I learnt 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…

Full code after the jump.

Continue reading ‘Embedding external files using [Embed]’

21
Jul

Setting an icon in an Alert control

Similar to the previous post where we covered a couple of techniques for embedding an icon into a Button control, this post explores embedding an icon into an Alert control. An icon in an Alert control appears to the left of the alert’s message text, but the second example will show how you can easily tweak the code to also add icons to the nested buttons controls within the alert dialog itself. See the full code after the jump.

Continue reading ‘Setting an icon in an Alert control’

21
Jul

Setting an icon in a Button control

There are two general methods for embedding an icon into a Button control. The first method involves creating a variable in the Flex application, and using the [Bindable] and [Embed] meta data. You specify the path to the icon in the source parameter of the Embed meta data and then to use the icon in a Button, you use data binding, which in this case would look like icon="{Icon}". The second method, embeds the icon inline in the Button tag itself, by using @Embed() and specifying the path to the image file as a parameter. See the full code after the jump.

Continue reading ‘Setting an icon in a Button control’