Skip to main content
Inspiring
July 30, 2013
Answered

Can a glow filter be applied to a transparent object?

  • July 30, 2013
  • 1 reply
  • 739 views

Hi guys, once again...

I have this green rectangle, with the following properties:

  targetc.width = 142;

          targetc.height = 144;

          targetc.x = 273;

          targetc.y = 218;

          targetc.alpha = 1000;

          targetc.antiAliasType = AntiAliasType.ADVANCED;

and I also have the letter C which is glowing and needs to be placed into the rectangle:

function dragC(event:MouseEvent):void {

          stage.removeEventListener(Event.ENTER_FRAME, stage_onEnterFrame);

    var item:MovieClip=letritaC(event.target);

    item.startDrag();

    var topPos:uint=this.numChildren-1;

    this.setChildIndex(item, topPos);

}

function cRelease(event:MouseEvent):void {

          var item:MovieClip=letritaC(event.target);

    item.stopDrag();      

    if (targetc.hitTestPoint(item.x,item.y)) {

        item.x=targetc.x;

        item.y=targetc.y;

    } else {

       item.x=273;

       item.y=(stage.stageHeight - 100);

    }

}

Now, as per the alpha property (if I am right), the rectangle is not visible in the screen due to its transparency... how can I make it glow, seeing only the glow, so I know where I have to put the letter C?

Thanks so much!

This topic has been closed for replies.
Correct answer kglad

what are you trying to do by assigning an alpha = 1000?

whatever that is supposed to do, it won't work.

the next problem is, what you're calling a green rectangle must be a textfield.  what's that about?

but, to enable a glow on an object that you don't want visible (ie, only the glow will be visible), you assign a glow filter with its knockout property enabled.

1 reply

kglad
kgladCorrect answer
Community Expert
July 30, 2013

what are you trying to do by assigning an alpha = 1000?

whatever that is supposed to do, it won't work.

the next problem is, what you're calling a green rectangle must be a textfield.  what's that about?

but, to enable a glow on an object that you don't want visible (ie, only the glow will be visible), you assign a glow filter with its knockout property enabled.

SirMarleyAuthor
Inspiring
July 30, 2013

Allright.

I have the C object, defines as a MC, which is draggable object; and the C target defined as a MC also, which is the target for the C object (this is the green rectangle I made)...

Now as stated, the rectangle I created is green...

I need it to be transparent (that´s why I put its alpha property that much) and the glow to be visible, so, someone will see the C object glowing and another space in the screen glowing as well, and will realize the object needs to be put in that space.

SirMarleyAuthor
Inspiring
July 30, 2013

remove that alpha, remove that antialiastype and assign a glowfilter with it knockout enabled.


Yeah! I removed the alpha and set the knockout enabled and it did work very good.

Thanks a lot!!!