Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




[CS3] Apply Blur To A Spotlight Mask?



Alright, I give up. I know this is something stupid, but I can't figure it out for the life of me. I'm trying to create a blurred mask, and everything's working but the blur.

"bglayer" is the layer that gets exposed, "toplayer" is the layer that the mask acts on. I'm drawing the mask itself as "lightSpot" and that's what I need to blur.

Can anyone tell me in what way I'm being an idiot? TIA. Here's my code:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

import flash.display.Sprite;
import flash.filters.BitmapFilterQuality;
import flash.filters.BlurFilter;

var lightSpot:Sprite = new Sprite();
toplayer.addChild(lightSpot);

bglayer.mask=lightSpot;
bglayer.mouseEnabled=false;

var isOver:Boolean=false;
var spotSize:Number=0;

var blur:BlurFilter = new BlurFilter();
blur.blurX = 75;
blur.blurY = 75;
blur.quality = BitmapFilterQuality.HIGH;

function drawSpot(r:Number,blur:BlurFilter):void {
lightSpot.graphics.clear();
lightSpot.graphics.lineStyle(1,0x000000);
lightSpot.graphics.beginFill(0x0000FF);
lightSpot.graphics.drawCircle(0,0,r);
lightSpot.graphics.endFill();
lightSpot.filters = [blur];
spotSize=r;
lightSpot.startDrag(true);
}



toplayer.addEventListener(MouseEvent.ROLL_OVER, whenOver);

function whenOver(e:MouseEvent):void {
isOver=true;
}

toplayer.addEventListener(MouseEvent.ROLL_OUT, whenOut);

function whenOut(e:MouseEvent):void {
isOver=false;
}



stage.addEventListener(Event.ENTER_FRAME, whenEnterFrame);

function whenEnterFrame(e:Event):void {
if(isOver){
drawSpot(175,blur);
}
if(!isOver){
drawSpot(0,blur);
}
}


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



FlashKit > Flash Help > Flash ActionScript
Posted on: 08-09-2008, 08:05 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Spotlight Mask Effect
I thought I had seen a tutorial on flashkit on how to create a spotlight effect, via masking. I searched and haven't quite found what I need. I would like to have a background image (GIF) appear to be darkened by about 50% - and a circular mask sort of creates a spotlight effect for the areas I wish to highlight at 100% opacity. The highlighted areas will be frame-by-frame animation...

Any suggestions?

Thank you.

shorescores

Realistic FLASH Spotlight Beam, Not Using A Circular Mask.
Realistic FLASH spotlight beam, not using a circular mask.
I am in desperate need of some information, about realistic spotlights designed with flash. I need the kind that shoot a beam with a round circle on the floor. I have found a great example, at http://www.grisu.com and the owner even shared the fla code with me, but I still don't quite understand how to modify it to work for me. He offered to help, but he only speaks spanish and I only speak English, so we can't communicate.

If you go to his web and view the stage, the beam sweeps the stage and changes the angle and size of the beam. I need a longer and narrower beam. The length of the beam is too short for me, but the idea is just what I need.

Does anyone know of any tutorials on this subject? Or possibly other samples so that I may study them in detail.

1. Is a mask necessary to keep all the beams the same length as they scan? As the angle changes, the beam length would change unless a mask or something cuts them off at the floor level always.

2. Motion tween could probably be used to move the beam?

3. Would it be necessary to skew the beam as it sweeps as when it is slanted like that, the width of the beam gets wider as it sweeps away from you and more narrow as it sweeps closer to you.

4. Did you need to use alpha anywhere possobly when the beams cross each other or maybe when it is first turned on?

I would greatly appreciate any advice anyone can give, or steer me in the correct direction for some tutorial information.

Thanks

Realistic FLASH Spotlight Beam, Not Using A Circular Mask.
Realistic FLASH spotlight beam, not using a circular mask.
I am in desperate need of some information, about realistic spotlights designed with flash. I need the kind that shoot a beam with a round circle on the floor. I have found a great example, at http://www.grisu.com and the owner even shared the fla code with me, but I still don't quite understand how to modify it to work for me. He offered to help, but he only speaks spanish and I only speak English, so we can't communicate.

