11 Replies Latest reply on Sep 22, 2006 12:59 PM by julialaborde

    Changing Stage size at runtime

    Level 7
      I have been poking around and not finding any info on this.

      What I want to do is change the height of the STAGE (not a MovieClip) based
      on which view I'm showing the customer at a particular time.

      For instance...

      I may have a thumbnail and a detail view for a product. I don't need a lot
      of screen real estate to show the thumbnail view, but I'd like to make the
      swf taller if the user switches to the detail view.

      I don't simply want to make the swf taller by default because I'll have a
      ton of unused whitespace in thumbnail view, which will look stupid.

      I shouldn't have a problem with the JavaScript to change the height
      properties in the HTML tags for the Flash object, but not really sure if/how
      to do the other part in Flash. Everything I've seen so far has been
      read-only properties.

      Thanks,

      Chris.



        • 1. Re: Changing Stage size at runtime
          Level 7
          did you change stage size?

          how can you do this without javascript?

          "Christopher Hayes" <chris.hayes@maritz.com> escreveu na mensagem
          news:ee4csi$ent$1@forums.macromedia.com...
          >I have been poking around and not finding any info on this.
          >
          > What I want to do is change the height of the STAGE (not a MovieClip)
          > based on which view I'm showing the customer at a particular time.
          >
          > For instance...
          >
          > I may have a thumbnail and a detail view for a product. I don't need a lot
          > of screen real estate to show the thumbnail view, but I'd like to make the
          > swf taller if the user switches to the detail view.
          >
          > I don't simply want to make the swf taller by default because I'll have a
          > ton of unused whitespace in thumbnail view, which will look stupid.
          >
          > I shouldn't have a problem with the JavaScript to change the height
          > properties in the HTML tags for the Flash object, but not really sure
          > if/how to do the other part in Flash. Everything I've seen so far has
          > been read-only properties.
          >
          > Thanks,
          >
          > Chris.
          >
          >
          >


          • 2. Re: Changing Stage size at runtime
            Level 7
            Nope - no one has replied yet and I haven't found any info suggesting that
            you can change the stage size.

            You can definitely change the parameters in the object tag that tells the
            browser how big the stage it, but that won't actually change the stage size,
            it'll just stretch it out or shrink it appropriately, but the only way I
            know of doing this at runtime is with JavaScript.


            • 3. Re: Changing Stage size at runtime
              ewon15 Level 1
              okay, you might be able to do something with onResize = function() {} ...i was just looking it up on the live docs...try going to the Flash 8 documentation > ActionScript 2.0 Language Reference > ActionScript classes > Stage

              good luck :-)
              • 4. Re: Changing Stage size at runtime
                Level 7
                When I first saw that I though it might help too, but unfortunately you can
                only change how the browser "stretches" your application.

                I can't find any documentation that says you can actually change the stage
                size at runtime :(

                You know - just like a longer Web page. It's got more content, so it grows
                in height (or width) to display all of it.


                • 5. Changing Stage size at runtime
                  Angyl Level 1
                  Sorry, I have no real help, but I just wanted to point out that I THINK I've seen that done so I believe it is possible. It was an ad on a page that was small and in the corner--most of the page was NOT flash but rather HTML text and pictures, but when you moused over the small ad it expanded to fill most of the page with the Flash ad, covering the ordinary html text and images underneath it.

                  I was most impressed, but sadly, have no clue as to how it was done.

                  After having pondered it for the last severl months, I'm guessing it might have been an illusion, perhaps encapsulating the full-sized flash movie in an expanding layer or something using js. Who knows?
                  • 6. Re: Changing Stage size at runtime
                    julialaborde
                    Most of this tricks are illusion, the eye is slow and you can create and see things that are just tricks. I never heard about of doing this at runtime in flash.
                    If is not java script then a plugin that can create the trick?Another softweare that integrate with flash?
                    Can you send me the link in wich you see it? Any way I will search because I'm also interest in doing this too. If you know something else let me know.
                    • 7. Re: Changing Stage size at runtime
                      inactiveforumnotifier Level 1
                      Most of this tricks are illusion, the eye is slow and you can create and see things that are just tricks. I never heard about of doing this at runtime in flash.
                      If is not java script then a plugin that can create the trick?Another softweare that integrate with flash?
                      Can you send me the link in wich you see it? Any way I will search because I'm also interest in doing this too. If you know something else let me know.
                      • 8. Re: Changing Stage size at runtime
                        inactiveforumnotifier Level 1
                        Most of this tricks are illusion, the eye is slow and you can create and see things that are just tricks. I never heard about of doing this at runtime in flash.
                        If is not java script then a plugin that can create the trick?Another softweare that integrate with flash?
                        Can you send me the link in wich you see it? Any way I will search because I'm also interest in doing this too. If you know something else let me know.
                        • 9. Re: Changing Stage size at runtime
                          Angyl Level 1
                          I wish I could send you the link, but like I said, it was an advertisement and it was over a news page. This was months ago so it's long gone and there's no telling where it (or something like it) will spring up again.
                          • 10. Re: Changing Stage size at runtime
                            Peter Lorent Level 2
                            >>change the height of the STAGE
                            No can do. As you say, read-only props.
                            The only way is to set the height and width in the object/embed tags and pass in the values to the swf as flashvars. Then in the swf, based on the passed in width and height, you can set dimensions for every element in the swf -> like setting a grid for the lay-out and change dimensions of movieclips dynamically.
                            • 11. Changing Stage size at runtime
                              julialaborde Level 1
                              Join The NY Flash developers Meetup Group @ http://comptutor.meetup.com/4/

                              Just click and see what the group is about........