PDA

View Full Version : Canvas clipContent problem


arpi
04-11-2008, 02:34 AM
Hi,

I am new to Flex and ActionScript. I am creating a slideshow and have run into a problem I can't resolve. I have a canvas:

<mx:Canvas id="canvas" creationComplete="getNextImage()" width="{skinInnerFrameWidth}" height="{skinInnerFrameHeight}" backgroundColor="#000000" x="{skinFrameThickness}" y="{skinFrameThickness}" horizontalScrollPolicy="off" clipContent="true" verticalScrollPolicy="off">
</mx:Canvas>

Using AS, I dynamically add children to the canvas. Each one of these children is also a canvas and contains an image and label. As I add the children, I also add some effects to them (move in, rotate move out):

imageBorder.addChild(image);
imageBorder.addChild(linkButton);
imageBorder.addChild(caption);

canvas.addChild(imageBorder);

The problem I am running into is that the first few children that are added to the canvas don't always get clipped. This problem doesn't always occur though. Sometimes the first few images get clipped fine and other times they don't.

I would appreciate any help or guidance on this issue.

Thanks,
Arpi