A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Please Help! resize flash if screen resolution is lower than 1024

  1. #1
    Junior Member
    Join Date
    Oct 2007
    Posts
    2

    Unhappy Please Help! resize flash if screen resolution is lower than 1024

    Grrr...

    So the idea is simple, if our visitor’s screen resolution is smaller than 1024, we want to have a flash that resizes, if it’s 1024 or higher, we want to give him our intended size with a noscale.

    I have found the following script on line:

    Just in front of the javascript embbed of flash, you add:

    if(screen.width < 1020)
    {
    var myScale = 'showall';
    }
    else
    {
    var myScale = 'noscale';
    }

    then within the Adobe’s embed, change the line

    ’scale’, ‘noscale’, (or whatever else)

    to

    ’scale’, myScale,


    but i can't seem to get it working, my opinion is that i use this script in a wrong place?
    Last edited by gravitysub0; 10-09-2007 at 05:19 PM.

  2. #2
    OOP is one letter from OOPS kortex's Avatar
    Join Date
    Aug 2005
    Location
    New Hope, PA
    Posts
    2,668
    The embed code is not going to recognize a javascript variable. Not sure if you can do this within an embed tag, but try:


    ’scale’, <script>myScale</script>,
    Jeremy Wischusen
    Flash - Flex - LAMP - Web Developer Purple Inc
    AS OOP FAQ-Best Practices Thread | Flashkit OOP Tutorials | Purple Inc (day job) | Blog


  3. #3
    Junior Member
    Join Date
    Oct 2007
    Posts
    2
    Thank you for an advice but I tried and it doesn't work. Is there any other way people might know on how to do this?

  4. #4
    Official FK nice guy 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Location
    Portland Oregon
    Posts
    1,645
    Hey there, I have done something like this before.
    I havent checked this code:
    PHP Code:
    // javascript function
    function getDim()
    {

    if ((
    screen.width 1024) || (screen.height 768))
    {
    return 
    document.write('mySmallerScaleHere');
    }
    else
    {
    // you may just be able to return the size instead of using document.write
    // return ('my1024ScaleHere');
    return document.write('my1024ScaleHere');
    }

    In order to get this to work, you will have to use something like swfObject.
    http://blog.deconcept.com/swfobject/

    you should already be using something like this.
    Just call the function inside the tag fro scale.

    If you have problems let me know and Ill see what I can put together for you.
    Im out of time right now
    3P

  5. #5
    Official FK nice guy 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Location
    Portland Oregon
    Posts
    1,645
    OK, here ya go.
    Just did this test an works fine.

    I included the newest swfObject js, but it would be better if just go download it so you have the other supporting files if needed.

    Get the zip file below and let us know if it works for you.
    Attached Files Attached Files

  6. #6
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    I agree, this is the same method(s) I would recommend..

    in my footer are two links called resizeFlash 1 & 2 both describe ways to edit/alter the dimensions...

    you may also want to check out the link in my footer called fullscreen..

    hope this helps..

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