What's broken about it? I recently had an issue with filters working 
differently in the browser than the authoring environment ...

_ _ _
Erik Mattheis
Senior Web Developer
Minneapolis
T  952 346 6610
C 612 377 2272

Weber Shandwick
Advocacy starts here.

PRWeek Global Agency Report Card 2009 - Gold Medal Winner
The Holmes Report Global Agency of the Year
PR News Agency of the Year

-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of John Singleton
Sent: Monday, March 08, 2010 11:31 AM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] swf doesn't work the same online

Hi;
I built a swf that works the way I want it in Flash, but when I upload it, it 
acts differently! I built buttons in as3 like this:

function nav(nname:String, nurl:String, myX:int, bgcolor:uint):void
        {
            myfont2 = 'Arial';
            mydize = 15;
            mytxtcolor = 0x000000;
            myborder = true;
            mybordercolor = 0xFFFFFF;
            myY = 170;
            myfill = 0x97f9ec;
            mynav = new TextField();
            var format:TextFormat = new TextFormat();
            format.font = myfont2;
            format.size = mysize;
            mynav.htmlText = '<a href="' + nurl + '.html">' + nname + '</a>';
            mynav.textColor = myTextColor;
            mynav.border = myborder;
            mynav.borderColor = mybordercolor;
            mynav.background=true;
            mynav.backgroundColor = bgcolor;
            mynav.autoSize = TextFieldAutoSize.LEFT;
            mynav.x = myX;
            mynav.y = myY;
            mynav.setTextFormat(format);
            var navdrop:DropShadowFilter = new DropShadowFilter();
            navdrop.color = 0x000000;
            navdrop.blurX = 3;
            navdrop.blurY = 3;
            navdrop.angle = 0;
            navdrop.alpha = 0.5;
            navdrop.distance = 3;
            var navfilters:Array = new Array(navdrop);
            mynav.filters = navFiltersArray;
            var nsprite:Sprite = new Sprite();
            addChild(nsprite);
            nsprite.name = nname;
            nsprite.addChild(mynav);
            var len:int = mynav.numLines;
            for (var i:int = 0; i < len; i++) 
            {
                var metrics:TextLineMetrics = mynav.getLineMetrics(i);
                with(nsprite.graphics)
                {
                    beginFill(myfill, 1);
                    drawRect(mynav.x, mynav.y, metrics.width + 4, 
metrics.height + metrics.descent + 1);
                    endFill();
                }
            }
            addChild(nsprite);
            nsprite.addEventListener(MouseEvent.ROLL_OVER, onRollOverHandler);
            nsprite.addEventListener(MouseEvent.ROLL_OUT, onRollOutHandler);
            nsprite.addEventListener(MouseEvent.CLICK, onClickHandler);
            nsprite.addEventListener(MouseEvent.MOUSE_DOWN, onPressHandler);
            nsprite.addEventListener(MouseEvent.MOUSE_UP, onReleaseHandler);
            nsprite.mouseChildren = false;
            nsprite.buttonMode = true;
        }
        
        function onRollOverHandler(e:MouseEvent) 
        {
            if (e.currentTarget.name == ' Home ') 
            {
                Navigation(' Home ', 'index', 235, 0x97f9ec);
            }
        }

        function onRollOutHandler(e:MouseEvent)
        {
            if (e.currentTarget.name == ' Home ') 
            {
                Navigation(' Home ', 'index', 235, 0x0e778a);
        }

        function onClickHandler(e:MouseEvent)
        {
            mynav.textColor = 0x000000;
            mynav.borderColor = 0xFFFFFF;
        }

        function onPressHandler(e:MouseEvent)
        {
            if (e.currentTarget.name == ' Home ') 
            {
                Navigation(' Home ', 'index', 235, 0xffffff);
            }
        }

        function onReleaseHandler(e:MouseEvent)
        {
            if (e.currentTarget.name == ' Home ') 
            {
                Navigation(' Home ', 'index', 235, 0x0e778a);
            }
        }

I can't figure out why it doesn't work online like it does in Flash. Online, 
it's all broken. Is this common? What should I do?
Thanks,
John


      
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to