A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: control browser window size with getURL

Hybrid View

  1. #1
    Member
    Join Date
    Nov 2000
    Posts
    38

    control browser window size with getURL

    Just wondering if anyone knows what I would add to my actionscript for a getURL command to make the browser window that opens up a certain size, in my case, really small.

    thanks,
    D

  2. #2
    Member
    Join Date
    Nov 2000
    Posts
    38
    Just want to add something bizzare to this that's happening.

    I have a button set to carry this action out, BUT, the button NEVER works the 1st time it is pressed or released, or whatever(I've tried it both ways). It only works the 2nd time and everytime thereafter. Really wierd.

    What would make this happen?

    Here's the code I used

    on (release) {
    instancename.onPress = function() {
    getURL("mymp3file.mp3");
    };
    }

    I also wish I could figure out how to load the mp3 as a swf so a separate browser window never even has to open for someone to audition the mp3s.

    Help

  3. #3
    Junior Member
    Join Date
    Jun 2003
    Posts
    19
    try that

    on (release) {
    getURL("javascript:window.open('file to be oppened',new Date().getTime(),'width=600,height=450,top=0,left= 0'); void(0);");
    }

  4. #4
    Junior Member
    Join Date
    Nov 2009
    Location
    Santa Monica, CA
    Posts
    1
    I was trying the pop up window code in flash and it works well,

    on (release) {
    getURL("javascript:window.open('file to be oppened',new Date().getTime(),'width=600,height=450,top=0,left= 0'); void(0);");
    }

    but my original page loses the flash images once the button is clicked and the new window opens. Any thoughts?

  5. #5
    Member
    Join Date
    Nov 2000
    Posts
    38
    crashed my browswer window using that code, but thanks for the effort.

  6. #6
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    first opening a new window,

    try,

    code:

    on (release) {
    getURL("javascript:window.open('page_to_open.html' ,'myWindowName','width=400,height=300');void(0);") ;
    }



    for security reasons most browsers should prevent you making the window too small though.

    the second post because you've wrapped the onPress event handler in an on (release) button event the onPress isn't defined until after the press event has passed (the button has been released)

    just add a frame action in the same frame,

    code:

    instanceName.onPress = function() {
    getURL("mymp3file.mp3");

    };



    maybe look into using the Sound object for playing your mp3 file,

    music = new Sound(this);
    music.loadSound("mymp3file.mp3", true); // stream the sound

    also check _soundbuftime to set how long the sound should be buffered before playing

  7. #7
    Member
    Join Date
    Nov 2000
    Posts
    38
    Ok, I see what I've done wrong.

    Don't know how to use the sound object though.

    I don't want the sound to stream in the background. I want it to be controlled by a button.

    D

  8. #8
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    code:

    // load the sound
    music = new Sound(this);
    music.loadSound("mymp3file.mp3", false);

    myButton.onPress = function() {
    music.start();
    };


  9. #9
    Senior Member
    Join Date
    May 2008
    Posts
    332
    If I understand the problem, when the popup window opens, the parent window closes?? If so, then add:
    Code:
    '_blank'
    right after:
    Code:
    getURL("javascript:window.open('file to be oppened','_blank',...
    A new window will open, leaving the parent also open.
    Best wishes,
    EfV

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