3 Replies Latest reply on Mar 29, 2011 6:30 PM by Rothrock

    How do you blur?

    EranthisAconite Level 1

      Yeah, what I'm expecting is not as simple.

      I don't understand why every flash program now seems to have no blur filters anymore. I use to use them all the time and now I have nothing to use for filters. I inspected the code:

       

      import flash.filters.BlurFilter;
      var blur:BlurFilter = new BlurFilter(10, 0, 4);
      floodlight_beam.filters = [blur]

       

      Doesn't seem to work.

      Thing is that the movieclip is in another movieclip so I had the code posted there. Also posted on the first scene. Nothing works.

      I can say flash downgraded when filters were removed.

      Someone help asap.

        • 1. Re: How do you blur?
          Rothrock Level 5

          Blur filters weren't removed. They are still alive an well. You do have to be publish to Flash 8 or higher for them to work.

           

          Generally you should put all the code on the main timeline and avoid putting code inside/or on clips. That makes it difficult to maintain and update the code.

           

          It is possible that you have some kind of scoping problem or that the clip you are trying to apply doesn't exist when you are trying to apply the code.

           

          Add a trace just at the code:

           

          trace("Does floodlight_beam exist: "+floodlight_beam);

           

          What does the trace say?

          • 2. Re: How do you blur?
            EranthisAconite Level 1

            I added the code at first:

             

            import flash.filters.BlurFilter;
            var blur:BlurFilter = new BlurFilter(10, 0, 4);
            floodlight_beam.filters = [blur];

            trace("Does floodlight_beam exist: "+floodlight_beam);

             

            but had to remove the import flash.filters.BlurFilter; (disables the game altogether):

             

            var blur:BlurFilter = new BlurFilter(10, 0, 4);
            floodlight_beam.filters = [blur];

            trace("Does floodlight_beam exist: "+floodlight_beam);

             

            "Does floodlight_beam exist" does appear in the output

            but the floodlight_beam is still unblurred.

            • 3. Re: How do you blur?
              Rothrock Level 5

              Well there is no reason that import statement should disable the game. So that is your first problem. What version of flash are you using and what version are you publishing to?

               

              What happens if you create a brand new document (with the same publish settings as your current project), create a new movieclip (just a simple square or something), and use this code? If it works there—and it should—then you have to figure out what is different about your project.

               

              So if "Does floodlight_beam exist:" is the only thing you get then the clip doesn't exist in that scope or at that time. You should see something like:

               

               

              Does floodlight_beam exist: _level0.someclip.floodlight_beam