A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: resize browser from flash??

  1. #1
    Member
    Join Date
    May 2006
    Posts
    48

    resize browser from flash??

    Hì u all,
    I really would like to change/resize the browser dimentions from flash when a object for example is bouncing on it, the problem is that I have no idea how this could work, and what to search...
    please help!!!

    salta

  2. #2
    Senior Member ninjakannon's Avatar
    Join Date
    Sep 2004
    Posts
    393
    I think this will work, although I've never used it:
    Code:
    getURL("javascript:window.resizeTo(800,600)");
    This should resize the window to 800 x 600.
    ninjakannon

    - My Website -

  3. #3
    Member
    Join Date
    May 2006
    Posts
    48
    hì ninjakannon, thanks for repling so fast, do u know also how I could detect the position of where the object is bouncing (because is a random movement).. and say than to the browser to reach that point?

  4. #4
    Member
    Join Date
    May 2006
    Posts
    48
    but this script opens a new window with that size.. I need to resize the current window...

  5. #5
    Senior Member ninjakannon's Avatar
    Join Date
    Sep 2004
    Posts
    393
    Ok, sorry that didn't work. I looked up javascript on google and found a function that resized the window, but obviously not the current one.

    Basicaly you can do getURL("javascript:javaFunction()"); in flash, this will call the javascript function in place of 'javaFunction'. I would expect that this is the method that you will have to use; although I do not know what javascript function you will have to use.

    And your object, if it is in flash then get its X and Y position using:
    Code:
    _root.bouncingObject._x
    _root.bouncingObject._y
    Where 'bouncingObject' is, you will need to put the instance name of the bouncing movieClip. The X and Y values are where the movieclip is on the stage.

    Hope this helps
    ninjakannon

    - My Website -

  6. #6
    Member
    Join Date
    May 2006
    Posts
    48
    thanks, I'll search for the javascript now..

  7. #7
    Member
    Join Date
    May 2006
    Posts
    48
    what about the flash.external.ExternalInterface class?
    or a javascript funcion that comunicates with the actionscripts??
    help please!!!!!
    I found nothing..

  8. #8
    Senior Member ninjakannon's Avatar
    Join Date
    Sep 2004
    Posts
    393
    Sorry, but I'm stuck on this one I've never done it before and I havn't found anything useful.
    ninjakannon

    - My Website -

  9. #9
    Member
    Join Date
    May 2006
    Posts
    48
    here what I have in the flash file:

    import flash.external.ExternalInterface;
    ExternalInterface.call( "resize", width, height );
    prova.onPress = function() {
    ismoving();
    prova.startDrag();
    }
    function ismoving (){
    width = prova._x;
    Stage.width = prova._x;
    height = prova._y;
    Stage.height = prova._y;
    }
    var stageL:Object=newObject();
    Stage.addListener(stageL);

    here the javascript:

    <script>
    function resize(width, height)
    {
    window.resizeTo(width,height);
    }
    -->
    </script>

    but it doesn't work!!!!!
    Anybody there that has an idea of what is wrong or what is missing??

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