Yes, of course!,

Create a simple FLA file for every test, and put in the first frame of each one:
Main.init(this);


In the first test, a textfield is created that has some FX and it is masked. Then, the mask size is changed. BUG: The text doesn´t "unmask". If you remove the FX, the movie play as expected.

The second test is a variation of the first, but instead of a mask, a scrollRect is used. In this case, neither the text nor the scrollRect changes.

The third test is the same as the second, but instead of a textfield, a simple movieclip (with cacheAsBitmap) is used.


----Begin test 1 [file: Main.as]-----
import flash.filters.DropShadowFilter;

class Main{
        private static var mainClass;
        private var myMC:MovieClip;

        private var $testMC:MovieClip;
        private var $mask:MovieClip;

        function Main(root:MovieClip) {
                myMC = root;

                var mc:MovieClip = $testMC = 
root.createEmptyMovieClip("test_mc", 1);
                var mask = $mask = root.createEmptyMovieClip("mask_mc", 2);
                drawRectangle(mask, 0, 0, 50, 50);

                var tf:TextFormat = new TextFormat("Verdana", 11, 0);
                var txt:TextField = mc.createTextField("test", 1, 0, 0, 200, 
200);
                txt.setNewTextFormat(tf);
                txt.text = "This is a test text";
                txt.filters = [new DropShadowFilter(1, 45, 0x00ff00, 100, 0, 0, 
2)];

                mc.setMask(mask);

                var w:Number = 50;
                var inc:Number = 1;
                var scope = this;

                mc.onEnterFrame = function(){
                        w += inc;
                        if (w == 100) inc = -1;
                        mask._width = w;
                }
        }

private function drawRectangle(m:MovieClip, x:Number, y:Number, w:Number, h:Number, alpha:Number){
                if (alpha == undefined) alpha = 100;
                m.beginFill(0, alpha);

                m.moveTo(x, y);
                m.lineTo(x+w, y);
                m.lineTo(x+w, y+h);
                m.lineTo(x, y+h);
                m.endFill();
        }

        static function init(rootMC:MovieClip) {
                Stage.scaleMode="noscale";
                Stage.align="TL";
                mainClass = new Main(rootMC);
        }
}
----End test 1-----

----Begin test 2 [file: Main.as]-----
import flash.filters.DropShadowFilter;
import flash.geom.Rectangle;

class Main{
        private static var mainClass;
        private var myMC:MovieClip;

        function Main(root:MovieClip) {
                myMC = root;

                var mc:MovieClip = root.createEmptyMovieClip("test_mc", 1);
                var mask:Rectangle = new Rectangle(0, 0, 50, 50);
                mc.scrollRect = mask;

                var tf:TextFormat = new TextFormat("Verdana", 11, 0);
                var txt:TextField = mc.createTextField("test", 1, 0, 0, 200, 
200);
                txt.setNewTextFormat(tf);
                txt.text = "This is a test text";
                txt.filters = [new DropShadowFilter(1, 45, 0x00ff00, 100, 0, 0, 
2)];

                var w:Number = 50;
                var inc:Number = 1;
                var scope = this;

                mc.onEnterFrame = function(){
                        w += inc;
                        if (w == 100) inc = -1;
                        if (w == 50) inc = 1;
                        mask.width = w;
                        mc.scrollRect = mask;
                }
        }

        static function init(rootMC:MovieClip) {
                Stage.scaleMode="noscale";
                Stage.align="TL";
                mainClass = new Main(rootMC);
        }
}
----End test 2-----

----Begin test 3 [file: Main.as]-----
import flash.geom.Rectangle;

class Main{
        private static var mainClass;
        private var myMC:MovieClip;
        private var $testMC:MovieClip;
        private var $mask:Rectangle;

        function Main(root:MovieClip) {
                myMC = root;

                var mc:MovieClip = $testMC = 
root.createEmptyMovieClip("test_mc", 1);
                var mc2:MovieClip = mc.attachMovie("testmc", "test2_mc", 1);
                mc2.cacheAsBitmap = true;

                var mask:Rectangle = new Rectangle(0, 0, 200, 200);
                mc.scrollRect = mask;

                var w:Number = 50;
                var inc:Number = 1;
                var scope = this;

                mc.onEnterFrame = function(){
                        w += inc;
                        if (w == 100) inc = -1;
                        if (w == 50) inc = 1;
                        mask.width = w;
                        mc.scrollRect = mask;
                }
        }

        static function init(rootMC:MovieClip) {
                Stage.scaleMode="noscale";
                Stage.align="TL";
                mainClass = new Main(rootMC);
        }
}
----End test 3-----

On Tue, 23 May 2006 23:31:45 -0300, Nehal <[EMAIL PROTECTED]> wrote:

I already reported that to MM (with very simple and small test cases)

Can you share test case?

Neh


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Marcelo
Volmaro
Sent: Tuesday, May 23, 2006 8:31 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Alpha Masking Weirdness

Indeed, it´s a buggy flash player behavior.
When you mix TextFields with Masks and FX, all goes wrong. It has nothing
to do with MTASC.
I already reported that to MM (with very simple and small test cases)

Maybe in the next update? Or maybe we need to wait for the V9 player.


On Tue, 23 May 2006 11:42:35 -0300, Rifled Cloaca <[EMAIL PROTECTED]>
wrote:

I've embedded the font, naturally. I'm getting extremely buggy behavior.
Sometimes the textfield will appear partially... only the right half of
the
textfield, but most of the time, not at all.

At one point, I found that removing the dropshadow filter from the
textfield, and then adding it back later programmatically helped the
problem.  But, now that I've added the alpha mask, it doesn't behave
right,
and it's very slow.

The only thing I can think of is that it has something to do with the
combination of movies compiled with MTASC versus the Flash IDE.  The
shell
is all code, compiled in MTASC, and it loads in modules created in the
Flash
IDE.



On 5/22/06, Vivek lakhanpal <[EMAIL PROTECTED]> wrote:

Try embedding font for the textfield.

Thanks,
Vivek

On 5/23/06, Rifled Cloaca <[EMAIL PROTECTED]> wrote:
>
> All,
>
> I'm masking a MovieClip with an alpha mask using cacheAsBitmap.  The
> MovieClip has a dynamic text field inside it that I populate at a
later
> time.  When I play the movie, the area where the textfield is remains
> empty.  If I drag the corner of the player to resize the movie, the
text
> magically appears.  Anyone run into this sort of weird behavior?
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com






--
_____________
Marcelo Volmaro
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to