SWFbutton->addAction

(no version information, might be only in CVS)

SWFbutton->addAction -- Adds an action

Description

void swfbutton->addaction ( resource action, int flags )

警告

本函数是实验性的。本函数的行为,包括函数名称以及其它任何关于本函数的文档可能会在没有通知的情况下随 PHP 以后的发布而改变。使用本函数风险自担。

swfbutton->addaction() adds the action action to this button for the given conditions. The following flags are valid: SWFBUTTON_MOUSEOVER, SWFBUTTON_MOUSEOUT, SWFBUTTON_MOUSEUP, SWFBUTTON_MOUSEUPOUTSIDE, SWFBUTTON_MOUSEDOWN, SWFBUTTON_DRAGOUT and SWFBUTTON_DRAGOVER.

See also swfbutton->addshape() and swfaction().


add a note add a note User Contributed Notes
T_wigg
22-Sep-2003 12:41
I had a hard time finding a way to stop a sprite, so I figured I would post it.

     $button = new SWFButton();
     $button->addShape($box, SWFBUTTON_UP | SWFBUTTON_HIT | SWFBUTTON_OVER | SWFBUTTON_DOWN);
     $button->addAction(new SWFAction("
         setTarget('box');
         stop();
     "), SWFBUTTON_MOUSEUP);
    
     $item = $movie->add($button);

This works the same way with play();