Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1105161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:35:18+00:00 2026-05-17T01:35:18+00:00

i have a few filters on a sprite. on mouse over i would like

  • 0

i have a few filters on a sprite. on mouse over i would like to access one of the filters in the filters array, but i’m having a bit of trouble trying to accomplish this.

mySprite.filters = [new DropShadowFilter(), new GlowFilter(), new BlurFilter()];
mySprite.addEventListener(MouseEvent.MOUSE_OVER, mouseOverEventHandler);

function mouseOverEventHandler(evt:MouseEvent)
     {
     //obtain indexOf the GlowFilter
     trace(evt.currentTarget.filters[evt.currentTarget.filters.indexOf([Object GlowFilter])]));
     }

the above code doesn’t work. what’s the proper way to get the index of a specific filter in a filters array?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:35:19+00:00Added an answer on May 17, 2026 at 1:35 am

    If I understand correctly, you’re essentially trying to do this:

     var index:int = evt.currentTarget.filters.indexOf([Object GlowFilter]);
    

    The bracketed part is not valid Actionscript it shouldn’t even compile. What you need to do is to iterate over the filters and test them yourself since there’s no way to search for a specific class with indexOf.

    Try this instead:

    function mouseOverEventHandler(evt:MouseEvent) {
        var glowFilter:GlowFilter;
        for (var i:int = 0; i < evt.target.filters.length; i++) {
            if (evt.target.filters[i] is GlowFilter) {
                glowFilter = evt.target.filters[i];
                break;
            }
        }
    }
    

    Also, if you’re going to fiddle with the filters in the array Flash won’t accept in-place modifications, so you need to re-set the array once you’ve changed it:

    function mouseOverEventHandler(evt:MouseEvent) {
        var glowFilter:GlowFilter;
        for (var i:int = 0; i < evt.target.filters.length; i++) {
            if (evt.target.filters[i] is GlowFilter) {
                glowFilter = evt.target.filters[i];
                break;
            }
        }
    
        if (!glowFilter) return;
    
        glowFilter.blurX = 10;
        var filters:Array = evt.target.filters;
        filters[i] = glowFilter;
        evt.target.filters = filters;
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few before filters which I am using to control access to
I have a registration form with a few fields. One of them looks like
I have few text fields like SSN , phone number and email id. I
I have a Silveright app that allows users to specify filters on a few
I'm working on an application with quite a few related models and would like
I have a few fields I'd like users to be searching across when looking
I have an NSView (lets call it mainview) with a few subviews. One of
I have groups with specific filters. Within these groups I have few Count expression
Say you have a few DropDownLists that filter data: Car Make: [Ford,Chevrolet,etc] Car Year:
I have few questions about ssis transction isolation levels. consider a scenario:I have an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.