263 posts
  • Antarctica
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Sold between 100 and 1 000 dollars
x360c says

How to I change this code to make the gradient go from left/right to up/down?

var matrix:Matrix = new Matrix();
var stage_bg:MovieClip = new MovieClip();
var type:String = GradientType.LINEAR;
var spread:String = SpreadMethod.PAD;
var interpolation:String = InterpolationMethod.RGB;
var colours:Array = [0x000000,0x000000];
var alphas:Array = [.7,1.0];
var ratios:Array = [0,50];
matrix.createGradientBox (50,200);
stage_bg.graphics.beginGradientFill (type,colours,alphas,ratios,matrix,spread,interpolation);
stage_bg.graphics.drawRect (0.0, 0.0,50,200);
stage_bg.graphics.endFill ();
addChild (stage_bg);

Thanks in advance.

245 posts
  • Beta Tester
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
  • Sold between 5 000 and 10 000 dollars
  • United Kingdom
enhancedmedia says

just rotate stage_bg by 90 degrees

263 posts
  • Antarctica
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Sold between 100 and 1 000 dollars
x360c says

I was wondering if there was a more professional method..

245 posts
  • Beta Tester
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 6-7 years
  • Referred between 1 and 9 users
  • Sold between 5 000 and 10 000 dollars
  • United Kingdom
enhancedmedia says

you can add a third property in the matrix which is rotation by radians so u could have:

you need the extra bit to convert to degrees


matrix.createGradientBox (50,200,(Math.PI/180)*90)

by
by
by
by
by
by