New widget APIs in Adobe Captivate Classic

Adobe Captivate Classic provides the following new classes for widget developers to manage external resources in their widget:

  • CPWidgetInternalResourceLoader

  • CPWidgetExternalResourceLoader

CPWidgetInternalResourceLoader

Use this class to use images in a widget. The resources are embedded into the SWF output file as PNG files. You need to use ‘ByteArray’ to use these resources.

You can use this class in Stage mode, Edit mode, or at run-time.

This class contains the following functions:

browseResource

public function browseResource(): int

This functions works only in Edit mode. Adobe Captivate Classic library is launched and you can select or browse for the resource.

This function returns an integer (resource number).

getResourceStream

public function getResourceStream (resourceID:int) : ByteArray

This function works in Stage mode, Edit mode, and at run-time. You need to provide the resource number as the input parameter and the function returns the ByteArray for that resource.

CPWidgetExternalResourceLoader

Use this class to use music or video files in a widget. These resources are externalized and are not embedded into the Adobe Captivate Classic SWF file. The resources are copied as separate files in the same directory as the SWF output file.

To use these resources, you need to get the file path of the resources.

This class contains the following functions:

getResourcePath

public function getResourcePath (Resource ID:int) : String

This function works in Stage mode, Edit mode, and at run-time. You need to provide the resource number as the input parameter and the function returns the path of that resource.

 Adobe

احصل على مساعدة بشكل أسرع وأسهل

مستخدم جديد؟