Announcement

Collapse
No announcement yet.

Example: Resize Runtime

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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


    • #3
      Thanks Ron. must appreciated

      Adam Kapilik

      Comment


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

        Comment


        • #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


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

            -Ron

            Music | Video | Pictures

            Comment


            • #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


              • #8
                Can you post the project?
                Regards,

                -Ron

                Music | Video | Pictures

                Comment


                • #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


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

                    Comment


                    • #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


                      • #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


                        • #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


                          • #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


                            • #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