Adobe Dreamweaver API Reference CS5 Instrukcja Użytkownika Strona 52

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 533
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 51
47
DREAMWEAVER API REFERENCE
Flash integration
Last updated 8/27/2013
Example
The following example is used for setting up the menu:
function initializeMenuItem(menuID, menuName,extensionID, submenu)
{
var menuItem = {};
menuItem.menuId = menuID; //!< unique menu ID, if NULL menu is disabled
menuItem.nameUtf8 = menuName; //!< Item title, if "---" item is a separator
menuItem.extensionId = extensionID; //!< optional extension ID, used for panels only
menuItem.submenu = submenu; //!< if non-NULL, this is a submenu
return menuItem;
}
function setupMenu()
{
var menuItems = new Array();
menuItems.push(initializeMenuItem('id1','Call .swf
ActionScript',undefined,undefined));
menuItems.push(initializeMenuItem('id0','---',undefined,undefined));
menuItems.push(initializeMenuItem('id2','Call Dw JavaScript',undefined,undefined));
dw.flash.setMenu('Flickr',controlID,menuItems);
}
Note: Specify a function named "onSelectMenuItem" in the JavaScript file specified in the scriptPath in the object
passed to newControl.
The onSelectMenuItem is a menu Item Handler. It gets called with the corresponding menu ID when a command is
selected from the Floater's Fly Out menu.
The following example specifies the Callback handler definition in 'Configuration/flash/Flickr.js':
function onSelectMenuItem(menuID)
{
if (menuID == 'id1') {
var flashCallbackString = '<invoke name= " flash Callback"
returntype="xml">
<arguments><string>Hello</string></arguments></invoke>';
dw.flash.control Event('Flickr', flashCallbackString);
return("PlugPlugRequestCompleted");
} else {
alert ( ' You selected: menuID = ' + menuID);
return ( " PlugPlugRequestCompleted");
}
}
dreamweaver.flash.evalScript()
Availability
Dreamweaver CS4.
Description
This function is used to call a JavaScript function for one of the following purposes:
To execute a JavaScript function defined in the script file associated with the extension (for CSXS extensions).
The .js file defined in the scriptPath parameter for non-CSXS based Extensions.
Przeglądanie stron 51
1 2 ... 47 48 49 50 51 52 53 54 55 56 57 ... 532 533

Komentarze do niniejszej Instrukcji

Brak uwag