Ticket #1048 (closed feature: fixed)
Unified addButton() call
|Reported by:||jeroen||Owned by:||zach|
|Cc:||pablo, zach||Forum thread:||http://www.longtailvideo.com/support/forums/jw-player/feature-suggestions/15509/addbuttondisplayobject|
Description (last modified by jeroen) (diff)
Rewrite of the dock/controlbar addButton() mechanism that:
- Works for Flash + HTML5
- Enhances current features
- Remains backward compatible
Example call using the dock (the controlbar can also be used):
player.getPlugin("dock").setButton( id:String, handler:Function, outGraphic:String, overGraphic:String=null );
Explanation of the parameters:
- id: Identifier of the button. If a button with an existing id is used, the button is replaced.
- outGraphic: URL to the button graphic image (preferably PNG b/c of its transparency). Plugins will generally want to skin this.
- overGraphic: URL to the button graphic image when the mouse is over the button. If not provided, there's no rollover.
This setButton() call contains several enhancements over the current AS3 addButton() function.
- Buttons are not colorized anymore by the skin. This fixes *wash out* colorizing issues.
- Buttons can be replaced by calling setButton() with the same id. This allows for (multi)toggles.
- The PNG is the whole button, not just the icon part. This allows for more flexible skinning (no more margin).
- Dock buttons contain just the icon, not the icon+text combo. This allows for more flexible skinning (control over text).
By using a different function name, this feature can remain compatible with the AS3 addButton(). Inside Flash, this call can probably re-use much of the AS3 code.
Since the mechanism produces fairly different results as the AS3 addButton(), we do not introduce it in the AS3 API now (perhaps in 6.0?).
- Type changed from bug to enhancement
- Summary changed from Refactor custom buttons to Refactor addButton()
- Component set to general
- Description modified (diff)
- Milestone changed from Player 6.0 to Player 5.5
- Type changed from enhancement to feature
- Summary changed from Refactor addButton() to Unified addButton() call
- Forum thread set to http://www.longtailvideo.com/support/forums/jw-player/feature-suggestions/15509/addbuttondisplayobject
- Status changed from closed to reopened
- Resolution fixed deleted
comment:10 Changed 2 years ago by zach
- Owner changed from jeroen to zach
- Status changed from reopened to new