Example: Resize Runtime

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Adam
    Indigo Rose Staff Member
    • May 2000
    • 2149

    Example: Resize Runtime

    Attached is a sample project that will allow your AutoPlay Media Studio 6.0 runtime to be resized dynamically at runtime. To apply this example to your project follow these steps:

    1) Copy the contents of the "Global Functions" section of the sample project to the same location in your project.
    2) On each page in your project you must add the following function calls to the appropriate events:

    On Preload:
    Resize_OnPreLoad();

    On Close:
    Resize_OnClose();

    On Size:
    Resize_OnSize(e_PageWidth,e_PageHeight);

    3) You must enable the "Resizable" option under Project -> Settings.

    Adam Kapilik
    Attached Files
  • rhosk
    Indigo Rose Customer
    • Aug 2003
    • 1698

    #2
    Adam, I'm surprised that you ddin't get any responses to this. It's a really sweet template, thanks!
    Regards,

    -Ron

    Music | Video | Pictures

    Comment

    • Adam
      Indigo Rose Staff Member
      • May 2000
      • 2149

      #3
      Thanks Ron. must appreciated

      Adam Kapilik

      Comment

      • pjborg
        Forum Member
        • Feb 2001
        • 120

        #4
        This is awesome! It works splendidly! Thank you!

        Comment

        • Byte
          Forum Member
          • Jun 2005
          • 74

          #5
          hi adam,
          i apply your example to my project, and get the following errors:

          on starting the application

          "On Preload, Line 134: Argument 1 must be of type table."
          which ist this line
          for i = 1, Table.Count(Objects) do

          if i klick ok, the application starts
          if i jump to the next page i get the error:

          "On Preload, Line 239: attempt to index global 'tblProps' (a nil value)"
          which is this line
          if tblProps.ObType == OBJECT_BUTTON then

          after klicking on ok it jumps to this page but is not displaying anything.

          by jumping to the next page i get the error:

          "On Close, Line 65: attempt to index global 'tblPos' (a nil value)"
          which is this line
          if tblPos.ObType == OBJECT_BUTTON then

          and again the error:
          "On Preload, Line 239: attempt to index global 'tblProps' (a nil value)"

          an so on

          any suggestions on that problem?

          byte

          Comment

          • rhosk
            Indigo Rose Customer
            • Aug 2003
            • 1698

            #6
            Check your "Page Actions" for exact spelling/case
            Regards,

            -Ron

            Music | Video | Pictures

            Comment

            • Byte
              Forum Member
              • Jun 2005
              • 74

              #7
              i copyed everything out of adam's example. add the functions on each page and checked it again. it's all there, but i still get these errors

              byte

              Comment

              • rhosk
                Indigo Rose Customer
                • Aug 2003
                • 1698

                #8
                Can you post the project?
                Regards,

                -Ron

                Music | Video | Pictures

                Comment

                • Byte
                  Forum Member
                  • Jun 2005
                  • 74

                  #9
                  i don't think so, the project is over 5 mb big.

                  but never mind, i just don't use the resize in my project.

                  thanks alot anyway for help

                  byte

                  Comment

                  • Corey
                    Indigo Rose Staff Alumni
                    • Aug 2002
                    • 9745

                    #10
                    FWIW the project works perfectly on my end too. :yes

                    Comment

                    • rhosk
                      Indigo Rose Customer
                      • Aug 2003
                      • 1698

                      #11
                      Yeah, it works flawlessly for me too and I have many objects on the page(s). byte, I had your symptoms by simply misspelling a function call. Never give up the ship!
                      Regards,

                      -Ron

                      Music | Video | Pictures

                      Comment

                      • pjborg
                        Forum Member
                        • Feb 2001
                        • 120

                        #12
                        Hey, Byte,
                        There is some script in "Project > Global Functions..." that makes the whole thing work. Did you copy that part to your project?

                        Comment

                        • pjborg
                          Forum Member
                          • Feb 2001
                          • 120

                          #13
                          By the way, just want to say thanks again for this example: it really opened my eyes to the possibilities of global functions. I'm still learning all this scripting, and I was thinking I'd have to go to each object and put this resize stuff on each one individually. From now on I'm going to always ask: How can I do this globally (read: quickly and easily)? Thanks, Adam, for the big bump on the head!

                          Comment

                          • Corey
                            Indigo Rose Staff Alumni
                            • Aug 2002
                            • 9745

                            #14
                            Yes, Global Functions are definitely the way to go. Modular code rules. It's the key to designing projects which can be easily modified/upgraded. I put almost all of my code in the Global Functions area these days... Very easy to work with too, custom functions are incredibly simple to work with yet super powerful. :yes

                            Comment

                            • Byte
                              Forum Member
                              • Jun 2005
                              • 74

                              #15
                              hi pjborg,

                              yes i did copy the whole part to my Project > Global Functions. that's exactly where i am getting my errors from. when it calls the

                              On Preload:
                              Resize_OnPreLoad();

                              the error "On Preload, Line 134: Argument 1 must be of type table." is line 134 in Global Functions.

                              after i finish some other stuff in my project, i will go through these global functions again.

                              byte

                              Comment

                              Working...
                              X