4 Replies Latest reply on Feb 21, 2007 10:37 PM by hwa-jun yu

    problem when switching display mode, preloader, png alpha problem

    hwa-jun yu
      Hi
      it's the passionate director learner, hwajun, again.
      While attempting to make my first simple game project, I met the following problems.. guys, please help!!
      1. When I switch system's display mode (from 1024x768 to 800x600), the projector wasn't located at 0,0 point. It's located at approx. 200,150 point. I tried to use adisplayxtra from http://freextras.freeweb.hu and buddy API, but both of them give the same result. How do I fix this?
      2. How do I make a preloader for my game?
      3. I exported a series of png from a movie clip from flash to director. The result is good. But I met a problem when I export another movie clip. This movie clip is somehow supposed to be a special FX. So the movie clip contains an alpha motion tween. the first and the last frame looks empty (alpha = 0).
      The files look okay when I preview them in windows Viewer. But the empty bitmap (the ones that alpha = 0, which are the first and the last frame) turns into black in director cast!
      Confusing..

      Sorry for the bad english.
      A complete reply to my problems will absolutely be a great news. Thank you.
        • 1. Re: problem when switching display mode, preloader, png alpha problem
          thismonkey
          Hi, not a complete solution but a start...

          1. Best way to solve this is to create 2 .exe files the first loads up and resizes the display then closes and kicks off the 2nd exe file which contains your main movie. As long as you check the centre movie option for the 2nd movie, it will be correctly located once it runs.

          2. depends on type of preloader you require... sorry, cant be much help with this one.

          3. ignore the black frame, its just to show you the dimensions of the flash. When you place it on the stage select it and in the sprite properties menu select background transparent from the ink drop down menu.

          Hope these help...
          • 2. Re: problem when switching display mode, preloader, png alpha problem
            Level 7
            > 1. When I switch system's display mode (from 1024x768 to 800x600), the
            > projector wasn't located at 0,0 point. It's located at approx. 200,150 point.

            Were you switching the resolution while the projector was running? This
            is probably a hardware issue.

            > 2. How do I make a preloader for my game?

            If you are running a projector then you shouldn't need a preloader. Is
            the game in Flash or Director? In either case, your content is local, so
            you don't need to create anything that will help with the download of
            the media, it's already there.

            You should be able to just play your file, and it should run directly
            from the source. If you are running from a CD, you may see some delay
            because there is only one read head on a CD drive and the data transfer
            rate is much slower than a hard drive.

            I have never, ever, found a reason to run one Director .exe file from
            another. Please don't do that.

            > 3. I exported a series of png from a movie clip from flash to director. The
            > result is good. But I met a problem when I export another movie clip. This
            > movie clip is somehow supposed to be a special FX. So the movie clip contains
            > an alpha motion tween. the first and the last frame looks empty (alpha = 0).
            > The files look okay when I preview them in windows Viewer. But the empty
            > bitmap (the ones that alpha = 0, which are the first and the last frame)
            > turns into black in director cast!

            Black is usually the color that Director shows for the content of the
            alpha channel when the "User alpha channel" is turned off for that cast
            member. This colorizing of the alpha also shows when the file is
            malformed.

            --
            Rob
            _______
            Rob Dillon
            Adobe Community Expert
            http://www.ddg-designs.com
            412-243-9119

            http://www.macromedia.com/software/trial/
            • 3. problem when switching display mode, preloader, png alpha problem
              raschko
              To set the projector another position on the screen I believe you can fiddle around with its drawrect property.

              !!!!Try this out!!!

              -- make a rect of the stage dimensions
              myprogram = rect(0,0,the windows width,the windows height)

              -- store both the rects for our screen and the stage
              -- the stage rect is divided in two for centering purposes.
              -- in 2 because this helps in finding the center of the stage.
              myRects = [_system.deskTopRectList[1],point(myprogram[3]/2,myprogram[4]/2)]

              -- offset the screen rect so that we make a new rect for the stage.
              -- this new rect has the coordinates for being in the center
              myprogram = myprogram.offset((myRects[1][3]/2)-myRects[2][1],(myRects[1][4]/2)-myRects[2][2])

              -- now redraw the stage at the center
              window("stage").Rect = myprogram

              Happy coding!!!!
              • 4. Re: problem when switching display mode, preloader, png alpha problem
                hwa-jun yu Level 1
                > 1. When I switch system's display mode (from 1024x768 to 800x600), the
                > projector wasn't located at 0,0 point. It's located at approx. 200,150 point.


                Thanks for the drawrect tip.
                In addition, we can also use the following code to set the movie's rect (after I use adisplayxtra to change display mode, movie's rect is screwed up)

                _movie.stage.drawRect = _system.deskTopRectList[1];
                _movie.stage.rect = _system.deskTopRectList[1];


                > 2. How do I make a preloader for my game?
                For the preloader part, Rob, I'm just trying to avoid white screen being displayed when my projector is loading its assets.
                I have pretty large cast members linked to my projector, when it changes screen (when loading mpg or swf or change background), it freezes a moment. Is there anyway to make projector preloads the cast members to memory (then I can put a loading screen when it's loading casts) and returns a boolean telling me if the cast members are completely loaded?


                > 3. I exported a series of png from a movie clip from flash to director. The
                > result is good. But I met a problem when I export another movie clip. This
                > movie clip is somehow supposed to be a special FX. So the movie clip contains
                > an alpha motion tween. the first and the last frame looks empty (alpha = 0).
                > The files look okay when I preview them in windows Viewer. But the empty
                > bitmap (the ones that alpha = 0, which are the first and the last frame)
                > turns into black in director cast!

                Seems like there is a little confuse with my last question... Sorry, I didn't know how to precisely describe my problem.
                I'll try to make it clearer now.
                I exported a series of PNG from a flash movie clip. It is a special effect.
                these values illustrate the alpha value for each PNG.
                0 10 20 30 50 70 90 100 90 70 50 30 20 10 0
                You see, the series of image display the so-called alpha tween in flash term (nevermind the term, I'm working in director now). the first PNG displays image with alpha 0 (display nothing), the second PNG displays image with alpha 10 (display image with little transparency), and so on...
                They all look nice, the first and the last PNG displays no pixel in Adobe Photoshop.
                But, the problem comes when I import the files in director. The first and last PNG that are supposed to be no pixel become black! How is this happened?

                Sorry for sounding like a gibbering idiot with all the long question.
                Thanks to everyone for the replies.