![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
Hi
I want to use a list flash component in Director I can set the content of listitems with following command sprite("listspr").member.labels = ["item 1", "item 2", "item3"] I've set multyselection property of the list to true, using Property inspector Now the question - how can I define, what is the current selection in this list Commands like sprite("listspr").member.selectedItems or sprite("listspr").member.selectedIndeces ends with an error. What is the correct code to define current selection in the list Any help will be appreciated game_dev |
| Sponsored Links |
|
|||
|
I've discovered, that I can acess the list of selections through
sprite("listspr").selectedItems But when no one element in list is selected, this lines gives an error - property not found How can I check if some elements is selected in list, so that id soes not cause en error in script? "forums.adobe.com" <jorg.mann@gmx.de> wrote in message news:gfuh50$533$1@forums.macromedia.com... > Hi > > I want to use a list flash component in Director > > I can set the content of listitems with following command > > sprite("listspr").member.labels = ["item 1", "item 2", "item3"] > > I've set multyselection property of the list to true, using Property > inspector > > Now the question - how can I define, what is the current selection in this > list > > Commands like sprite("listspr").member.selectedItems or > sprite("listspr").member.selectedIndeces ends with an error. > > What is the correct code to define current selection in the list > > Any help will be appreciated > > game_dev > > > |
|
|||
|
Hi,
I hope this can help you. -- Behavior script attached to a list instance on the stage property pSprite on beginSprite(me) pSprite = sprite(me.spriteNum) -- Set the list component event "change" for Director response pSpriteEvent = pSprite.newObject("Object") pSprite.setCallback(pSpriteEvent, "change", 0, 0) end on change(me) put pSprite.selectedItems -- put the item selected with the mouse on the message window end on getSelectedItemsList(me) if pSprite["selectedItems"] = VOID then -- this line of code returns VOID if no items selected return [] -- if no items selected returns an empty lingo list else return pSprite.selectedItems -- or return a lingo linear list of strings end if end -- End behavior script |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise