Old 04-20-2008   #1 (permalink)
Registered User
 
NikonErik's Avatar
 
Join Date: Nov 2007
Location: Long Island, NY
Posts: 119

Flicker effect in FLASH

I am trying to create a flickering neon sign. I looked here (of course) and found no references to creating the effect.

I looked elsewhere on the 'Net and found:
Dynamic Flickering Effect

I have followed the tutorial carefully but don't know why I can't get it to work. I am shure it would help if I had more than just a basic understanding of Flash!

Am I supposed to plug-in some numerical values??

Here's the code from the tutorial: Dynamic Flickering Effect

Copy & Paste the following code: ( All explained in my comments )

1.
// -------------------------------
2.
// Flickering MovieClip Effect
3.
// Pixel Hive Design : Custom Web, Media and Graphic Services
4.
// -------------------------------
5.
// All time in milliseconds. (1000 = 1 second)
6.
maxTB = 4000; // Maximum time between flickering
7.
minTB = 1000; // Minimum time between flickering
8.
flickerDuration = 2000; // How long flicker will last
9.
10.
// Get a random start time.
11.
flickerTime = getNewTime();
12.
13.
// Every frame execute the following code.
14.
this.onEnterFrame = function(){
15.
// Get current time in milliseconds.
16.
curTime = getTimer();
17.
18.
// Check if current time is past the time to flicker.
19.
if(curTime >= flickerTime){
20.
// Flickering.
21.
// Check if flicker has lasted the duration specified.
22.
if(curTime <= flickerTime+flickerDuration){
23.
// Continue flickering.
24.
// Alternate between alpha values.
25.
// This creates the flicker appearance.
26.
if( cnt >= 2){
27.
// Reduce alpha.
28.
// Lower this for more dramatic effect.
29.
this._alpha = 90;
30.
cnt = 0;
31.
} else {
32.
// Increase alpha.
33.
this._alpha = 100;
34.
cnt++;
35.
}
36.
} else {
37.
// Flicker lasted for duration.
38.
// Stop flickering and get next time to flicker.
39.
this._alpha = 100;
40.
flickerTime = getNewTime();
41.
}
42.
}
43.
}
44.
// Create a random time between maxTB and minTB specified.
45.
function getNewTime(){
46.
return getTimer() + (Math.random() * (maxTB-minTB))+minTB;
47.
}

Dynamic Flickering Effect : Conclusion

Change the "Neon_Sign" MovieClip to anything and it will flicker to your settings. It's a great effect to draw attention to interface elements.
__________________


There are always two people in every picture: the photographer and the viewer. ~Ansel Adams

NikonErik is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-21-2008   #2 (permalink)
Just unleashed!
 
unleash's Avatar
 
Join Date: Jul 2005
Location: Inbetween
Posts: 2,140
Blog Entries: 9

Alright, I can't completely follow the code....It is a bit messy....

but I think that I can make such an effect for you if you like...I have some spare time at the moment, so I will have a go
__________________
"I haven't failed, I've just found out
10.000 ways that don't work."

~Thomas Edison~
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-21-2008   #3 (permalink)
Registered User
 
NikonErik's Avatar
 
Join Date: Nov 2007
Location: Long Island, NY
Posts: 119

Thanks!
If you'd like to use my graphics:
http://farm3.static.flickr.com/2371/...22cbd31b_o.jpg
http://farm3.static.flickr.com/2349/...bed97175_o.jpg
__________________


There are always two people in every picture: the photographer and the viewer. ~Ansel Adams

NikonErik is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-21-2008   #4 (permalink)
Just unleashed!
 
unleash's Avatar
 
Join Date: Jul 2005
Location: Inbetween
Posts: 2,140
Blog Entries: 9

Well I tried it....changed it a bit.....and it works now:P

But if you tell me your e-mail...in an PM...I will send it you way
__________________
"I haven't failed, I've just found out
10.000 ways that don't work."

~Thomas Edison~
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-21-2008   #5 (permalink)
Registered User
 
NikonErik's Avatar
 
Join Date: Nov 2007
Location: Long Island, NY
Posts: 119

I got an email response for the Author of the tutorial. He said it was written for Flash 8.

Check you PMs . . . and thank you!
__________________


There are always two people in every picture: the photographer and the viewer. ~Ansel Adams

NikonErik is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-23-2008   #6 (permalink)
Registered User
 
NikonErik's Avatar
 
Join Date: Nov 2007
Location: Long Island, NY
Posts: 119

Thanks! I apprecieate the time you took with that . . .

Now, how can I make the flickering graphic a clickable link to another URL?

; )
__________________


There are always two people in every picture: the photographer and the viewer. ~Ansel Adams

NikonErik is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-23-2008   #7 (permalink)
Just unleashed!
 
unleash's Avatar
 
Join Date: Jul 2005
Location: Inbetween
Posts: 2,140
Blog Entries: 9

well the "flickering" graphic shouldn't be used as a clickable object...as it isn't always there!

The sollution to that is to make an rectrangle covering the flickering graphic(a new layer). and use that as the clickable part...

To do so, you will have to select the rectangle(from now on button), and press F8. By doing so you made the rectangle into a element. In the pop-up select "button" or "movie clip" and press ok(or accept or something alike ).

