Link to home
Start Free TrialLog in
Avatar of petersego
petersego

asked on

How can I make a function out of this

Im trying to set a mask consisting of 9 squares and want to make a function that creates the squares out of th e following, that works in it self

mask_mc.createEmptyMovieClip("block1", 31);
bgcontainer(mask_mc.block1, 66, 66, 1, 0x000000, 100);
mask_mc.block1._x = 66;
mask_mc.block1._y = 66;

so I created a function looking like this:

function maskBlock(bDepth, bWidth, bHeight, bX, bY){
      var newBlock = "block" +bDepth;
      var newDepth = "3" +bDepth;
      mask_mc.createEmptyMovieClip("block" +bDepth, newDepth);
      mask_mc.newBlock._x = bX;
                     mask_mc.newBlock._y = bY;
      bgcontainer(mask_mc.newBlock, bWidth, bHeight, 1, 0x000000, 100);
}
maskBlock(1,66,66,0,0);

but that result in that I get an error saying that there is missing a 'with' action

What is wrong and how should I do it right....
ASKER CERTIFIED SOLUTION
Avatar of moagrius
moagrius
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of petersego
petersego

ASKER

Just great.
The Depth-number I wanted was 31, 32 and so on, but apart from that, I made it work, thanks.