Custom colors with setTransform
The purpose is to show behavoiur of parameters in method setTransform which handles colors.
This function acts upon RGB, alpha and percentage of colors as well
We gonna modify parameters using horizontal cursors. We'll use scripts as well.
You couldn't test in SwishMaw, only in browser and in FlashPlayer.
I suppose you know well how to create objects, thus I wont insist on.
⇒ animation ⇐
Creating Objetcs
1 - Set up movie sizes 640x480 and background color#FFFFCC.
Frame Rate 35.
2 - Insert a text as first label. Follow images
3 - Creating 4 lines with cursors for the gap.
Follow the steps :
an horizontal line, & cursor, a dynamic text, a title.
At first, horizontal line :
The cursor. Deaw a rectangle :
Menu Modify / Convert / Convert to Sprite.
Name : hR Target toggled.
Dynamic text :
Title. Insert a static text :
For the others, watch out data in array; repeat and adapt the steps.
VERT | |||
---|---|---|---|
ligne_baseG | hG > hsliderG | txtG > txtdynG | gb > Gb |
X=50 Y=75 | X=50 Y=75 vert | X=280 Y=73 | X=10 Y=75 |
BLEU | |||
---|---|---|---|
ligne_baseB | hB > hsliderB | txtB > txtdynB | bb > Bb |
X=50 Y=100 | X=50 Y=100 bleu | X=280 Y=98 | X=10 Y=100 |
ALPHA | |||
---|---|---|---|
ligne_baseA | hA > hsliderA | txtA > txtdynA | ab > Ab |
X=50 Y=125 | X=50 Y=125 noir | X=280 Y=123 | X=10 Y=125 |
4 - Insert a text for the second title. Watch out images
5 - Creating 4 lines with cursors for percentage.
The process is the same as described before but baseline is 200 width
RED | |||
---|---|---|---|
ligne_baseRa | hRa > hsliderRa | txtRa > txtdynRa | ra > Ra |
X=50 Y=200 | X=50 Y=200 rouge | X=130 Y=198 | X=10 Y=200 |
GREEN | |||
---|---|---|---|
ligne_baseGa | hGa > hsliderGa | txtGa > txtdynGa | ga > Ga |
X=50 Y=225 | X=50 Y=225 vert | X=130 Y=223 | X=10 Y=225 |
BLUE | |||
---|---|---|---|
ligne_baseBa | hBa > hsliderBa | txtBa > txtdynBa | ba > Ba |
X=50 Y=250 | X=50 Y=250 bleu | X=130 Y=248 | X=10 Y=250 |
ALPHA | |||
---|---|---|---|
ligne_baseAa | hAa > hsliderAa | txtAa > txtdynAa | aa > Aa |
X=50 Y=275 | X=50 Y=275 noir | X=130 Y=273 | X=10 Y=275 |
6 - Now the test zone. Draw a square.
Menu Modify / Convert / Convert to Sprite.
Name : test Target toggled.
Scripts
In Outline, select scene, get into Expert Mode. Enter following script :
In Outline, click on sprite hx of cursor, then on cursor hsliderX
Here 's the script for hsliderAa
(You'll adapt for other cursors, see red parts)
Attention : 4 en largeurB = 200 et 4 en largeurA = 510
Check out your scripts where char are in red and width.
Export HTML+SWF, then test.