Is there a way to use Flex 9-slice scaling at runtime? - apache-flex

I haven't been able to find an answer to this online. Is there a way to use 9-slice scaling with images loaded at runtime?
To clarify, let's say that I build an application that lets a user skin a button with whatever image they want. This would be an image that's not embedded with the swf. Is there a way to set that runtime image as a background and use 9-scaling?
Thanks!

You can specify a rectangle as the scale9grid of a movieClip that contains your image art.
http://www.sephiroth.it/tutorials/flashPHP/scale9/
Now, to use a MovieClip in Flex (it's a Flash thingy) you have to load it into a UIComponent:
http://cookbooks.adobe.com/post_You_wish_to_add_a_Sprite_or_MovieClip_to_a_Flex_ap-7142.html

Related

Change button height in WebDynpro ABAP

For a touchscreen I need to increase the height of my buttons in a ABAP WebDynpro Application.
Because there's no attribute for the height I read that it should be possible to add an image to the MIME Repository and then add this image to the button.
I also read that it might be possible to create a own theme with a .css file.
The last one sounds a little bit better to me. Does anyone know how I can create such a theme and apply it to my application?
Thanks for your help!
The simpliest way of resizing height is using MIME image, which I want to describe here:
Create your image with exactly those height that you need. The image could be opaque, transparent or whatever. Image format doesn't matter, as most common formats (jpg, gif, png) are supported.
Import it to your Webdyn Pro component like this: right click on component in repository tree, then -> Create -> MIME object -> Import
After image was successfully imported, just select it using imageSource property of button element, where you can find it on Component images tab.
Voilá! The button adopted the dimensions of the image.

Differences between Image and BitmapImage with Flex?

In Image's asdoc, we can see :
Flex also includes the BitmapImage class. This class is used for embedding images into skins and FXG components
but we can also use Image in skins and use #Embed with Image...
Therefore, where and when should I use Image or BitmapImage please ?
Image is a skinnable class that wraps BitmapImage. As such BitmapImage is more lightweight, but Image has more features. So the question when to use which boils down to this:
if the features of BitmapImage suffice, use that; otherwise use Image. Especially in mobile environments try to favor the use of BitmapImage.
Now what features does Image add exactly?
Image extends SkinnableComponent: this means you can assign your images a skin with a border or a dropshadow or whatever you like consistently throughout your application.
It also provides a progress indicator which can be displayed while the image is loading.
One more feature is the possibility to queue the loading of multiple images.

Flex3: where to find loading animations? Is it possible to load GIF images easily?

I would like to use a GIF image as a loading animation on my Flex application, however I read Flex 3 doesn't have native support for GIF images. Therefore, is there any way to use them without any drawbacks?
If not, where can I find some flash animations to include in my app?
There are a lot of progress indicator flash animations out there as swf which can be easily be embedded (ie. here) or search google for Flex Progress Spinner. It's not that difficult to implement your own anyway. You just need a canvas and some matematics (rotation about point formulars).
Yes it's possible. You can find and design your own loading animation in:
http://www.ajaxload.info/. All you need to do is add this image in canvas or anyobject then call this one everytime you load.hope this will help you

How to create fixed size swf in pure AS3 only

I was wondering if there are anyways to get the fixed size swf file when I build my AS3 only project in Flex environment. I can't use scaleMode="noScale" since my swf is very small. I don't want it expand it to full browser winder either. Are there anyways to do it? Thanks for the help!
Your Application is sort of like a Canvas inside of the flash player. Thus, you can give it a fixed size (with the width and height attributes), but that will just reduce its size inside the flash player. I don't think you can mess with this in pure AS3 - you'd need to change the underlying HTML (although, you may be able to do this with ExternalInterface, which allows you to call javascript methods on the HTML page...).
Use metadata above the main class declaration
[SWF(width="400", height="125")]
public class MyAS3Project extends Sprite

Resize Sprite Flex/ActionScript

I am creating Sprite objects as simple shapes, and would like to know how to resize them dynamically.
my question:
How can I enable the Sprite to be re-sized on mouse drag(perhaps enabling a only a portion of the Sprite for this behavior)?
It might be important to note that I am using the Flex SDK, and therefore do not have full
access to the Flash libraries.
Thank you in advance.
You might want to check out the Flex Object Handles open source library. Check out the demo to see how it can be used to allow users to resize any object in a Flex app.
Doesn't the sprite always adapt itself to its contents to set its height and width? (like movieclips in as2). If you want to resize a sprite, I guess you'd have to draw something as background?
What do you mean by enabling a portion of the sprite to be re-sized?

Resources