website promotion banner
eturnkeys
Your Ad Here
Flash & Swish  Home Flash & Swish Swish Tutorials Colour With SwishMax
rss

Colour With SwishMax

Author: Craig Lowe More by this author


Example:

Controls

Using the paint brush

Click on a colour above, and then click on a shape on the image to fill with the selected colour.

First Of All

Open SwishMax and set the stage size, i have used 450 x 400

Step. 1

You first need to create your colour palette so using the rectangle tool

Press and hold the shift key and drag out a small square, select the colour you wish the palette to be.

Repeat this until you have you colour desired colours, something like fig.1 below.

image 1

Fig.1

Step. 2

Now you need to add a selected colour view window.

Again using the rectangle tool, hold down the shift key and drag out a larger square.

Larger than the colour palette square see fig.2 below.

Name the shape using and give the shape a solid black colour fill #000000

Group as a sprite and name that using.

image 2

Fig.2

Step. 3

Add the shape you wish to colour in, for the purpose of this exercise, select the rectangle tool whilst holding the shift key down drag out a square whatever size you wish. Name the square col-fill. Give the shape a solid White colour fill #FFFFFF and no outline.

Step. 4

Right click on the col-fill shape select copy object, right click the shape again only this time select paste in place

Change the colour fill to none and add a line set the depth to 1 and the colour to black se fig.3 below.

image 3

Fig.3

Select the coll-fill shape and add the following script to it.

on (release) {
iColor = new Color(this);
iColor.setRGB(_root.fillColor);
delete iColor;
}

Now group the shape as a sprite by right clicking on the shape and select grouping then select as sprite, rename the sprite to fill-col

Step. 5

Now you need to add the scripts to the colour palettes. Starting at the top left colour palette add the following script to the shape.

on (release) {
fillColor = "0xFFC03F";
}
on (release) {
myColor = new Color("_root.using.using");
myColor.setRGB(0xFFC03F);

}

Now add the following script to the top right colour palette

on (release) {
fillColor = "0xEE082F";
}
on (release) {
myColor = new Color("_root.using.using");
myColor.setRGB(0xEE082F);
}

Now add the following script to the bottom left colour palette.

on (release) {
fillColor = "0xD09F29";
}
on (release) {
myColor = new Color("_root.using.using");
myColor.setRGB(0xD09F29);
}

And finally add the following script to the bottom right colour palette.

on (release) {
fillColor = "0x0099FF";
}
on (release) {
myColor = new Color("_root.using.using");
myColor.setRGB(0x0099FF);
}

You should now have something working like fig.4 below

Click on the colour palettes and then on the fill shape to see how it should work.

Fig.4

Now you know how to apply colours to shapes

Try creating something like the example at the beginning of the tutorial.




Rate this Material: Bad 1 2 3 4 5 Excellent
print this page tell a friend subscribe to newsletter subscribe to rss

Add comments to "Colour With SwishMax"