Adobe Dreamweaver Forums



Last 10 THreads :         Recommend Reading? (Last Post : anpuofeck - Replies : 5 - Views : 7 )           »          static sound (Last Post : kglad - Replies : 15 - Views : 16 )           »          Detect multiple areas of transparency in an image? (Last Post : Rothrock - Replies : 8 - Views : 9 )           »          Add a full screen button to a video. (Last Post : kglad - Replies : 5 - Views : 9 )           »          Problems when uploading my website (Last Post : speculumcm - Replies : 4 - Views : 5 )           »          Dreamweaver CS3 Download (Last Post : DWFAQ.info - Replies : 5 - Views : 6 )           »          Pop up window using AS3 (Last Post : azilen - Replies : 0 - Views : 1 )           »          flash movie plays prematurely (Last Post : lyshamo - Replies : 5 - Views : 6 )           »          Variable for Loader Content (Last Post : kglad - Replies : 5 - Views : 6 )           »          Sick flash (Last Post : edmond_dantes - Replies : 0 - Views : 1 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Macromedia Software > Director > Lingo
 
Tags:



Reply
  #1 (permalink)  
Old 11-18-2008, 01:54 PM
forums.adobe.com
 
Posts: n/a
Diggs:
Default List flash component In Director

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





Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-18-2008, 02:05 PM
forums.adobe.com
 
Posts: n/a
Diggs:
Default Re: List flash component In Director

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
>
>
>



Reply With Quote
  #3 (permalink)  
Old 11-21-2008, 12:25 PM
DAVID NAJAR
 
Posts: n/a
Diggs:
Default Re: List flash component In Director

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

Reply With Quote


Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 06:41 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk