23 Replies Latest reply on Apr 28, 2008 2:07 PM by kindaian

    Publishing

    WarDemonZ Level 1
      Hey everyone, i think this may be my last need for help as iv only got 1 bug left woooohoooo, so i just wanna say in advance thank you to everyone whos helped me over the last few weeks, its really been appreicated.

      ok so on with the problem, basically my program works fine, does everything it should even write to text files like i was worried about how to do, the problem is when i publish it, i dont think it runs the 'on moviestart' command, basically like i say when i run it in director its fine, but when i publish it, crashes galore. iv put the more detailed error display on when it publishes and one of the main problems it has is it tries to do the count function on a list when a button is pressed, but it returns the error, list expected, or something (it is that it wants a list i just cant remember word for word wot it says) but this variable gets told its a list in the on startmovie script.

      does anyone have any clues??

      thanks guys

      Moza
        • 1. Re: Publishing
          Level 7
          Errors that do not occur when you are running the program in Director
          but do occur in published movies are almost always due to missing Xtras.

          How are you publising your movie, as a projector or shockwave? I know
          you are using fileIO, did you include the Xtra in the projector or in an
          Xtras folder along with the projector?

          WarDemonZ wrote:
          > Hey everyone, i think this may be my last need for help as iv only got 1 bug
          > left woooohoooo, so i just wanna say in advance thank you to everyone whos
          > helped me over the last few weeks, its really been appreicated.
          >
          > ok so on with the problem, basically my program works fine, does everything it
          > should even write to text files like i was worried about how to do, the problem
          > is when i publish it, i dont think it runs the 'on moviestart' command,
          > basically like i say when i run it in director its fine, but when i publish it,
          > crashes galore. iv put the more detailed error display on when it publishes and
          > one of the main problems it has is it tries to do the count function on a list
          > when a button is pressed, but it returns the error, list expected, or something
          > (it is that it wants a list i just cant remember word for word wot it says) but
          > this variable gets told its a list in the on startmovie script.
          >
          > does anyone have any clues??
          >
          > thanks guys
          >
          > Moza
          >
          • 2. Re: Publishing
            Level 7
            It could be that there is no 'on movieStart' handler....

            Try 'on startMovie' instead.
            • 3. Re: Publishing
              WarDemonZ Level 1
              sorry, that was me just being an idiot writing it now, i have put on startmovie
              • 4. Re: Publishing
                WarDemonZ Level 1
                iv published it as a projector, iv gone back and forth throughout the publishing menu and iv checked the box that tells it to include the xtras (well, theres a tick box to exclude the xtras which iv left blank)
                • 5. Re: Publishing
                  Level 7
                  Do you have sprites with scripts on Frame 1?

                  Because you shouldn't. Ever. There is a long standing bug (feature??)
                  that makes things run out of order sometimes. Scripts on frame 1 will
                  sometimes run their beginSprite handler before startMovie runs. This
                  can cause all sorts of mayhem.
                  • 6. Re: Publishing
                    WarDemonZ Level 1
                    oh really? bummer, errrm i think theres a beginsprite on a few objects on frame 1, and a go to the frame holder on it, should i just move everything back 1 frame (everything with a script on) so they dont run on frame 1?
                    • 7. Re: Publishing
                      Level 7
                      I typically use the 'on prepareMovie' handler instead of 'on startMovie'
                      to compensate for this quirk.

                      WarDemonZ wrote:
                      > oh really? bummer, errrm i think theres a beginsprite on a few objects on frame
                      > 1, and a go to the frame holder on it, should i just move everything back 1
                      > frame (everything with a script on) so they dont run on frame 1?
                      >
                      • 8. Re: Publishing
                        Level 7
                        I typically have NOTHING on frame 1 at all apart from a non-scripted
                        background graphic.

                        So, yes. Move as much as you can off of frame 1 and see if the problem
                        is mysteriously fixed.
                        • 9. Re: Publishing
                          Production Monkey Level 3
                          Mike, Dave,

                          What bug?

                          I have been developing with Director for over 10 years with sprites and behaviors on frame one with never a problem.
                          • 10. Re: Publishing
                            Level 7
                            It depends on how you set up your scripts and how much error checking
                            you do. If you have a script like this:


                            global gList
                            on startMovie me
                            gList=[1,2,3,4]
                            end


                            Then, on frame 1, you have a text sprite that shows the 1st value in
                            that list:

                            global gList
                            on beginSprite me
                            sprite(me.spriteNum).member.text=string(gList[1])
                            end

                            Then, in some cases, beginsprite will fire before startMovie, and you
                            will get an error since gList is void.

                            If you are smarter about your coding, you would check that gList exists
                            before setting the text... that would avoid the error
                            • 11. Re: Publishing
                              Level 7
                              According to the documentation, it looks like this is how it was
                              designed to work. I guess it can't be considered a bug then.

                              ------------------------------------------

                              When the movie first starts, events occur in the following order:

                              1 prepareMovie

                              2 beginSprite

                              This event occurs when the playback head enters a sprite span.

                              3 prepareFrame

                              Immediately after the prepareFrame event, Director plays sounds, draws
                              sprites, and performs any transitions or palette effects. This event
                              occurs before the enterFrame event. An on prepareFrame handler is a good
                              location for Lingo that you want to run before the frame draws.

                              4 startMovie

                              This event occurs in the first frame that plays.
                              • 12. Re: Publishing
                                Production Monkey Level 3
                                BeginSprite() always happens before StartMovie for sprites on frame 1. That is not a bug. It is the way it works.

                                PrepareMovie -> All BeginSprites on frame 1 -> StartMovie.
                                • 13. Re: Publishing
                                  Level 7
                                  OK. It's not a bug. It is a terribly-thought-through feature - which
                                  is why when I called it a bug I said it is a bug (feature).

                                  I think it was originally considered a bug way back when and they
                                  "fixed" it by adding prepareMovie which works the way you would expect it.

                                  Semantically, one would expect that startMovie is something that
                                  happens... um.. right when the movie starts... before the score ever
                                  starts to load. But it isn't. That's my point.
                                  • 14. Re: Publishing
                                    Level 7
                                    You are right. Seems counter-intuitive but it is documented that way.
                                    • 15. Re: Publishing
                                      WarDemonZ Level 1
                                      thanks guys, but still no joy, iv tried moving everything off frame 1 bar static pictures, change the code to say preparemovie instead instead of start movie, but i just dont think its even executing that code at all, i tried making it does something obvious like making an object invisible on the centre of ths screen, but it doesnt do it.

                                      just to make sure iv not made a really amateur mistake, u set it up 'Movie' in type instead of behaviour, and its on Preload : When needed, i tried making it 'before frame one' but not since iv moved the stuff of frame one etc, ill try that now.

                                      thats how i was taught to do the startmovie stuff
                                      • 16. Re: Publishing
                                        Level 7
                                        can you post the code in your on prepareMovie hander?
                                        • 17. Re: Publishing
                                          WarDemonZ Level 1
                                          its big, very very big, mainly cos on start it loads in the values of text files that have been previously written into lists, like about 400 lines. just now iv taken out a huge chunk of it and just put sprite(x).visible = 0 for about 10 objects, and they dont disappear, so it clearly just isnt running it
                                          • 18. Re: Publishing
                                            WarDemonZ Level 1
                                            rite iv narrowed it down a little further, i think the problem is with the xtras, the reason what i just tried didnt work was cos id changed it to a behaviour and not back to a movie script so it wasnt running on start time, iv isolated that what it doesnt like is the FileIO stuff, meaning that surely its just a case of xtras. im gonna check im including the xtras properly and ill post back what happens
                                            • 19. Re: Publishing
                                              Production Monkey Level 3
                                              I jumped in because I didn't want a newbie to be mis-informed.

                                              WarDemonZ,

                                              Basic Debugging: Add a break point to the beginning of your preparemovie and/or startmovie handlers and step through the program.

                                              If the break point is not hit, then the handler is not being run. If it is hit, then step through each line until you hit the line with the error.
                                              • 20. Re: Publishing
                                                Level 7
                                                > Basic Debugging: Add a break point to the beginning of your preparemovie
                                                > and/or startmovie handlers and step through the program.
                                                >
                                                > If the break point is not hit, then the handler is not being run. If it is
                                                > hit, then step through each line until you hit the line with the error.

                                                Unfortunately, like the OP said, the error only occurs when the movie is
                                                published, and one doesn't have access to the debugger at run-time. A
                                                useful alternative is to pepper handlers with 'put' commands (and enable
                                                a run-time message window) or 'alert's to narrow down where errors are
                                                being thrown
                                                • 21. Re: Publishing
                                                  kindaian
                                                  If you use "script" only xtras, they aren't added to the movie when it runs (no warning no nothing).

                                                  If you use "media" xtras (using the menus to add the xtra), you get it added automaticly to the movie. BUT, it may or may not get the flag "add to projector" seted.

                                                  Quick test?

                                                  Copy all the xtras from the director folders to the project folder (under the xtras folder). And run the projector again.

                                                  If it sorts it out, it's a xtra problem. If the problem still exists, then it's something into the lingo land.

                                                  (if that is the case, check if there is not a directory problem, like the reference of the current directory - i had that once and took me tons of time to figure it out!).

                                                  Cheers,
                                                  Kindaian
                                                  • 22. Re: Publishing
                                                    WarDemonZ Level 1
                                                    no it was fine, i got it working in the end, the problem was it wasnt including all the Xtras, i thought it was but it just wasnt running the first script, cos everything worked fine but stuff that appeared to be happening on the startmovie script, wot it was actually doing was getting to the part about FileIO Xtra, then falling over, which is wot caused it to look like it did nothing on that script, to fix it i just made it exclude all the Xtras then put a folder in the directory the .exe was in called applicationsetup or something, and copied the folder full of Xtras into that. and it worked fine

                                                    cheers everyone for all the help
                                                    • 23. Re: Publishing
                                                      kindaian Level 1
                                                      quote:

                                                      Originally posted by: Production Monkey
                                                      If the break point is not hit, then the handler is not being run. If it is hit, then step through each line until you hit the line with the error.


                                                      Just remember that sometimes, the execution just breaks without an error. When that happened to me, it was just because i was calling invalid object methods (and yes the nasty little flash components).

                                                      ;)