12 Replies Latest reply on Jul 9, 2007 12:12 AM by Newsgroup_User

    Sprite turns to white when re-init

    hwa-jun yu Level 1
      My sprite turns to white.

      That's not a new thing, isn't it?

      Please download a jpg from
      http://www.megaupload.com/?d=A6VK63AE

      It shows 5 fishes. Two of them are white, which are supposed to be blue in color.
      It makes me hard to track my code because sometimes they turn color like that, sometimes they don't.

      Please help.
      Thank you.
        • 1. Re: Sprite turns to white when re-init
          johnAq Level 1
          Are they bitpmaps with alpha or flash? Are you affecting the sprite's forecolor &/or backcolor in your code? What ink effect are you using?

          hth

          johnAq
          • 2. Re: Sprite turns to white when re-init
            hwa-jun yu Level 1
            They are bitmaps.
            I used Matte ink as I need to check intersections of the fishes with other sprites.
            I don't change forecolor or background color of the fish.

            • 3. Re: Sprite turns to white when re-init
              mwh71057
              I went to link, but see nothing......
              • 4. Re: Sprite turns to white when re-init
                johnAq Level 1
                Perhaps try a different ink to see if that is part of the problem. Also try images without alphas.

                hth

                john
                • 5. Re: Sprite turns to white when re-init
                  Level 7
                  fill in the code displayed somewhere in the mid-top area.

                  (It would not win the usability award)

                  mwh71057 wrote:
                  > I went to link, but see nothing......

                  --
                  ----------
                  Manno Bult
                  http://www.aloft.nl
                  • 6. Re: Sprite turns to white when re-init
                    Level 7
                    Is there anything else you do with the sprites codewise? I've seen some
                    wierd things with puppeting some time ago. (would have to dig to find it
                    again)

                    hwa-jun yu wrote:
                    --
                    ----------
                    Manno Bult
                    http://www.aloft.nl
                    > They are bitmaps.
                    > I used Matte ink as I need to check intersections of the fishes with other sprites.
                    > I don't change forecolor or background color of the fish.
                    >
                    >

                    --
                    ----------
                    Manno Bult
                    http://www.aloft.nl
                    • 7. Re: Sprite turns to white when re-init
                      hwa-jun yu Level 1
                      I made the fishes move (changes their locH and locV value) and swim (changes their cast member).
                      There has been a big question mark inside my head since I started playing with director.
                      I made sprites to animate by changing their picture (their cast member).
                      for example, I put fish2.png at cast member number 5, cast member number 6 is fish2, fish3 at cast member number 7 and so on.
                      I made a function to change the sprite's memberNum. That way, the image of the sprite will change and as the result, it's animating.

                      I have been wondering if this is the most proper way to animate sprite in director?
                      Could this be the problem that cause my fish to turn white?
                      • 8. Re: Sprite turns to white when re-init
                        hwa-jun yu Level 1
                        I made the fishes move (changes their locH and locV value) and swim (changes their cast member).
                        There has been a big question mark inside my head since I started playing with director.
                        I made sprites to animate by changing their picture (their cast member).
                        for example, I put fish2.png at cast member number 5, cast member number 6 is fish2, fish3 at cast member number 7 and so on.
                        I made a function to change the sprite's memberNum. That way, the image of the sprite will change and as the result, it's animating.

                        I have been wondering if this is the most proper way to animate sprite in director?
                        Could this be the problem that cause my fish to turn white?
                        • 9. Re: Sprite turns to white when re-init
                          Level 7

                          Having code to change castmembers every now and then is a pretty good
                          solution. Sometimes not the easiest, but most of the time the most
                          flexible one.

                          Can you isolate the fish-stuff in a new document and still see the same
                          (wrong) result?

                          Do the sprites display OK on stage without any code? Are they 32bit with
                          alpha? Do you use a certain ink?



                          hwa-jun yu wrote:
                          > I made the fishes move (changes their locH and locV value) and swim (changes
                          > their cast member).
                          > There has been a big question mark inside my head since I started playing with
                          > director.
                          > I made sprites to animate by changing their picture (their cast member).
                          > for example, I put fish2.png at cast member number 5, cast member number 6 is
                          > fish2, fish3 at cast member number 7 and so on.
                          > I made a function to change the sprite's memberNum. That way, the image of the
                          > sprite will change and as the result, it's animating.
                          >
                          > I have been wondering if this is the most proper way to animate sprite in
                          > director?
                          > Could this be the problem that cause my fish to turn white?
                          >

                          --
                          ----------
                          Manno Bult
                          http://www.aloft.nl
                          • 10. Re: Sprite turns to white when re-init
                            johnAq Level 1
                            You should look into 'film loops' in the help. They're the closest thing Director has to a Movie Clip in Flash. You can lay out your fish animation in the score and save that section of score as a castmember, which can then go on stage in it's own right, and be looped.

                            hth

                            johnAq
                            • 11. Re: Sprite turns to white when re-init
                              hwa-jun yu Level 1
                              >Having code to change castmembers every now and then is a pretty good
                              solution. Sometimes not the easiest, but most of the time the most
                              flexible one.

                              So, is there any other way to animate sprite than changing castmembers?


                              >Can you isolate the fish-stuff in a new document and still see the same
                              (wrong) result?

                              I haven't tried that one, but, just to let you guys know, this is not the first time some sprite in my project turns white.


                              >Do the sprites display OK on stage without any code? Are they 32bit with
                              alpha? Do you use a certain ink?

                              sure. they display ok. the fish is PNG file. I think, yes it is 32 bit with alpha.
                              I used matte ink, as I want to use "intersects" syntax to check hitTest with "bait" sprite.


                              >You should look into 'film loops' in the help. They're the closest thing Director has to a Movie Clip in Flash. You can lay out your fish animation in the score and save that section of score as a castmember, which can then go on stage in it's own right, and be looped.
                              Film loops? Do you have links to where I can get tutorial or sample?
                              I must put my fish in the score? but I never put anything in the score. I do all the sprite manipulating by scripting.


                              • 12. Re: Sprite turns to white when re-init
                                Level 7


                                hwa-jun yu wrote:

                                > So, is there any other way to animate sprite than changing castmembers?

                                Filmloops as John mentioned below.

                                > I haven't tried that one, but, just to let you guys know, this is not the
                                > first time some sprite in my project turns white.

                                But, are you puppeting sprites? I'll dig my example up if you try and
                                test in a barebones file :)

                                > Film loops? Do you have links to where I can get tutorial or sample?
                                > I must put my fish in the score? but I never put anything in the score. I do
                                > all the sprite manipulating by scripting.

                                You put sprites in the score just to create the filmloop, you can then
                                remove them again.
                                As John said: just animate in the score with alternating members in
                                sprites and frames to get the swim animation, select all sprites
                                involved and either select Insert -> Media Element -> Filmloop (not
                                behind director, may also be: Insert -> Filmloop) or just drag the
                                selected sprites to the cast. You will then get a new, animated,
                                castmember. The sprites used to build the animation can then be removed
                                from the score.
                                If you want to change the animation, just copy the filmloop castmember
                                and past it into the score by selecting 'paste sprites' with the score
                                window active.

                                HTH
                                Manno

                                --
                                ----------
                                Manno Bult
                                http://www.aloft.nl