4 Replies Latest reply on Oct 20, 2009 6:10 AM by ImLearningW3D

    Flash Component Problem in D11

    ImLearningW3D

      I have a project where I am using flash component CheckBoxes.  I loaded them onto the screen and when I try to make the sprite width of each checkbox wider, the sprite seems to disappear on the stage. If I dont mess with the width, they display just fine and work correctly.

       

      Is this a common error for flash components in director 11?  Is it even possible to use lingo to adjust a flash component's sprite width?

       

      BTW - the setting of the Flash Component's sprite width occurs on an exitframe, not on a beginsprite

       

      Any help or info to point me in the right direction woiuld be appreciated.

       

      Thanks guys

        • 1. Re: Flash Component Problem in D11
          Sean_Wilson Adobe Community Professional

          Can you provide a file containing a single CheckBox component sprite, with code attached, that demonstrates what you're describing?

          • 2. Re: Flash Component Problem in D11
            ImLearningW3D Level 1

            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.

            • 3. Re: Flash Component Problem in D11
              Sean_Wilson Adobe Community Professional

              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)
              
              • 4. Re: Flash Component Problem in D11
                ImLearningW3D Level 1

                I apologize for sending the entire file.

                 

                Thank you for your help with this.