Dynamically Size the Canvas

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jonahcat
    New Member
    • Oct 2007
    • 4

    Dynamically Size the Canvas

    Hi,
    I have a flash movie (a ruler) that needs to float over an html page. The ruler size needs to stay fixed since it is measuring art pieces underneath. I can size the canvas to a fixed width say 1024x768 which allows the ruler to move all over the page. The problem is that if I have a larger screen rez say 1200 X 800 I have create a new movie with a larger canvas to support the ability to move the ruler all over the page.
    The issue with this is if I have one user on 1024 and one with a higher rez, I either have a ruler that cant move all over the page, or I have scroll bars on the lower rez monitors.

    Is there a way to dynamically size the canvas?
    Any help would be appreciated - this is quite urgent.
    Thanks!

    Peter
  • rsdev
    New Member
    • Jul 2007
    • 149

    #2
    Hi,

    You should be able to use javascript to dynamically size the flash movie according to the clients screen resolution.

    Check out SWFobject.js on google for examples.

    Comment

    • jonahcat
      New Member
      • Oct 2007
      • 4

      #3
      Thanks but what I am after is the resizing of the canvas, not the movie. Make sense?

      Comment

      • xNephilimx
        Recognized Expert New Member
        • Jun 2007
        • 213

        #4
        Hi jonahcat!
        Try this:
        make your ruler as long as you think it's conveinent, then put this in the frame:
        Stage.scaleMode = "noScale";

        That will prevent the content of your movie to scale when changing the size of the movie. Then you can use JavaScript and SWFObject as rsdev said, to dynamicaly resize the movie and automatically fit it to the user's screen resolution.

        Best regards,
        The_Nephilim

        Originally posted by jonahcat
        Hi,
        I have a flash movie (a ruler) that needs to float over an html page. The ruler size needs to stay fixed since it is measuring art pieces underneath. I can size the canvas to a fixed width say 1024x768 which allows the ruler to move all over the page. The problem is that if I have a larger screen rez say 1200 X 800 I have create a new movie with a larger canvas to support the ability to move the ruler all over the page.
        The issue with this is if I have one user on 1024 and one with a higher rez, I either have a ruler that cant move all over the page, or I have scroll bars on the lower rez monitors.

        Is there a way to dynamically size the canvas?
        Any help would be appreciated - this is quite urgent.
        Thanks!

        Peter

        Comment

        • jonahcat
          New Member
          • Oct 2007
          • 4

          #5
          Thanks so much! Ill give it a try!

          Comment

          • xNephilimx
            Recognized Expert New Member
            • Jun 2007
            • 213

            #6
            You're welcome!
            Let me know how it worked.

            Best regards
            The_Nephilim

            Originally posted by jonahcat
            Thanks so much! Ill give it a try!

            Comment

            • jonahcat
              New Member
              • Oct 2007
              • 4

              #7
              It seems to be working!!!
              Thank-you so very much!

              Comment

              • xNephilimx
                Recognized Expert New Member
                • Jun 2007
                • 213

                #8
                Awesome!!
                Glad it worked!

                Best regards!
                The_Nephilim

                Originally posted by jonahcat
                It seems to be working!!!
                Thank-you so very much!

                Comment

                Working...