prev | index | next

Flash8 - color matrix
8
24
685 bytes
2293 bytes
2005-10-12 00:00:00
2005-10-12 12:22:36
Oldes (oliva.david@seznam.cz)


To test the ColorMatrixFilter

Check out the ColorMatrixFilter! word. Since version 1.0.2 it possible to use such a shortcut.
Without this shortcut I would need to write full path: flash.filters.ColorMatrixFilter.
At this moment, there are defined these shortcuts:
BitmapFilter! flash.filters.BitmapFilter
BevelFilter! flash.filters.BevelFilter
BlurFilter! flash.filters.BlurFilter
ColorMatrixFilter! flash.filters.ColorMatrixFilter
ConvolutionFilter! flash.filters.ConvolutionFilter
DisplacementMapFilter! flash.filters.DisplacementMapFilter
DropShadowFilter! flash.filters.DropShadowFilter
GlowFilter! flash.filters.GlowFilter
GradientBevelFilter! flash.filters.GradientBevelFilter
GradientGlowFilter! flash.filters.GradientGlowFilter
BitmapData! flash.display.BitmapData
ColorTransform! flash.geom.ColorTransform
Matrix! flash.geom.Matrix
Point! flash.geom.Point
Rectangle! flash.geom.Rectangle
Transform! flash.geom.Transform
ExternalInterface! flash.external.ExternalInterface
FileReference! flash.net.FileReference
FileReferenceList! flash.net.FileReferenceList
Locale! mx.lang.Locale
TextRenderer! flash.text.TextRenderer


(swf8-colormatrix.rswf)
background 255.255.255
shp_circle: shape [
    gradient [
        radial colors [0.0.0 0.0.255 0.255.0 255.0.0]
    ]
    circle 160
]
spr_circle: sprite shp_circle
circle: place spr_circle [
    at 160x160
    actions [
        load [
            cacheAsBitmap: true
            _parent.info: "Move your mouse over this circle to change it's color"
        ]
        mouseMove [
            xPercent: 1 - ((_xmouse / 160))
            yPercent: 1 - ((_ymouse / 160))
            matrix: [
                yPercent 0 0 0 0   ;red
                0 xPercent 0 0 0   ;green
                0 0 xPercent 0 0   ;blue
                0 0 0 1        0   ;alpha
            ]
            filter: make ColorMatrixFilter! [matrix]
            filters: [filter]
            _parent.info: reform ["MM:" _xmouse _ymouse xPercent yPercent]
        ]
    ]
]
include %includes/txt_info.rswf
showFrame
end