John Carney
asked on
In Flash Mx2004, how do I create more than one shape with Action Script?
The script below will produce one gradient ball 50x50 at x=50, y=50. How do I modify it so that it will simultaneously produce three more shapes at these locations:
x=50, y=300
x=300, y=50
x=300, y=300
Thanks!
John
x=50, y=300
x=300, y=50
x=300, y=300
Thanks!
John
import flash.geom.*
//
var mc:MovieClip = this.createEmptyMovieClip("grad", 1);
var colors = [0xDCE0B6, 0x000000, 0x000000];
var alphas = [100, 100, 0];
var ratios = [0, 254, 255];
var matrix = {matrixType:"box", x:50, y:50, w:50, h:50, r:(45/180)*Math.PI};
mc.beginGradientFill("radial",colors,alphas,ratios,matrix);
mc.moveTo(50,50);
mc.lineTo(50,100);
mc.lineTo(100,100);
mc.lineTo(100,50);
mc.lineTo(50,50);
mc.endFill();
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The answers were so close in time, and together taught me 2 different ways to explore doing it, I'd like to split up the points woth the majority going to sibgig for getting there first.
Oh and please take a look at my next question which builds on your answers here: https://www.experts-exchange.com/questions/23012179/Flash-MX2004-Creating-2-different-kinds-of-shapes-with-script.html
Thanks again!
John