My first Flex app

It’s just adding a slider control to rotate an image, based on the first example I saw, but the exercise of looking through the API docs and figuring out how to create an event handler helped me understand what was going on and gave me confidence about being able to learn on the fly.

See it here on the Fluffy QA Site: Flash Source

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Image id="shell" source="@Embed('C:/users/Aaron/Pictures/shell2.png')" height="100" top="225" left="208">
    <mx:Script>
        <![CDATA[
            import mx.events.SliderEvent;
            import mx.controls.Text;

            private function sliderHandler(event:SliderEvent) :void {
                degrees.text = event.value.toString();
                shell.rotation = event.value;       
            }

        ]]>
    </mx:Script>
    <mx:filters>
      <mx:DropShadowFilter />
    </mx:filters>
  </mx:Image>
  <mx:HSlider x="25" y="42" id="slider" minimum="-360" maximum="360" snapInterval="10" tickInterval="360" change="sliderHandler(event)">

  </mx:HSlider>
  <mx:Label x="208" y="42" text="degrees:" id="lbl_degrees"/>
  <mx:TextInput x="271" y="40" width="45" id="degrees"/>
  <mx:Text x="25" y="10" text="Rotator" fontSize="16"/>
</mx:Application>

Now I’ll go read the manual.

Advertisements

4 thoughts on “My first Flex app

  1. okay, so it doesn’t rotate around it’s access very well. But I’m less concerned with how image rotation is handled in flash right now than I am about being able to add controls and map events between objects.

  2. Aparently it isn’t working in Seamonkey/Firefox. That may have to do with noscript / or the flashblock plugin, or maybe I just haven’t managed to upgrade my flash for Firefox. I had some trouble with getting it to launch from FlexBuilder as well, and it gave some permission errors when installing. I eventually (after 2 tries) got Flash upgraded, but I think it only upgraded the IE plugin.

    I checked and Firefox and IE have the same version installed:
    http://www.adobe.com/products/flash/about/

    You have version 9,0,124,0 installed

    Maybe flashblocker, or maybe needing to embed in HTML for firefox?

    Embedding in html works for Firefox. Seamonkey not so much.

    http://fluffy.qa-site.com/rotate.html

    I also updated flashblock to 1.5.6 on Firefox

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s