Drop Shadow on Dynamic Text

Filters, blends, crazy new effects. Discuss new features in Flash 8 and how to use them best.
Post Reply
wereBear.swf
Posts: 1
Joined: Mon Jun 30, 2003 5:56 pm

Drop Shadow on Dynamic Text

Post by wereBear.swf » Sun Aug 07, 2005 5:25 pm

hey kinda new here, anyways im trying to display variables from an external text file, and it displays correctly until i used the drop shadow filter directly on my dynamic text boxes, then it started displaying partial text, but the whole content is in the text box you just dont see the whole thing. any of you guys experienced this?

your thoughts are most appreciated. thanks!

jen
Posts: 153
Joined: Mon Jun 30, 2003 5:56 pm

Re: Drop Shadow on Dynamic Text

Post by jen » Mon Aug 08, 2005 4:46 am

I'm not sure I can reproduce this issue, but then there are several different ways you could be using the dropshadow and text.

For instance, I tried this. There is a smallish textfield on the stage with the instance name my_txt (smaller so it's not showing the entire text) and I added a scrollbar component to scroll the text that doesn't show.

Code: Select all

// import the filter classes
import flash.filters.DropShadowFilter;

my_txt.border = true;
my_txt.multiline = true;
my_txt.wordWrap = true;

var lorem_lv:LoadVars = new LoadVars();
lorem_lv.onData = function (src:String):Void {
    if (src != undefined) {
        my_txt.text = src;
    } else {
        my_txt.text = "Unable to load external file.";
    }
}
lorem_lv.load("http://www.helpexamples.com/flash/lorem.txt");

    dropShadow.strength++;
    my_txt.filters = [dropShadow];

// create a filter
var dropShadow:DropShadowFilter = new DropShadowFilter(4, 45, 0x000000, 0.4, 10, 10, 2, 3);

var mouseListener:Object = new Object();
// create and apply a listener that controls the filter when the mouse moves
mouseListener.onMouseMove = function():Void {
    dropShadow.distance = (_xmouse / Stage.width) * 50 - 20;
    dropShadow.blurX = (_ymouse / Stage.height) * 10;
    dropShadow.blurY = dropShadow.blurX;
    my_txt.filters = [dropShadow];
};
Mouse.addListener(mouseListener);

It seems to be shadowing the text that doesn't appear immediately (ie: when I scroll through it, there is also a dropshadow applied). Can you link your file or paste your code?
themanstan

themanstan
Posts: 24
Joined: Mon Jun 30, 2003 5:56 pm

Re: Drop Shadow on Dynamic Text

Post by themanstan » Mon Aug 08, 2005 4:07 pm

I actually have had the same problem.....It was however an easy fix, and is actually listed in the code above by "jen".

You need to enable the following properties for your dynamic text field.

my_txt.multiline = true;
my_txt.wordWrap = true;
my_txt.autoSize = "center";//or "left", or "right", or true

Post Reply