You create a
colorTransformObject
myColorTransform = new Object();
myColorTransform.ra = 50;
myColorTransform.rb = 244;
myColorTransform.ga = 40;
myColorTransform.gb = 112;
myColorTransform.ba = 12;
myColorTransform.bb = 90;
myColorTransform.aa = 40;
myColorTransform.ab = 70;
You can also use the following syntax to create a
myColorTransform = { ra: '50', rb: '244', ga: '40', gb: '112', ba: '12', bb:
'90', aa: '40', ab: '70'}
Example
This example creates a new Color object for a target SWF file, creates a generic object called
myColorTransform
pass the
colorTransformObject
place it on Frame 1 on the main Timeline and place a movie clip on the Stage with the instance
name
, as in the following code:
my_mc
// Create a color object called my_color for the target my_mc
my_color = new Color(my_mc);
// Create a color transform object called myColorTransform using
// the generic Object object
myColorTransform = new Object();
// Set the values for myColorTransform
myColorTransform = { ra: '50', rb: '244', ga: '40', gb: '112', ba: '12', bb:
'90', aa: '40', ab: '70'};
// Associate the color transform object with the Color object
// created for my_mc
my_color.setTransform(myColorTransform);
ContextMenu class
Availability
Flash Player 7.
Description
The ContextMenu class provides runtime control over the items in the Flash Player context
menu, which appears when a user right-clicks (Windows) or Control-clicks (Macintosh) on Flash
Player. You can use the methods and properties of the ContextMenu class to add custom menu
items, control the display of the built-in context menu items (for example, Zoom In and Print),
or create copies of menus.
You can attach a ContextMenu object to a specific button, movie clip, or text field object, or to an
entire movie level. You use the
this. For more information about the
TextField.menu
To add new items to a ContextMenu object, you create a ContextMenuItem object, and then add
that object to the
context menu items, see the
parameter as follows:
with the properties defined above, and uses the
to a Color object. To use this code in a Flash (FLA) document,
property of the Button, MovieClip, or TextField classes to do
menu
menu
.
ContextMenu.customItems
ContextMenuItem class
colorTransformObject
property, see
Button.menu
array. For more information about creating
entry.
parameter:
method to
setTransform()
,
, and
MovieClip.menu
ContextMenu class
335
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?
Questions and answers