Repeating the fill on a BitmapGraphic object in Flex Gumbo

by Peter deHaan on December 13, 2008

in BitmapGraphic, FXG, beta

The following example shows how you can repeat/tile the fill on a Flex Gumbo BitmapGraphic object by setting the repeat property.

Full code after the jump.

To use the following code, you must have Flash Player 10 and a Flex Gumbo SDK installed in your Flex Builder 3. For more information on downloading and installing the Gumbo SDK into Flex Builder 3, see “Using the beta Gumbo SDK in Flex Builder 3″.

View MXML

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/12/13/repeating-the-fill-on-a-bitmapgraphic-object-in-flex-gumbo/ -->
<Application name="BitmapGraphic_repeat_test"
        xmlns="http://ns.adobe.com/mxml/2009"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">

    <ApplicationControlBar dock="true">
        <Form styleName="plain">
            <FormItem label="repeat:">
                <CheckBox id="checkBox" />
            </FormItem>
            <FormItem label="width:">
                <HSlider id="widthSlider"
                        minimum="100"
                        maximum="500"
                        value="300"
                        snapInterval="1"
                        tickInterval="50"
                        liveDragging="true" />
            </FormItem>
            <FormItem label="height:">
                <HSlider id="heightSlider"
                        minimum="100"
                        maximum="300"
                        value="200"
                        snapInterval="1"
                        tickInterval="50"
                        liveDragging="true" />
            </FormItem>
        </Form>
    </ApplicationControlBar>

    <Graphic>
        <BitmapGraphic id="bitmapGr"
                source="@Embed('assets/fx_appicon-tn.gif')"
                repeat="{checkBox.selected}"
                width="{widthSlider.value}"
                height="{heightSlider.value}" />
    </Graphic>

</Application>

Leave a Comment

Sorry, this blog is terrible at eating HTML comments.
If you're pasting any HTML/XML/MXML code, you need to convert your < characters to &lt; and your > characters to &gt; .

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Anti-Spam Protection by WP-SpamFree

Previous post:

Next post: