A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Image as background - resizing/scalable background.....

  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    20

    Image as background - resizing/scalable background.....

    Hello,

    I am relatively new to Flash CS3 and i have been learning Action-script 3 over the past week. I have come quite a long way and i have made a site in flash but i just have a question.

    I have been using an image as my background and i am happy with the way flash automatically scales all the objects in my file but the background image does not scale. Is there a way to do this? I have found out things online which show me how to add auto-resizing to the background but this knocks off the flash auto scaling/resizing for everything else.

    Is there a way to sort this out?

    Thanks in advance for any help :-)

  2. #2
    WohOoooooo zompo's Avatar
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    138
    Are you using the image as a background in the flash file or is it a background in your html page?

    You can add a eventlistener to the stage that will fire every time you resize the window

    something like

    Code:
    stage.addEventListener(Event.RESIZE, stageResize);
    
    function stageResize( $e:Event ):void
    {
    // Make the background image fit the screen (stage.stageWidth and stage.stageHeight)
    }


    Try out my game http://alpha.bombwar.com - Alphakey: fkaplha

  3. #3
    Junior Member
    Join Date
    Jul 2009
    Posts
    20
    Hello, thanks for the response. At the moment the background image is the background in Flash, i was going to attempt making it a background via HTML but i thought i'd try posting on here first......

  4. #4
    WohOoooooo zompo's Avatar
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    138
    Well, if you want it to resize to fit the whole screen it should be in the flash.

    Its wierd if everything is changing scale but the background image wont. Do the background image stay exactly the same size and other stuff gets bigger/smaler?


    Try out my game http://alpha.bombwar.com - Alphakey: fkaplha

  5. #5
    Junior Member
    Join Date
    Jul 2009
    Posts
    20
    Kool yeah i've been investigating HTML this afternoon and it looks like Flash is the best way.

    Yeah that's pretty much how it works at the moment. I will try what you suggested though over the weekend. Thanks again for your advice :-)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center