If you go to his web and view the stage, the beam sweeps the stage and changes the angle and size of the beam. I need a longer and narrower beam. The length of the beam is too short for me, but the idea is just what I need.

Does anyone know of any tutorials on this subject? Or possibly other samples so that I may study them in detail.

1. Is a mask necessary to keep all the beams the same length as they scan? As the angle changes, the beam length would change unless a mask or something cuts them off at the floor level always.

2. Motion tween could probably be used to move the beam?

3. Would it be necessary to skew the beam as it sweeps as when it is slanted like that, the width of the beam gets wider as it sweeps away from you and more narrow as it sweeps closer to you.

4. Did you need to use alpha anywhere possobly when the beams cross each other or maybe when it is first turned on?

I would greatly appreciate any advice anyone can give, or steer me in the correct direction for some tutorial information.

Thanks

Realistic FLASH Spotlight Beam, Not Using A Circular Mask.
Realistic FLASH spotlight beam, not using a circular mask.
I am in desperate need of some information, about realistic spotlights designed with flash. I need the kind that shoot a beam with a round circle on the floor. I have found a great example, at http://www.grisu.com and the owner even shared the fla code with me, but I still don't quite understand how to modify it to work for me. He offered to help, but he only speaks spanish and I only speak English, so we can't communicate.

If you go to his web and view the stage, the beam sweeps the stage and changes the angle and size of the beam. I need a longer and narrower beam. The length of the beam is too short for me, but the idea is just what I need.

Does anyone know of any tutorials on this subject? Or possibly other samples so that I may study them in detail.

1. Is a mask necessary to keep all the beams the same length as they scan? As the angle changes, the beam length would change unless a mask or something cuts them off at the floor level always.

2. Motion tween could probably be used to move the beam?

3. Would it be necessary to skew the beam as it sweeps as when it is slanted like that, the width of the beam gets wider as it sweeps away from you and more narrow as it sweeps closer to you.

4. Did you need to use alpha anywhere possobly when the beams cross each other or maybe when it is first turned on?

I would greatly appreciate any advice anyone can give, or steer me in the correct direction for some tutorial information.

Thanks

Realistic FLASH Spotlight Beam Not Using Circular Mask.
Realistic FLASH spotlight beam, not using a circular mask.
I am in desperate need of some information, about realistic spotlights designed with flash. I need the kind that shoot a beam with a round circle on the floor. I have found a great example, at http://www.grisu.com and the owner even shared the fla code with me, but I still don't quite understand how to modify it to work for me. He offered to help, but he only speaks spanish and I only speak English, so we can't communicate.

If you go to his web and view the stage, the beam sweeps the stage and changes the angle and size of the beam. I need a longer and narrower beam. The length of the beam is too short for me, but the idea is just what I need.

Does anyone know of any tutorials on this subject? Or possibly other samples so that I may study them in detail.

1. Is a mask necessary to keep all the beams the same length as they scan? As the angle changes, the beam length would change unless a mask or something cuts them off at the floor level always.

2. Motion tween could probably be used to move the beam?

3. Would it be necessary to skew the beam as it sweeps as when it is slanted like that, the width of the beam gets wider as it sweeps away from you and more narrow as it sweeps closer to you.

4. Did you need to use alpha anywhere possobly when the beams cross each other or maybe when it is first turned on?

I would greatly appreciate any advice anyone can give, or steer me in the correct direction for some tutorial information.

Thanks


Unable To Apply Blur Filter
The code below fades three mc instances into each other. The movieclip instances are called, picture1_mc, picture2_mc,picture3_mc. They are based on three bitmap images that also sit in the library. I manually converted the original bitmaps into movieclips on the stage area. The fade code works fine, but what I would like to do is allow the user to
mouse click and cause a blur effect whilst the images are cycling along. My problem is that Im not sure how to apply this within my mousedown function. The applyFilter method seems to call for bitmaps but I'm dealing with movieclips. Thanks for any guidance
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.filters.BlurFilter;
var filter2:BlurFilter = new BlurFilter(Math.ceil(Math.random()*5), Math.ceil(Math.random()*5), 3);

init = function () {
currentIndex = 1;
currentLayer = 1;
howLongToWait = 0;
_root.attachMovie("picture1_mc", "pic1", 0);
addNewPic();
};
addNewPic = function () {
clearInterval(myInterval);
if (currentIndex%3 != 0) {
currentIndex++;
} else {
currentIndex = 1;
}
newlyAdded_mc = _root.attachMovie("picture"+currentIndex+"_mc", "pic"+currentIndex, currentLayer++);
newlyAdded_mc._alpha = 0;
newlyAdded_mc.onEnterFrame = function() {
this._alpha += 2;
if (this._alpha>=100) {
this.onEnterFrame = null;
myInterval = setInterval(addNewPic, howLongToWait*100);
}
};
};
// run init()
init();
onMouseDown = function ()
{
//problems here!!!!!!!!!
var pointoint = new Point(_root._xmouse, _root._ymouse);
var rec:Rectange = new Rectangle(100,100,6,6);
//problem applying filter
//????.applyFilter(?????,rect,point,filter2)
};
myListener = new Object();
Mouse.addListener(myListener);

How To Apply Blur Filter On Image In Different Layer?
I have one load which loads image randomly from external folder.

and another layer which has 5 columns. I wish to do a mouse over thing and one of the column will become blur.


I tried to use the blur filter, but can't seem to get it work on image that loads randomly from external folder.

this is the action script code I used for loading external images:

Quote: pic_arr = ["images/1", "images/2", "images/3", "images/4", "images/5"];
onLoad = function() {
ranNum = Math.floor(Math.random()*pic_arr.length);
holder_mc.loadMovie(pic_arr[ranNum]+".jpg");
};



any help?

Unable To Apply Blur Filter On Mouse Down Event
The code below fades three mc instances into each other. The movieclip instances are called, picture1_mc, picture2_mc, picture3_mc. They are based on three bitmap images that also sit in the library. I manually converted the original bitmaps into movieclips on the stage area. The fade code works fine, but what I would like to do is allow the user to
mouse click and cause a blur effect whilst the images are cycling along. My problem is that Im not sure how to apply this within my mousedown function. The applyFilter method seems to call for bitmaps but I'm dealing with movieclips. Thanks for any guidance

import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.filters.BlurFilter;
var filter2:BlurFilter = new BlurFilter(Math.ceil(Math.random()*5), Math.ceil(Math.random()*5), 3);

init = function () {
currentIndex = 1;
currentLayer = 1;
howLongToWait = 0;
_root.attachMovie("picture1_mc", "pic1", 0);
addNewPic();
};
addNewPic = function () {
clearInterval(myInterval);
if (currentIndex%3 != 0) {
currentIndex++;
} else {
currentIndex = 1;
}
newlyAdded_mc = _root.attachMovie("picture"+currentIndex+"_mc", "pic"+currentIndex, currentLayer++);
newlyAdded_mc._alpha = 0;
newlyAdded_mc.onEnterFrame = function() {
this._alpha += 2;
if (this._alpha>=100) {
this.onEnterFrame = null;
myInterval = setInterval(addNewPic, howLongToWait*100);
}
};
};
// run init()
init();
onMouseDown = function ()
{
//problems here!!!!!!!!!
var point:Point = new Point(_root._xmouse, _root._ymouse);
var rec:Rectange = new Rectangle(100,100,6,6);
//problem applying filter
//????.applyFilter(?????,rect,point,filter2)
};
myListener = new Object();
Mouse.addListener(myListener);

How To Apply Mask On Txt
hello,
i like to know how to apply a mask on txt when the "use device fonts" is selected.
I use to select " use device fonts " for a better display of the txt, so I can use little font(9 , 10) , and it still readable.

but than if I use the mask, my txt dissappear.

any idea how to solve this???

tanks

How To Apply Mask On Txt
hello,
i like to know how to apply a mask on txt when the "use device fonts" is selected.
I use to select " use device fonts " for a better display of the txt, so I can use little font(9 , 10) , and it still readable.

but than if I use the mask, my txt dissappear.

any idea how to solve this???

tanks

Apply Mask To Last Image
I have created a banner with several images, each one with a mask and motion tween that reveals the image below each other. My issue is, how do I apply the mask/motion tween to the last image so that all of the images have the "wipe" effect? Right now, the last image is revealed, and it jumps to the first image without the "wipe" effect.
TIA

[how-to] Apply 1 Mask On 10 MovieClips In AS2
dear all,

Currently i have 10 movieClips and named it as (dog0, dog1, dog2 ... dog9)
I would like to appy a mask for these movieClips (dogs) ~~ by using ActionScript


Code:

// this script works fine
dog0.setMask(theMask);
however,
when i try the following script

Code:
dog0.setMask(theMask);
dog1.setMask(theMask);
the mask only applies on dog1 ... but NOT dog0
does it mean i have to create 10 masks for each dog ???

Any body could help me to solve it ??
I would like to mask all these dogs ~~

Thanks
Sam

How To Apply A Mask Over A Motion Guide?
Hi Guys,

How do i mask a motion guide layer???

Cheers

Apply Mask On Device Fonts?
Is there a way to apply a animated mask on text containing device fonts.

The text disappears using mask.

Apply A Mask To All Items In An Array (How?)
Hey guys,

I have an array of movieclips and I need to apple a mask to all of them (as3). Any suggestions?

How To Apply A Mask On Fading Grid(from Tutorial)
Hi

I thought the fading grid effect in the tutorial looked cool, so I applied my own image and the effect look great, but I want the animation to show inside a circle. Applying a mask didnt seem to work, so how is this done?

Maybe I made a mistake when making the mask, Im a big newbie to flash and especially actionscript.

/Nightowl

Blur Everything Under A Mask (Blur Mask)?
Hello,

I've searched every possible actionscript forum for this and i cant seem to find it. How can i create an "area" of blur which blurs everything beneath it?

Like some kind of masked blur effekt?

Any ideas?

Regards
Richard

Blur Mask?
Is it possible to create a mask (or other layer) which blurs everything under it?

I know it seems like a simple question, but I would like some help if it is possible.

Thanks,
BetaWar

Blur Mask Effect
If you look at the following template.......
http://www.templatemonster.com/flash...tes/10589.html

I am trying to figure out how the blur mask on top next to the picture of the man sitting is done. I am wanting to make the same effect but with text that is blurred that is under the mask, but the remaining text outside the mask not blurred.

Can someone point me in the right direction?

Thanks!

Creating A 'Blur Mask' Clip
Apologies in advance for asking this question - I'm there's an answer somewhere on the forum, but I can't find it.

