tags:

views:

146

answers:

3

Hi everybody! I never did stuff like this before! Tried to google around but couldn't find anything useful!

So: how is it possible to make text appear on top of an image (slideshow) in Flex using action script (can it be done another way)?

(I already found action script code that does implement the slideshow but how to show some dynamic text too?)

Thanks in advance!

A: 

The most simple method would be to just place a textarea on top of your image.

Jon.Stromer.Galley
A: 

If it's dynamic text, make sure that you embed the font. If you're running into weird behavior with the font, for example, if it doesn't show up, then make sure that the font is embedded. The font also needs to be embedded if you intend on scaling it, rotating it, etc.

milesmeow
A: 

Using ActionScript alone:

var sprite:Sprite = new Sprite();
//let bmp be an image of size 100x100 
//loaded thru Loader class or embedded at compile time
sprite.addChild(bmp);
var tf:TextField = new TextField();
//set background/color/font etc here
tf.text = "100x100 image";
sprite.addchild(tf);
tf.x = 50;
tf.y = 50;

Make sure you addChild text after the image - otherwise image will come on top of the text and you won't see it.

Using flex: Use Canvas or Panel with absolute positioning to put things on top of each other.

<mx:Canvas>
   <mx:Image source="image.png"/>
   <!--Make sure Label tag is after Image tag-->
   <mx:Label text="my image" x="20" y="20"/>
<mx:Canvas>
Amarghosh