Can you provide a file containing a single CheckBox component sprite, with code attached, that demonstrates what you're describing?
Certainly. Here is a preliminary DIR file. Any comments would be helpful.
This file is setup because when I come into work in the morning, I open lots of windows and programs; each day could be different depending on my workload. It is designed to create a checkbox for each item I would like to open. Check it, along with others, to open them. Uncheck it to not open it with the others. Fairly straight forward. But when I try to adjust the width in lingo, they disappear.
See Movie Script "Load Known ITRS's", member 10 of castlib 1, handler "GenerateScreenIcons" as well as Parent script "Generate Link Instance", member 16 of castlib 1, line 22.
MyCustomStartup.zip 779.8 K
I specifically asked you for a file with a single component and a script attached that demonstrated what you were reporting. I asked for this so that I didn't have to waste time wading through extraneous code trying to figure out what was at issue.
Your problem is that when you set the width, the height drops to zero. I don't know why. In a simple test case with a single component and a behavior attached that sets the sprite.width in the #beginSprite handler this doesn't happen - the width changes and the (original) height is maintained. Perhaps it's a consequence of makeScriptedSprite() - possibly because there is no sprite in place to start with, and therefore no original height to maintain.
Here is your script "SetStaticProp" with my amendments:
property pMyLinkInfo property pSetMyFlashProps property mySprite on new me, iNum, bSetProps, lInfo mySprite = sprite(iNum) pSetMyFlashProps = bSetProps pMyLinkInfo = lInfo return me end on endSprite me mySprite = VOID end on exitFrame me if pSetMyFlashProps = 1 then mySprite.static = not (pMyLinkInfo.enabled) mySprite.label = pMyLinkInfo.name tHeight = mySprite.height mySprite.width = 160 mySprite.height = tHeight pSetMyFlashProps = 0 end if end
and here is the amended fragment from your "Generate Link Instance" parent script:
--****Next Line causes CheckBox to go missing******** -- sprite(CheckBoxSnum).width = 160 myScript = script("SetStaticProp").new( CheckBoxSnum, 1, duplicate(myInfo) ) sprite(CheckBoxSnum).scriptInstanceList.add(myScript) gItemSelectionList.add(myInfo)
I apologize for sending the entire file.
Thank you for your help with this.