{"id":13744955,"url":"https://github.com/StephanPartzsch/as3-buttons","last_synced_at":"2025-05-09T04:32:45.528Z","repository":{"id":3130198,"uuid":"4158245","full_name":"StephanPartzsch/as3-buttons","owner":"StephanPartzsch","description":"library for the usage of timeline based button in ActionScript 3","archived":false,"fork":false,"pushed_at":"2012-11-16T14:38:18.000Z","size":1488,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-03T05:05:26.212Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"etishor/CQRSEventSourcingSample","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StephanPartzsch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-27T12:53:39.000Z","updated_at":"2021-01-19T07:32:53.000Z","dependencies_parsed_at":"2022-07-09T00:30:22.752Z","dependency_job_id":null,"html_url":"https://github.com/StephanPartzsch/as3-buttons","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanPartzsch%2Fas3-buttons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanPartzsch%2Fas3-buttons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanPartzsch%2Fas3-buttons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanPartzsch%2Fas3-buttons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StephanPartzsch","download_url":"https://codeload.github.com/StephanPartzsch/as3-buttons/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224819696,"owners_count":17375311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T05:01:19.221Z","updated_at":"2024-11-15T17:30:46.564Z","avatar_url":"https://github.com/StephanPartzsch.png","language":"ActionScript","readme":"#AS3 Buttons#\n\n   \n\nThis library provides an easy way to handle timeline based graphics as buttons in ActionScript 3. \nSome frame labels are required, but beside this, the button can be very simple with only one graphical state. The library extends this graphical representation with the usual button behavior (buttonMode, enable/disable) and an optional heavy click protection.\n\nBut the classical meaning of this library is represented by the `FrameButton`. It controls the graphical states of the button for `MOUSE.ROLL_OVER`, `MOUSE.ROLL_OUT`, `MOUSE.MOUSE_DOWN` and `MOUSE.MOUSE_UP` events as well as for a disabled state. If the graphical states for `MOUSE.ROLL_OVER` and `MOUSE.ROLL_OUT` events contain animations the library calculates the appropriate frame of the next label. This is done by taking the position of the playhead in the current label into consideration.\nFurthermore the library contains a `ToggleFrameButton` which handles a selection state in addition to the `FrameButton`. This class manages the graphical states for mouse events and the disabled state if the button is selected `true` or `false`.\n\nWith `LabeledFrameButton` and `LabeledToggleFrameButton` a label text field can be set and managed. The text field has to have the name `labelText`. It is possible to place this text field directly on the timeline or wrap it in an other MovieClip named `textContainer`.\nMoreover the label text can be centered vertically, if the text field is bigger than required.\n\nThe most important classes are:\n\n- FrameButton\n- ToggleFrameButton\n- LabeledFrameButton\n- LabeledToggleFrameButton\n\n\n---   \n   \n   \n###Usage###\n\n\n####Graphical button representation####\nThe timeline based button graphics have to contain some required labels. A `FrameButton` representation has to contain \"default\" as a label on the timeline. And for a `ToggleFrameButton` it has to be \"default\" as well as \"selected_default\". \n   \nTypical timeline representation of a `FrameButton`:   \n![Typical timeline representation of a FrameButton](https://github.com/StephanPartzsch/as3-buttons/blob/master/example/asset_example/graphic/typical_frame_button.png?raw=true  \"Typical timeline representation of a FrameButton\")\n   \nSimple timeline representation of a `FrameButton`:  \n![Simple timeline representation of a FrameButton](https://github.com/StephanPartzsch/as3-buttons/blob/master/example/asset_example/graphic/simple_frame_button.png?raw=true  \"Simple timeline representation of a FrameButton\")\n   \nTypical timeline representation of a `ToggleFrameButton`:  \n![Typical timeline representation of a ToggleFrameButton](https://github.com/StephanPartzsch/as3-buttons/blob/master/example/asset_example/graphic/typical_toggle_frame_button.png?raw=true  \"Typical timeline representation of a ToggleFrameButton\")\n   \nSimple timeline representation of a `ToggleFrameButton`:  \n![Simple timeline representation of a ToggleFrameButton](https://github.com/StephanPartzsch/as3-buttons/blob/master/example/asset_example/graphic/simple_toggle_frame_button.png?raw=true  \"Simple timeline representation of a ToggleFrameButton\")\n   \n\n\n\n####Basic usage####\n\n*FrameButton*\n\n\tvar frameButton : FrameButton = FrameButton.createFromClass( ExampleButton );\n\taddChild( frameButton );\n   \n*ToggleFrameButton*\n\n\tvar toggleFrameButton : ToggleFrameButton = ToggleFrameButton.createFromClass( ExampleToggleButton );\n\taddChild( toggleFrameButton );\n\n*LabeledFrameButton*\n\n\tvar labeledFrameButton : LabeledFrameButton = LabeledFrameButton.createFromClass( ExampleLabelButton, \"Test\" );\n\taddChild( labeledFrameButton );\n   \n*LabeledToggleFrameButton*\n\n\tvar labeledToggleFrameButton : LabeledToggleFrameButton = LabeledToggleFrameButton.createFromClass( ExampleLabelButton, \"Test\" );\n\taddChild( labeledToggleFrameButton );\n\n   \nThe `FrameButton`, `ToggleFrameButton`, `LabeledFrameButton` as well as the `LabeledToggleFrameButton` can be used like normal MovieClips because nearly everything is delegated to the graphical button representation which is managed these button classes.\n\n\tframeButton.x = 100;\n\tframeButton.rotationX = 20;\n\tframeButton.addEventListener( MouseEvent.CLICK, handleFrameButtonClicked );\n\t\n\n- - -\n\t\n\t\n###Known issues###\n\n*Nested animations*\n\nIf the button MovieClip contains a nested animation (another MovieClip) you have to make sure that this animation ends two frames before the label is over. \nOne empty label is required to reset the nested animation. Otherwise the nested animation will play only once.\nA different solution is to leave empty the first frame of the label that contains the nested animation.\n\t","funding_links":[],"categories":["Unsorted"],"sub_categories":["Other API"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStephanPartzsch%2Fas3-buttons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FStephanPartzsch%2Fas3-buttons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FStephanPartzsch%2Fas3-buttons/lists"}