369
CHAPTER 4
C-Level Extensibility
The C-level extensibility mechanism lets you implement Macromedia Flash MX 2004 and
Macromedia Flash Professional MX 2004 extensibility files using a combination of JavaScript and
custom C code. You define functions using C, bundle them in a dynamic linked library (DLL) or
a shared library, save the library in the appropriate directory, and then call the functions from
JavaScript using the Flash JavaScript API (JSAPI).
For example, you might want to define a function that performs intense calculations more
efficiently than JavaScript does, which improves performance, or when you want to create more
advanced tools or effects.
This extensibility mechanism is essentially a subset of the Macromedia Dreamweaver MX 2004
API. If you are familiar with that API, you might recognize the functions in this API. However,
this API differs from the Dreamweaver API in the following ways:
•
This API does not contain all the commands in the Dreamweaver API.
•
All declarations of type
wchar_t
and
char
in the Dreamweaver API are implemented as
unsigned short
declarations in this API, to support Unicode when strings are passed.
•
The
JSVal JS_BytesToValue()
function in this API is not part of the Dreamweaver API.
•
The location where DLL or shared library files must be stored is different (see
“How
integrating C functions works” on page 369
).
How integrating C functions works
The C-level extensibility mechanism lets you implement Flash extensibility files using a
combination of JavaScript and C code. The process for implementing this capability is
summarized in the following steps:
1.
Define functions using the C or C++ language.
2.
Bundle them in a DLL file (Windows) or a shared library (Macintosh).
3.
Saves the DLL file or library in the appropriate location:
■
Windows 2000 or Windows XP:
C:\Documents and Settings\<user>\Local Settings\ Application Data\Macromedia\
Flash MX2004\<language>\Configuration\Templates\External Libraries
Summary of Contents for FLASH MX 2004-FLASH JAVASCRIPT DICTIONARY
Page 1: ...Flash JavaScript Dictionary ...
Page 16: ...16 Contents ...
Page 40: ...40 Chapter 2 Top level functions ...
Page 368: ...368 Chapter 3 Objects ...