GhostWire Studios - Flash/Flex UI Components Development And Consulting Services
Quality User Interface Controls For Flash Application DevelopmentAspireUI Components

Aug 10 2009

Using uiImage: Drawing Solid Border/Frame Around The Image

Published by sunny at 3:08 am under Aspire UI,Flash,Tips

With the Aspire UI library, you can use the background property defined in the uiComponent class to draw a background behind component instances. By default, no background will be drawn. Typically, only containers will use this property.

In the case of the uiImage component, the background property can be used in conjunction with the padding property to draw a simple solid border around the displayed image:

var img:uiImage = new uiImage("flower.jpg");
img.background = {color:0x000000}; // ** solid black background **
img.padding = 10; // ** this effectively becomes the thickness of the border **
img.move(10, 10);
addChild(img);

To take things a little further, you can also add a drop shadow easily via the background property:

var img:uiImage = new uiImage("flower.jpg");
img.background = {color:0x000000, shadow:0x000000}; // ** solid black background with drop shadow **
img.padding = 10; // ** this effectively becomes the thickness of the border **
img.move(10, 10);
addChild(img);

Get Adobe Flash player

Note: In the example above, the image asset “flower.jpg” is stored in the default path “assets/images/” relative to the host SWF, and loaded during run-time.


Aspire UI Components
Aspire UI is a library of Actionscript 3.0 (AS3) classes for building flexible and lightweight UI elements in Adobe Flash applications. Key features of these components include easy skinning using PNG image files, automatic tab focus ordering, CSS text styles, and layout management. This is a pure AS3 library with no dependency on the Flex framework. You may experiment with the various features by downloading a trial version.

pixelstats trackingpixel
Share or Bookmark This Post:
  • StumbleUpon
  • email
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Live
  • Yahoo! Buzz
  • Netvibes
  • NewsVine
  • Reddit
  • Slashdot
  • Technorati
  • BlinkList
  • Mixx
  • Diigo
  • Faves
  • Suggest to Techmeme via Twitter
  • Twitter

Other Posts You Might Enjoy:

       

No responses yet

Comments RSS

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word