Adobe 38040334 API Reference - Page 288
dreamweaver.getBehaviorEvent deprecated, dreamweaver.getBehaviorTag, Parameters dialog box
UPC - 883919090467
View all Adobe 38040334 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 288 highlights
DREAMWEAVER CS3 283 API Reference Example The dreamweaver.getBehaviorElement() function can be used in the same way as "dreamweaver.getBehaviorTag()" on page 283 to determine whether the selected action is appropriate for the selected HTML tag, except that it gives you access to more information about the tag and its attributes. As shown in the following example, if you write an action that can be applied only to a hypertext link (A HREF) that does not target another frame or window, you can use the getBehaviorElement() function as part of the function that initializes the user interface for the Parameters dialog box: function initializeUI(){ var theTag = dreamweaver.getBehaviorElement(); var CANBEAPPLIED = (theTag.tagName == "A" && ¬ theTag.getAttribute("HREF") != null && ¬ theTag.getAttribute("TARGET") == null); if (CANBEAPPLIED) { // display the action UI } else{ // display a helpful message that tells the user // that this action can only be applied to a // hyperlink without an explicit target] } } dreamweaver.getBehaviorEvent() (deprecated) Availability Dreamweaver 1.2; deprecated in Dreamweaver 2 because actions are now selected before events. Description In a Behavior action file, this function gets the event that triggers this action. Arguments None. Returns A string that represents the event. This is the same string that is passed as an argument (event) to the canAcceptBehavior() function. dreamweaver.getBehaviorTag() Availability Dreamweaver 1.2. Description Gets the source of the tag to which the behavior is being applied. This function is applicable only in action files. Arguments None.