-
[F8] apply filter to mc drawn with api
Obvioulsy I'm blind.... WHY is't this code working...??!!!!!
Code:
import flash.filters.GlowFilter;
this.createEmptyMovieClip("mc_line",1);
with ("mc_line"){
lineStyle(20, 0xd1bca3,100);
_root.moveTo(0, 160);
_root.lineTo(Stage.width, 160);
// glow on the line
var glow:GlowFilter = new GlowFilter(0x003a68, 0.5, 0, 10, 5, 10,true);
var myTempFilters:Array = mc_line.filters;
myTempFilters.push(glow);
mc_line.filters = myTempFilters;
}
I've tried the glow-on-the-line part inside and outside the with statement.
The glow-on-the-line part works fine if I put an instance of a movie clip on the stage but not as above...
Why?!
I'd be greatful for a hint in the right direction...
-
I just found out what is wrong...
Code:
import flash.filters.GlowFilter;
this.createEmptyMovieClip("mc_line",1);
with ("mc_line"){
lineStyle(20, 0xd1bca3,100);
_root.moveTo(0, 160);
_root.lineTo(Stage.width, 160);
See the little nasty quotation marks around line after with....?
Take them away and it works like charm...
AS is fun but sometimes syntax just kills you, right?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|