Adobe Captivate 6 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 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 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.

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy