# The as_value Object Type

The as_value class is used throughout the interpreter to create generic objects to hold data.

## Data Types

The following data types are supported: NULLTYPE, BOOLEAN, STRING, NUMBER, OBJECT, AS_FUNCTION, and MOVIECLIP (sprite). The type C_FUNCTION is being deprecated.

## Determining the Type

Several methods allow you to determine if a value stored in as_value is of a specific type. These follow the form of is_TYPE, for example is_as_function() and is_number(). In general, the type names match the data types listed above, with the exception of the type MOVIECLIP which has a method is_sprite().

## Fetching the Value

Another set of methods will return a representation of the value as a particular type. They follow the to_TYPE naming convention. Examples are to_number() and to_bool(). The type names are as listed earlier, except for MOVIECLIP, which uses to_sprite().

## Setting the Value and Type

Finally, there is the set_TYPE series of methods. They change the type to the type specified in the method name, and set the value to the one given as an argument. It is also possible to accomplish the same thing with the = operator. Again, type names match those named earlier, except in the case of MOVIECLASS. Its method is called set_sprite().

## Further Reading

Please refer to as_value.h or the Doxygen documentation (see 'Processing The Documentation' in the &appname; manual for instructions on generating documents with Doxygen) for more information about which methods are available for the as_value object.