纳金网

标题: Selection Group (Interactive Behavior) [打印本页]

作者: Asen    时间: 2011-10-15 10:35
标题: Selection Group (Interactive Behavior)






               Selection Group (Interactive Behavior)
              









           Summary
         

           Provides exlusive selection for sets of objects.
         





               Category
              


              Latest Behaviors
            




               Author
              


              Gavin Kistner
            




               Difficulty
              


              (Reference)
            




               Time to Complete
              


              5 Minutes
            








           Downloads
         


            Click Here
           
           to download the associated files.
         


            (This document covers version 1.5 of the 'Selection Group' behavior, current as of 2005-Aug-04)
           

            Description
           


             Attach this behavior to objects (or groups) where you want to be able to ‘select’ only one of the objects at a time. Every object with this behavior that has the same
            
              Group Name
            
             set will be selected in a mutually-exclusive fashion. An object is selected by clicking on it, invoking the
            
              Selected
            
             action on the behavior, or using script to call the
            
              select()
            
             method of the object, or the
            
              selectParent()
            
             method of the behavior.
            

             When an object is selected, the behavior will fire the
            
              Selected
            
             event. When an object is deselected, it fires the
            
              Deselected
            
             event. (Both events will bubble up to the parent object, its parent, and so on all the way up to the scene.)
            

             You may have multiple sets of objects involved in selection groups; each set must have a unique
            
              Group Name
            
             .
            

             By default, the behavior needs to be attached to each object you want in the group. For convenience, you may attach this behavior to a parent group, and check the
            
              Apply to Children?
            
             flag. This will copy the behavior to every child object and group (but not descendants) at runtime. The downside of this convenience is that you cannot setup Studio actions to listen for a the
            
              Selected
            
             and
            
              Deselected
            
             events on specific child objects.
            

             If neither
            
              Scene in Group?
            
             or
            
              Allow Deselect?
            
             is checked, at least one object in the group must be selected at all time. The first object added to the group will be automatically selected.
            

             If
            
              Scene in Group?
            
             is checked, clicking on the background (or any other object which bubbles the onMouseDown event up the tree without cancelling it) will deselect all objects in the selection group.
            

             If
            
              Allow Deselect?
            
             is checked, clicking on the currently-selected object will deselect it.
            


            Basic Properties
           



              Group Name
            

              The name of the group (must be the same for all objects in the group).
            

              Use Selected Color?
            

              Change the object to another color when selected?
            

              Selected Color
            

              Color to use for the object when selected.
            



            Advanced Properties
           



              Scene in Group?
            

              Should clicking on the scene deselect all objects?
            

              Allow Deselect?
            

              Should clicking on the selected object deselect it?
            

              Apply to Children?
            

              Apply this to all child models/groups, instead of the parent?
            



            Actions
           



              Select Parent
            

              Selects the parent element.
            

              Deselect Parent
            

              Deselects the parent element (if 'Allow Deselect?' is checked).
            



            Events
           



              Selected
            

              Fires when the parent element is selected.
            

              Deselected
            

              Fires when the parent element is deselected.
            



            Demonstration
           




              View Demonstration Project
            




              Download Project File
            




作者: 奇    时间: 2012-2-28 23:31
我无语!

作者: 奇    时间: 2012-4-3 23:33
此地無銀。。。

作者: 晃晃    时间: 2012-4-16 23:19
很有心,部分已收录自用,谢谢

作者: 菜刀吻电线    时间: 2012-4-30 23:19
既来之,则看之!

作者: 晃晃    时间: 2012-6-19 23:18
凡系斑竹滴话要听;凡系朋友滴帖要顶!

作者: tc    时间: 2012-7-3 23:26
加精、加亮滴铁子,尤其要多丁页丁页

作者: 晃晃    时间: 2012-8-24 23:24
无聊时可以刷屏幕 灌水 也可以试试 帖子的标题究竟可以写多长

作者: tc    时间: 2012-9-1 01:08
读铁系缘分,顶铁系友情

作者: tc    时间: 2013-1-5 20:59
读铁系缘分,顶铁系友情

作者: C.R.CAN    时间: 2013-1-27 23:29
谢谢楼主,真是太实用了

作者: C.R.CAN    时间: 2013-2-8 23:18
发了那么多,我都不知道该用哪个给你回帖了,呵呵





欢迎光临 纳金网 (http://go.narkii.com/club/) Powered by Discuz! X2.5