PrAnAv <[EMAIL PROTECTED]> wrote:
> The following is a behavior I made for use with the ActiveX Microsoft
> Forms Dropdown control. It uses the method AddItem of the control to
> add items to the dropdown menu. Now the problem is that the behavior
> works when I call it on prepareframe, but when I call it on
> beginSprite then even tho the code runs, it doesnt show the items in
> the list.
Hi Pranav,
I don't have the ActiveX Microsoft Forms Dropdown control on my system
(Windows 98 French), so I tested using Microsoft Forms 2.0 Listbox,
which uses the same AddItem command. I can see the items appearing
momentarily on beginSprite(), then the list seems to be reset to a blank
list. on prepareFrame() gives me the same (lack of) results. I had to
resort to the next event: on enterFrame(). I set a flag to ensure that
initialization only occurs once.
property pItemsList
property pSetFlag
on enterFrame(me)
if not pSetFlag then
mInit me
pSetFlag = TRUE
end if
end enterFrame
on mInit me
vCurrSprite = me.spriteNum
vItemsCount = the number of items in pItemsList
repeat with i = 1 to vItemsCount
vCurrItem = item(i) of pItemsList
AddItem (sprite vCurrSprite, vCurrItem)
end repeat
end mInit me
on getPropertyDescriptionList me
Desc = [:]
addProp Desc, #pItemsList, [#default: "", #format: #string, #comment:
"Values to display, separated by commas"]
return Desc
end getPropertyDescriptionList me
Two other issues (which I guess you've already taken care of):
1. Can you be sure that your end-users will have the required ActiveX
component installed?
2. Can you be sure that "the itemDelimiter" will be set to "," when the
mInit handler is run?
Cheers,
James
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]