Than reselect that rectangle, and change the instance name to "btn". This way you can use actionscript to do things with the rectangle. You also need to change the "alpha" level to 100...so that its completely see-through.

Now after al this, select the layer you want to write your "global AS" in (I did put everything in the same layer...as there was only need for one). If you take the same layer as I did just continue below the AS that is already there.

The actionscript:
Code:
btn.onPress = function() {
	getURL("www.hvc.nl", "_blank");
};
That opens a new browser window in which "www.hvc.nl" is opened. The "btn" parts specifies what should have the effect. The "onPress" is the effect (mouseclick). And the "getURL" is used to go to the URL.

I hope this helps...let me know if it isn't clear..than I will try to explain better


BTW: I haven't got any new messages....no PM's for me
__________________
"I haven't failed, I've just found out
10.000 ways that don't work."

~Thomas Edison~
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-23-2008   #8 (permalink)
Registered User
 
NikonErik's Avatar
 
Join Date: Nov 2007
Location: Long Island, NY
Posts: 119

Okay, two things . . . . well three . . .
1) I truly appreciate the time you are taking to help me, I think we're almost there.

2) How can I quicken the flashing to look like a neon sign that's more frantic. To see how I want it to look . . . The webmaster loved my (non-AS animation of it) and applied it here. It's supposed to replace the gray shirt photo below on the left.

3) I can't seem to get the URL link portion to work. I will email you what I did as i followed your instructions.
__________________


There are always two people in every picture: the photographer and the viewer. ~Ansel Adams

NikonErik is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-24-2008   #9 (permalink)
Just unleashed!
 
unleash's Avatar
 
Join Date: Jul 2005
Location: Inbetween
Posts: 2,140
Blog Entries: 9

First of all, no thanks! :P

Than the flickering, I can't opun op your site as I get an 403 error "acces forbidden" message...

But If you just want to "speed up" the flickering, you should lower the two variables. The two variables I am talking about ("minTB and maxTB") controll the lenght of each flicker...so lowering these would shorten up the flickering.

If you are looking for a longer flickering, than you should change the "cnt" part. This variable determines when the flickering is over...if you change the " cnt>=3 " into " cnt>=4 " than you would have one extra flicker per time....if the number is changed into 2 than you would have 1 flicker less per time...

The link, you have to type in the whole adress. Sorry for that, in my example "www.hvc.nl" should be replaced by "http://www.hvc.nl". Than it loads just fine!
__________________
"I haven't failed, I've just found out
10.000 ways that don't work."

~Thomas Edison~

Last edited by unleash; 04-24-2008 at 01:20 PM.
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-24-2008   #10 (permalink)
Just unleashed!
 
unleash's Avatar
 
Join Date: Jul 2005
Location: Inbetween
Posts: 2,140
Blog Entries: 9

This is my script at the moment

Code:
 maxTB = 2000;
minTB = 500;
flickerDuration = 1500;
flickerTime = getNewTime();

this.onEnterFrame = function() {
	curTime = getTimer();
	if (curTime>=flickerTime) {
		if (curTime<=flickerTime+flickerDuration) {
			if (cnt>=3) {
				flick._alpha = 60;
				cnt = 0;
			} else {
				flick._alpha = 100;
				cnt++;
			}
		} else {
			flick._alpha = 100;
		}
	}
};
function getNewTime() {
	return getTimer()+(Math.random()*(maxTB-minTB))+minTB;
}

//Button effect////
btn.onPress = function() {
	getURL("http://www.hvc.nl", "_blank");
};
...
__________________
"I haven't failed, I've just found out
10.000 ways that don't work."

~Thomas Edison~
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-24-2008   #11 (permalink)
Registered User
 
NikonErik's Avatar
 
Join Date: Nov 2007
Location: Long Island, NY
Posts: 119

Oh . . . you must be outside of the USA. It's a message board relevant to the local region so non-US IP Addys were banned in order to fight the spam attacks they were getting.
__________________


There are always two people in every picture: the photographer and the viewer. ~Ansel Adams

NikonErik is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-24-2008   #12 (permalink)
Just unleashed!
 
unleash's Avatar
 
Join Date: Jul 2005
Location: Inbetween
Posts: 2,140
Blog Entries: 9

true :P

Im in the netherlands....europe, but maybe you can post that animation somewhere here...or email it to me....
__________________
"I haven't failed, I've just found out
10.000 ways that don't work."

~Thomas Edison~
unleash is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a 3D Tunnel Effect in Flash Tripper44 Tutorial Submission 1 04-07-2008 08:10 AM
how to achieve the matrix fighting effect done in the Xiao Xiao flash movies LimitLess Flash & Dynamic Media 1 05-21-2007 04:25 PM
[FLASH] Simple Flash Preloader Jacorre Tutorial Submission 3 01-22-2007 09:07 PM
How do i get this effect? help please fredmoreno42 Adobe Photoshop 2 09-30-2006 09:10 PM
How Do I get this effect? Ayu-Chii Adobe Photoshop 2 09-26-2006 07:20 AM


All times are GMT +1. The time now is 04:29 AM.
Content Relevant URLs by vBSEO 3.2.0 RC7

Design & Content © BioRUST 2007 :: PRIVACY STATEMENT :: LEGAL INFORMATION :: ADVERTISING MEDIA KIT