Solved

Fade in Actionscript filter

Posted on 2009-07-09
5
269 Views
Last Modified: 2013-11-11
Hello,

I'm using actionscript to create and apply a glow filter to an object when the mouse is pointed at it. Currently, the glow filter comes in at full strength immediately, but I would like it to fade in from an alpha of 0 to 100. Is it possible to achieve this effect? My code below:
// Makes the filter available to use in the Movie.

import flash.filters.GlowFilter;
 

// Creates a variable with info about the Filter settings

var imageGlow = new GlowFilter (0xFFFFFF,.75,5,5,2,10,false,false,false);
 

image.onRollOver = function(){

	image.filters = [imageGlow];	

}

Open in new window

0
Comment
Question by:Spiderstave
  • 3
  • 2
5 Comments
 
LVL 22

Expert Comment

by:rascalpants
ID: 24817187
I would highly recommend you look at TweenMax...  it has the engine you need and is very easy to use...

http://blog.greensock.com/tweenmaxas3/


take a look at that site, and then come back if you have any questions as to how to implement.


rp
0
 
LVL 22

Accepted Solution

by:
rascalpants earned 500 total points
ID: 24818196
actually, it looks like you need AS 2, right?

here is the link...


http://blog.greensock.com/tweenmaxas2/


and here is how you would implement a glowfilter


import gs.*;
import gs.easing.*;

TweenMax.to(mc, 1, {glowFilter:{color:0x91e600, alpha:1, blurX:30, blurY:30}});



rp
0
 

Author Comment

by:Spiderstave
ID: 24818267
That's a really cool tool, thanks for the heads up!
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 24818353
TweenMax is actually the standard now for animation...  I don't know of anyone who is using the native Tween class to animation anything... and with the added power of tinting and setting up filters, it works great...


rp
0
 

Author Comment

by:Spiderstave
ID: 24818506
Awesome, I will have to look into it in greater detail. Do you know if it uses less CPU resources than the native Tween class? I'm building a pan/zoom site right now: http://www.outshinehosting.com/ee/movement2.html, and the zooming is starting to get really sluggish. Granted, the movieclip that is being scaled has tons of large bitmaps in it, so there may be no way to make that animation smoother.

I'll try to implement TweenMax to solve another issue that has been plaguing me this week. I'm trying to zoom back in on the red crosshairs but I can't get it perfectly centered. It's scaling the container clip before I pan that is messing me up, I can't figure out how to compensate for the scaled container clip. I've had another question open regarding the issue for a couple of days and haven't gotten any responses. If it's something you are familiar with I'd be really grateful if you could take a quick look: http://www.experts-exchange.com/Software/Photos_Graphics/Web_Graphics/Macromedia_Flash/ActionScript/Q_24554564.html?cid=473

Thanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now