AS3 add a border to a displayobject?

I think that if you're forced to use DisplayObject rather than DisplayObjectContainer then you don't have much choice than to write your border to the parent one way or another. Agreed though, it's not a nice way of doing things and I think that if it's possible the better approach would be to not use DisplayObject.

I think that if you're forced to use DisplayObject rather than DisplayObjectContainer then you don't have much choice than to write your border to the parent one way or another. Agreed though, it's not a nice way of doing things and I think that if it's possible the better approach would be to not use DisplayObject. Edit: How are you creating this as DisplayObject?

You can't instantiate displayObjects directly, so is this an extension of DisplayObject or the return value of something?

I produced an external swf, which I linked with Haxe. So it's a MovieClip containing MovieClips and Bitmap... Maybe I need a cast somewhere... – Jimy Jun 29 at 17:32 After verification it should be a MovieClip. I just have to find the way to cast it.Thanks.

– Jimy Jun 29 at 17:33 Try MovieClip(myDisplayObject). DoWhateverYouWant() – shanethehat Jun 29 at 17:34 It's already working! Thank you very much ;) – Jimy Jun 29 at 17:37.

I would create a transparent fill shape and add it to the DisplayObject like this: Edit :drawing directly to the DisplayObject this.graphics. LineStyle(1, 0x000000); this.graphics. BeginFill(0x000000, 0); this.graphics.

DrawRect(0, 0, 50, 50); this.graphics.endFill().

Yes that's what I wanted to do, but my object is a DisplayObject, so no addChild(). Only DisplayObjectContainer have this :/ – Jimy Jun 29 at 17:22 updated my answer... – citizen conn Jun 29 at 17:24 there is no graphics object for DisplayObject: help.adobe. Com/en_US/FlashPlatform/reference/actionscript/3/… – shanethehat Jun 29 at 17:27 Graphics is in Sprite, so not available.

– Jimy Jun 29 at 17:28.

A simple way to add a border to something is to use a Glow Filter: var _objectToBorder:Sprite = new Sprite(); // draw something or add something in the _objectToBorder var glowFilter:GlowFilter = new GlowFilter(0x000000, 1, 6, 6, 20, 1); _objectToBorder. Filters = glowFilter; You can play with this online demo. Click on the green circle to toggle the glow border.

Keep in mind that using filters can mar performance if used on a ton of items.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions