This content has been marked as final. Show 3 replies
pass gradient01 and gradient02, as well as a movieclip (like the main timeline), as parameters in new BgGradient constructor statement. and define color in your constructor.
Would that mean, I have to pass everything single one of the variables into the BgGradient constructor function? Like I said, I a new to this, so pretty confused as of yet.
Thanks a lot for the help!
you don't have to pass anything, except you must pass something that has can reference a graphics class member to which you can apply your begingradientfill method.
but if you want to specify gradient01 and gradient02 from outside your class, that would be one way to do it. you could also use a setter to define those variables outside your constructor.
which is best depends upon what you want to do. if you always know those variable values when your create a class member, pass them in the contructor. otherwise, a setter is a good way to go.