A Flash Developer Resource Site

Page 1 of 6 12345 ... LastLast
Results 1 to 20 of 109

Thread: INSTA-TUTE! - Popping a New Window in a Single Step

  1. #1
    Senior Member
    Join Date
    Sep 2000
    Posts
    1,159
    Here it is - the code to pop a new window in a single step:

    For Flash 5 - put this in your button:

    on (release) {

    getURL ("javascript:window.open('http://www.flashkit.com','NameofWindow','width=800,height =600,top=0,left=0'); void(0);");

    }

    Change the URL, window size, position, etc. to your specs...


    For Flash 4 - put this in your button:

    On (Release)
    Get URL ("javascript:window.open('http://www.flashkit.com','NameofWindow','width=800,height =600,top=0,left=0'); void(0);")
    End On

    Again, change the URL, window size, position, etc. to your specs...

    Thanks for this script goes to Polar Lights Studios (www.polar-lights.com) who gave me the initial code to modify!


    [Edited by GreatGooglyWoogly on 02-18-2001 at 09:52 PM]

  2. #2
    Senior Member
    Join Date
    Sep 2000
    Posts
    910
    Hi . . . you mean you don't have to put the JavaScript function in your html page?? or am I misunderstanding you?

    -pigghost-

  3. #3
    Senior Member
    Join Date
    Sep 2000
    Posts
    1,159
    That is correct - no need for javascript in your HTML file - just put this script into your button and VIOLA!!!

  4. #4
    Senior Member
    Join Date
    Sep 2000
    Posts
    910
    That's fantastic! Thanks GGW . . . life just keeps getting easier . . .

    -pigghost-

  5. #5
    Senior Member
    Join Date
    Sep 2000
    Posts
    1,159
    top

  6. #6
    Junior Member
    Join Date
    Dec 2000
    Posts
    12

    INSTA-TUTE?

    O.K. I copied the javascript and put it in my button, but it didn't work! I changed the URL to my specs and typed all that code into the URL box, set the window for _blank - but all that came up was a new browser window with all that code in the address bar...h-m-m-m, any ideas what might have gone wrong??

    Thanks!!

  7. #7
    Former Employee of Satan Napalm's Avatar
    Join Date
    May 2000
    Location
    Stellenbosch, South Africa
    Posts
    561
    GGW,

    I've tried to use this in a standalone application, and it works to an extend. The window opens at the defined size - but before that it opens a normal browser window.

  8. #8
    Senior Member
    Join Date
    Sep 2000
    Posts
    1,159
    Originally posted by Napalm
    GGW,

    I've tried to use this in a standalone application, and it works to an extend. The window opens at the defined size - but before that it opens a normal browser window.
    If you have a "_blank" set for your window type - remove it. The java command opens the window - the _blank in there will also open a tertiary window that you don't need.

  9. #9
    Junior Member
    Join Date
    Feb 2001
    Posts
    3
    Hi, I've put the script in to my file & it opens the window fine but the main flash page then disappears and all the page reads is [object] Do you know why this might be?

  10. #10
    Senior Member
    Join Date
    Sep 2000
    Posts
    1,159
    Originally posted by designbyv
    Hi, I've put the script in to my file & it opens the window fine but the main flash page then disappears and all the page reads is [object] Do you know why this might be?
    Is the Void statement in your code? Not having the Void statement, or having it done improperly, is what usually causes the content of your original window to go away.

    Keep playing with it - it does work.

  11. #11
    GGW you are the man! That is thinking, and I thank you for sharing.
    Sincerely,
    George Bonnes

  12. #12
    Senior Member
    Join Date
    Mar 2000
    Location
    Barcelona
    Posts
    225
    I've done what you said and it didn't work.I think I'm doing something wrong.
    What I want to do is to open a .swf file in a new window.
    That's the code I wrote:

    on (release){

    getURL("javascript:window.open('mymovie.swf','Name ofWindow','width=640,height=375,top=0,left=0'); void(0);");

    }

    What do I have to put where it says 'NameofWindow'?.

    Thanks.

  13. #13
    Senior Member
    Join Date
    Sep 2000
    Posts
    1,159
    Again: Open an Absolute Link: Use the http:// and the http://www.and the YOURSITE.COM/YOURPAGE.HTML.

    Also, I recommend opening the HTML file rather than the SWF - it is more stable that way.

    Seems like a lot of peeps are having a hard time making this work, so here is proof:

    [swf width="100" height="40" background="#FFFFFF"]http://www.jadrienbell.com/Footer/OpenWindow.swf[/swf] .


    And, here is the FLA file too for download:
    http://www.jadrienbell.com/Footer/OpenWindow.FLA

    Hopefully that will help everyone!

  14. #14
    Senior Member
    Join Date
    Dec 2000
    Posts
    215
    Thanks very much!
    I have tried a lot of think before, and I confirm IT DOES WORK.
    Congratulation GGW.
    However, I have another request for you:
    how from that window open another movie or htmlpage whatever, in the previous window, I have tried window="top", but it does not work.
    Impress me again please !!

  15. #15
    Senior Member Kestral's Avatar
    Join Date
    Apr 2000
    Location
    Fl, USA
    Posts
    222

    resolved Here is a nasty twist!

    How do you do this for a projector(.exe) on a CD? Is it possible? If so, how??? HELP!

  16. #16
    Senior Member
    Join Date
    Sep 2000
    Posts
    910
    Hi.....it should work exactly the same as on a regular website...I know when you have a javascript function in your html and call it...it works from an .exe, because you're still calling to a browser...I would assume this would work, also.

    GGW...this thread should be permanently attached to the top of General Help and F5 General Help...it's got to be the most asked question......and no one seems to use "Search".

    Just a thought........

    To the top........

    -pigghost-

  17. #17
    Senior Member
    Join Date
    Jun 2000
    Posts
    113
    *bump*
    i agree! i downloaded the fla. and it works great in I.E, but when it comes to netscape it opens a browser window b4 it opens my browser with the defined size. is there a way to by pass that?

    peace, 1lOvE
    rYaN

  18. #18
    Senior Member
    Join Date
    Mar 2000
    Posts
    128
    The way I was doing this before involved calling the function from flash and declaring it by hand in the html of the calling movie. This is much more elegant. The only thing I haven't figured out is how to keep the popup on focus. When the user clicks the main browser without closing the little window and then try to click the button to get it again, it remains behind the big one. Can that be fixed with this direct method?

  19. #19
    Junior Member
    Join Date
    Feb 2001
    Posts
    18

    where is _blank

    You mention above :
    If you have a "_blank" set for your window type - remove it. The java command opens the window - the _blank in there will also open a tertiary window that you don't need.

    I have the third window opening up too ... where is this _blank ??? -- i can't find it

    Thanks

  20. #20
    Junior Member
    Join Date
    Feb 2001
    Posts
    7

    Smile

    There are many problems facing the user of Netscape browsers...and these are mounting daily as the world moves on. Meanwhile, Netscape remains firmly rooted in the past...and believe me, I say this as a former lover of the product driven to avoidance and abhorrence.

    Netscape is NOT reliable when it comes to opening new windows with specific sizes. There are so many variances between the different version numbers that it behooves the developer to avoid the trick entirely, IF THEY ARE CONCERNED WITH NETSCAPE.

    In my opinion, there are many users who use the horrible thing still, but FACE IT...those are the ones who never fail to hit the skip intro button. Remember too, they are likely to have very mortal processors, and ANY motion you try with Flash will be rendered unwatchable...
    [Edited by Putney Swope on 02-10-2001 at 12:36 AM]

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