views:

14

answers:

1

Hi,

I'm looking to place an image (object) on top of the other object (default video player in Flex 4), any suggestions are most welcome. Do we've to use canvas? can I do it without using canvas? An example would be greatly appreciated, thanks.

Regards

+1  A: 

You can have a look at this tutorial for more info: http://www.republicofcode.com/tutorials/flash/as3displaylist/

but adding an object on top of another one , is as simple as this

addChild(child1);
addChild(child2);

basically the first object added is at the bottom of your stack. now if the object you want placed under was added after the first one. you still can do this:

addChild(child2);
addChildAt(child1, 0 );

there are, of course ,more options to manipulate the children positions but you should find what you need in the tutorial above.

Oops , sorry the word Canvas , got me confused. I thought you were trying to do this within Flex. Do you mean to say you want to do that in HTML. If you do, please retag your question, because it wouldn't really be a flash issue .

Hope it helps ;)

PatrickS
I think machaa's mention of Canvas was in reference to the mx/halo Canvas container component.
Wade Mueller
that's how i understood it the first time , but then i thought it may have been the html5 canvas...
PatrickS
Yes, Wade is correct. @Patrick: I've tried your way it is working thanks, but how can we do the same in the Flex code, instead of doing in action script? Also, can we overlap an image on a spark video player (Flex 4) using the same trick??
i haven't worked with Flex for awhile but i think you should be able to use the same code inside CDATA tags and this should also work with any display object in Flex4
PatrickS