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=75X=50 Y=75 vertX=280 Y=73X=10 Y=75
BLEU
ligne_baseB hB > hsliderB txtB > txtdynB bb > Bb
X=50 Y=100X=50 Y=100 bleuX=280 Y=98X=10 Y=100
ALPHA
ligne_baseA hA > hsliderA txtA > txtdynA ab > Ab
X=50 Y=125X=50 Y=125 noirX=280 Y=123X=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=200X=50 Y=200 rougeX=130 Y=198X=10 Y=200
GREEN
ligne_baseGa hGa > hsliderGa txtGa > txtdynGa ga > Ga
X=50 Y=225X=50 Y=225 vertX=130 Y=223X=10 Y=225
BLUE
ligne_baseBa hBa > hsliderBa txtBa > txtdynBa ba > Ba
X=50 Y=250X=50 Y=250 bleuX=130 Y=248X=10 Y=250
ALPHA
ligne_baseAa hAa > hsliderAa txtAa > txtdynAa aa > Aa
X=50 Y=275X=50 Y=275 noirX=130 Y=273X=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.

 


Si vous aimez le site

 

Select a language if you need :


Page chargée en 0.028 sec.

Dernière Modification : Mer 25 Janvier 2017 8:56
Copyright © 1999-2017 Jean-Paul Molina Tous droits réservés.

to Google