Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-26-2003, 02:44 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default [tip]How to open a popup browser window

FFish Script does not provide any method to open a popup browser window. However, it can be done by the WebBrowser control:

Firstly let's create a hidden browser window and open a blank window:
Code:
var var1 = createControl("Shell.Explorer.2", 0, 0, 0, 0);
var1.activex.navigate2("about:blank");
Then let's get the window object of the opened document.
Code:
var window = null;

var1.activex.NavigateComplete2 = function (obj, url)
{
 * * *var doc = obj.document;
 * * *window = doc.parentwindow;
}
Notice: you cannot use "var1.activex.document" before the navigating is complete. The expression will return null.

Now we can open the popup window:
Code:
var pop = window.open("about:blank", "preview",
 * * * * *"height=400,width=550,status=yes,toolbar=no,scrollbar=no,menubar=no,location=no", false);
 * *pop.document.write(html); * * *

If you want to open a popup window without borders, you can use the method introduced by
http://www.jsmadeeasy.com/javascript...splashwin.html

Here is the code taken from the site, we made a little changes to make it work in FFish Script
Code:
function launchSplashWin(contentType, contentString, width, height, left, top)
{
 * * *var w = window.screen.width;
 * * *var h = window.screen.height;
 * * *var l = (left != null) ? left : (w - width) / 2;
 * * *var t = (top != null) ? top : (h - height) / 2;
 * * *
 * * *var uri = (contentType.toLowerCase() == "uri") ? contentString : "about:blank";
 * * *
 * * *var splashWin = window.open(uri, '_splash', 'fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0', false );

 * * *splashWin.blur(); * * *
 * * *window.focus();
 * * *
 * * *splashWin.resizeTo(width,height);
 * * *splashWin.moveTo(l, t);

 * * *if (contentType.toLowerCase() == "string") 
 * * *{
 * * * * * *var swd = splashWin.document;
 * * * * * *
 * * * * * *swd.write(contentString);
 * * * * * *swd.close();
 * * *}

 * * *splashWin.focus();
}
Notice: Though the "window.open" method takes 4 optional parameters, you must provide all its parameters in FFish Script, or it will say something like "wrong parameters".

We made a demo to preview the main movie in the popup window:

1. * * *Prepare a string contains the HTML codes
Code:
var str = '<HTML><HEAD><meta http-equiv=Content-Type content="text/html; *charset=GB2312">';
 * * *str += '<TITLE>Preview</TITLE>';
 * * *str += '</HEAD>';
 * * *str += '<BODY bgcolor="#FFFFFF">';
 * * *str += '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
 * * *str += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';
 * * *str += 'WIDTH="550" HEIGHT="400">';
 * * *str += '<PARAM NAME=movie VALUE="SWF_NAME">';
 * * *str += '<PARAM NAME=quality VALUE=high>'
 * * *str += '<PARAM NAME=bgcolor VALUE=#FFFFFF>'
 * * *str += '<EMBED src="SWF_NAME" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400"'; 
 * * *str += 'TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>';
 * * *str += '</OBJECT></BODY></HTML>';

var movie = getMovies()[0];
var html = str.replace(/SWF_NAME/g, movie);
2. Write the string to the document of the popup window
Code:
var pop = window.open("about:blank", "preview",
 * * * * *"height=400,width=550,status=yes,toolbar=no,scrollbar=no,menubar=no,location=no", false);
 * *pop.document.write(html); * * *
If you need the demo project, please contact support@swfkit.com
Reply With Quote
  #2 (permalink)  
Old 02-27-2003, 10:27 PM
Member
 
Join Date: Jan 2003
Posts: 54
Send a message via MSN to swfbaz Send a message via Yahoo to swfbaz
Default Re: [tip]How to open a popup browser window

ok... we know how to open a browser window. as you described. but what if i want to do this all in the IE object which lies in the current project of mine?.. well... for somereason i've to display results in html format within my running project. how is it possible? any suggestion?

i would appriciate if you clear it with an example.

regards
__________________
SWFBaz Preview [October 2006]
http://www.SWFBaz.com
Reply With Quote
  #3 (permalink)  
Old 02-27-2003, 10:30 PM
Member
 
Join Date: Jan 2003
Posts: 54
Send a message via MSN to swfbaz Send a message via Yahoo to swfbaz
Default Re: [tip]How to open a popup browser window

one more thing... although i 've not checked it at the moment... but want to ask you first. i.e... if i load a page in tiny browser. and that page contains a swf movie played in it. is it possible to invoke swfkit scripts from that embeded file?


regards
__________________
SWFBaz Preview [October 2006]
http://www.SWFBaz.com
Reply With Quote
  #4 (permalink)  
Old 08-23-2006, 04:47 AM
Junior Member
 
Join Date: Aug 2006
Posts: 3
Default Re:[tip]How to open a popup browser window

Hello Support Team,

Even I am need of something like this. Somehow (Using your help only) I could able to open HTML Page within my Final EXE. Now, what I want is, some values from that HTML Page to be transferred to main Application.

Please guide us how to achieve this ?

Thanking you in advance for any such help in this direction.

Regards
-Bhavesh Savla
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:21 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.