263 posts
  • Has been part of the Envato Community for over 6 years
  • Located in Antarctica
  • Has sold $100+ on Envato Market
  • Has collected 1+ items on Envato Market
+1 more
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
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+4 more
enhancedmedia says

just rotate stage_bg by 90 degrees

263 posts
  • Has been part of the Envato Community for over 6 years
  • Located in Antarctica
  • Has sold $100+ on Envato Market
  • Has collected 1+ items on Envato Market
+1 more
x360c says

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

245 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+4 more
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)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by