Symmetri Developer Blog

November 4, 2009

Using a Flash symbol from an SWF as the background for a UIComponent using styles

Flash/Flex/Actionscript - By Shourov Bhattacharya

You can use a Flash movie clip from within an SWF as the background for a component in Flex. First, you must create the symbol in Flash and then be sure to create a linkage for the symbol (Export for Actionscript etc.) and give it a unique name; then publish the Flash movie as a SWF. Within Flex, the background can be set up as part of a style in the CSS stylesheet - but the part that had me stumped was that instead of using background-skin, you must use background-image. That is, the following code is correct and will work:

.bubble
{
    background-image: Embed(source=../swf/bubble_skins.swf, symbol=bubble);
    background-alpha: 1.0;
    background-size: 100%;
}

The following code will NOT work:

.bubble
{
    background-skin: Embed(source=../swf/bubble_skins.swf, symbol=bubble);
    background-alpha: 1.0;
    background-size: 100%;
}

Comments »

No comments yet.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome
Theme designed by Janis Joseph