A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Filters

  1. #1
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244

    Filters

    Anyone care to give example of using filters in script for flash 8 export.

    For example this code
    code:

    import flash.filters.*;

    //sets up the blur
    var blur = new BlurFilter(5, 5, 3);

    //applies the blur
    ball_mc.filters = [blur];

    //function for rollOver
    ball_mc.onRollOver = function() {
    this.onEnterFrame = function() {
    blur.blurX -= (100-blur.blurX)/25;
    blur.blurY = blur.blurX;
    ball_mc.filters = [blur];
    }
    }


    //function for rollOut
    ball_mc.onRollOut = function() {
    this.onEnterFrame = function() {
    blur.blurX += (50-blur.blurX)/25;
    blur.blurY = blur.blurX;
    ball_mc.filters = [blur];
    if(blur.blurX >= 5) {
    delete this.onEnterFrame;
    }
    }
    }


    from flash doesnt work so I assume there are some differences.

    Seems like Chris had some examples but I could not find them.

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Sort of found my answer.

    In flash you use the import function
    import flash.filters.*;

    //sets up the blur

    var blur = new BlurFilter(5, 5, 3);


    in Koolmoves you don't use this but rather refer to the filter
    var blur = new flash.filters.BlurFilter(5, 5, 3);
    then the rest of the example works.

    This one change will let you work with Flash filter examples.

  3. #3
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    That's true.
    KoolMoves doesn't support the import statement.

    Another way would be to create a shortcut in the beginning of your movie
    _global.BlurFilter = flash.filters.BlurFilter;
    After that you could use BlurFilter like the original source code.

  4. #4
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Seems like Chris had some examples but I could not find them.
    I passed on submitting the old filter ports I used to serve (since the exchange I no longer carry files locally) since Bob added filtering to the GUI. I figured anyone advanced enough to code their own could probobly do better than my examples so I just left all the code for dead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center