What i would like to do is create a movie clip (preferably on the timeline so I can motion tween it, but created dynamically if that's how it has to be done) that blurs the clip on the timeline layer beneath it (the clip to blur will probably be a bitmap).

I have read up on the Blur filter and can apply it directly to a clip using code of the form:

import flash.filters.BlurFilter;
var blurred:BlurFilter = new BlurFilter(5, 5, 4);
var storedBlur:Array = [blurred];
myClipToBlur.filters = storedBlur;

but I don't understand how to blur only a section of a clip, the section being that which is 'underneath' another 'blur masking' clip.

I hope I've made this easy to understand. Thanks in advance to anyone who can help.

Creating A 'Blur Mask' Clip
Apologies in advance for asking this question - I'm there's an answer somewhere on the forum, but I can't find it.

What i would like to do is create a movie clip (preferably on the timeline so I can motion tween it, but created dynamically if that's how it has to be done) that blurs the clip on the timeline layer beneath it (the clip to blur will probably be a bitmap).

I have read up on the Blur filter and can apply it directly to a clip using code of the form:

import flash.filters.BlurFilter;
var blurred:BlurFilter = new BlurFilter(5, 5, 4);
var storedBlur:Array = [blurred];
myClipToBlur.filters = storedBlur;

but I don't understand how to blur only a section of a clip, the section being that which is 'underneath' another 'blur masking' clip.

I hope I've made this easy to understand. Thanks in advance to anyone who can help.

Flash 8 - Blur Mask Effect
i want to create a blurred transparent layer that will sit over a sequence of photographs. the idea is to have a piece cut out of the blur layer (which will look like a sharp part of the photograph) I want to move this around ... How do i do this ...any ideas

Applying Blur Filter Using MASK
Is it possible to apply the filter blur to a masked area? if so, how?

Thanks

Creating A 'Blur Mask' Clip
Apologies in advance for asking this question - I'm there's an answer somewhere on the forum, but I can't find it.

What i would like to do is create a movie clip (preferably on the timeline so I can motion tween it, but created dynamically if that's how it has to be done) that blurs the clip on the timeline layer beneath it (the clip to blur will probably be a bitmap).

I have read up on the Blur filter and can apply it directly to a clip using code of the form:

import flash.filters.BlurFilter;
var blurred:BlurFilter = new BlurFilter(5, 5, 4);
var storedBlur:Array = [blurred];
myClipToBlur.filters = storedBlur;

but I don't understand how to blur only a section of a clip, the section being that which is 'underneath' another 'blur masking' clip.

I hope I've made this easy to understand. Thanks in advance to anyone who can help.

Mask Component Loader With Soft Blur Border ?
Tiaka

Not Applicable
Please delete

thanks
tiaka

Moveable Mask After Blur Filter... Stops Moving
Okay, I have a bunch of pairs of images. And I have a custom cursor with a mask inside that displays alternate versions of the images by being a mask to them. All works beautifully, until I use a blurFilter transition to fade between one image to the next.

All the images get loaded before the mask is set, and I've narrowed the problem to the blur filter. What's happening, is that once I apply the blur filter, the mask seems to stop moving. The movieClip that it's nested in moves fine though. Basically, for a few seconds after I apply the blur, the mask works, but then it just stops moving and only displays the one location where it was when it stopped moving. If I don't apply the blur filter everything works fine. No problems at all...

Anyone encountered this before or have any thoughts? I'm stumped...

Blur Filter - Need To Blur Only The Objects At The Edge Of The Stage.
Hi everyone! I have created a slideshow which pulls in images with xml and then places them in a horizontal row in the middle of the stage. I have a previous and next button which cycles through the images.

I am trying to make the images blurry except for the one that is front and center on the screen. As you cycle through the images, they are blurry until they get to the center. How would I go about doing this?

I have imported the BlurFilter, but when I apply it to the imageholder mc, all of the images are blurry. How can I tell it to not blur the one currently in the center of the stage?

Thanks!

Blur Filter - Need To Blur Only The Objects At The Edge Of The Stage.
Hi everyone! I have created a slideshow which pulls in images with xml and then places them in a horizontal row in the middle of the stage. I have a previous and next button which moves this row of images left and right on the x axis.

I am trying to make the images blurry except for the one that is front and center on the screen. As you cycle through the images, they are blurry until they get to the center. How would I go about doing this?

I have imported the BlurFilter, but when I apply it to the imageholder mc, all of the images are blurry. How can I tell it to not blur the one currently in the center of the stage?

Spotlight
Can anyone tell me how to get a spotlight moving randomly around the screen, uncoverng the image below???? I know if has something to do with masks, but I have so far only been able to make the spotlight move in a straight line.

Thanks in advance
Rack1

Spotlight Help
i would like to make a spotlight that is going to light up a logo like on a stage can any one help on how to do this?

Spotlight
im making a game and i need a spotlight to go around the screen. i can do that but i need help with the actionscript. i need it so that when the spotlight goes over the main character, its game over. im stuck on that part.

Random Spotlight
Hello, How can I make a line, from its registration point, move Randomly up and down and at the same time it gets shorter or longer? Does that make sense. Something like a spotlight looking down diagonally from a helicopter.

Any help would be appreciated. Thanks!

Spotlight Effects
hi, im very new to flash but getting the hang of it pretty quick.

im trying to achieve a spotlight effect that follows the cursor around a black screen lighting up the page underneath.

i can do this with a mask but the final effect is a circle that is to sharp, what i really need is some kind of feathered edge to create a realistic light effect.

any ideas? any help with this is much appreciated.

thanks.

Spotlight Menu ?
hello there, i am trying to create a spotlight menu so when u click each button to can see the text appears with the light

any help? links will be usefull if u know

thanks

Spotlight - Unmask
Hey everyone, I had a question that I was wondering if anyone could help out with. This is just an add-on to a presentation for business class, so I need it fairly quickly but if I don't get anything, its not the end of the world.

Here is the plan:

Top Layer : BLACK
Bottom Layer: Image of my group members

Spotlight:
I want it so that its not just a circle on the screen. This image should point out what I mean.



I saw in a recent thread that someone from Toronto (can't remember your name man.. sorry) was making a site for a client and he had a spotlight effect going on. It was a red site, with a T on their logo. Too bad I can't remember. Anyways, that is the spotlight effect I'm looking for. I will search and edit if I find it.

Edit: Found it. It was by Thankful.




I have absolutely no idea how to achieve either the spotlight effect, nor the unmasking. Any help would be really appreciated .

Thanks,
DaVuLf

ESPN Spotlight
There's a flash based feature on ESPN.com called the Spotlight that runs thorugh several news pieces all in the same swf. It looks as though it might import content from an external source, maybe an XML file, for easy updating. Does anyone know how to build something like this or if there is a tutorial around on this site (or any other site)

thanks,

Andrew

[F8] Animating A Spotlight?
Hello,

For a cartoon I am working on I am doing a spotlight and I am wondering how to keep stuff not in the spotlight hidden and then when the spotlight passes over it , ti comes into view....any ideas?


Thanks


Edit: ack forgot the F8 tag

Spotlight Effect
Im trying to create a spotlight effect where the screen is dark except for the center,

the current way of having one giant movieclip with a hole in the center does not work.

Is there a better way to do this?

Spotlight In Flash
how can i make an animated spotlight in flash? do you know any tutorial about this or any idea?

Mouse-cursor Following Spotlight
Do you remember the masking (spotlight) example in the flash5 help file; I'm trying to achieve that effect but the only difference is I want the spotlight to go wherever the mouse cursor is. I tried masking, but it would not follow the mouse. Is there a solution with action-scripting?

Any suggestions?

Looking For A Pulsating Spotlight Effect?
I am working on a photographer site.If you check my test demo at>

www.w2s-inter.net/horst/test.html

Anyways the photographer im doing this for didnt really care for the spotlight effect i did here now.Does anyone have an idea how i could do this better.I guess he wanted the spotlight to kind of pulsate.Anyone have any interesting scripts or MC's for this.

Many thanks,

cc

Creating A Spotlight Effect...
Hi All...

Does anyone know how to create a double spotlight effect? One that moves back and forth like an old Hollywood opening?

Thanks so much,
Audrey

Random Spotlight Masks?
I would like to make random spotlights go across my webpage. Also I'd like them to be masks and reveal what's behind the >unlit< black page.

Any point in the right direction I'd really appreciate.
Thanks,
Jer

HELP With Making Spotlight/flashlight
hello how do i make an MC that has the effect of a flashlight or spotlight that is the cursor? also the spotlight must have a light to dark going from inside to outside THANKS

Basic Spotlight Animation
howdy,
i'm trying to create a basic spotlight animation as to provide a night club looking intro. i was able to do a simple single object tween, i.e. the fixture and light cast are one shape continuously. however, it would be much nicer to get the light to change shapes as the spotlight fixture moves. it seems like the light shadow should me a shape tween but can't get the shape tween to work at all....thanks! Aaron

file attached:

Flashlight/Spotlight Effect
Not just the masking circle...but the whole long bright extension until you get the circle for where the light hits the ground...anybody see anything like that?

Advincing Spotlight Effect In Flash 5
I have made a logo using the spotlight effect sample that comes with flash 5. It has just one circle moving across the text using a mask. I would like to have several spotlights. Is it possible. Can I do it on the same mask layer(because I tried and was having trouble doing that) or do need several masks?

Thanks in advance.

Tazmania

Flash Spotlight With Beam Effect
Can anyone please help me out with creating a flash spotlight. The movie must show the beam from the bottom of the screen.

Thanks:

Spotlight Light Effect In Flash
Hello,

I would like to create a spotlight light effect in flash which I could animate to fade in.
I don't want the drag mask thing, just a nice standard black gradient circle that surrounds the scene.

Could anyone point me in the right direction or tutorial for this?

Thanks for helping!

Copyright © 2005-08 www.BigResource.com, All rights reserved