xProteuSx Posted March 19, 2012 Share Posted March 19, 2012 I have created a series of rectangles with rounded corners, using the following code: import flash.display.Sprite; import flash.display.Shape; var hp_box01:Shape = new Shape(); hp_box01.graphics.beginFill(0x006600, 1); hp_box01.graphics.drawRoundRect(0, 0, 200, 150, 12, 12); hp_box01.graphics.endFill(); addChild(hp_box01); All displays as it should. However, I am now unable to do the following: hp_box01.addEventListener(MouseEvent.CLICK, myFunction); It won't let me add an even listener to this shape. How can I convert the shape to a MC so that I can add event listeners to it? Quote Link to comment https://forums.phpfreaks.com/topic/259293-actionscript-shape-to-movieclip/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.