using popup in flash

on (release) {
getURL ("javascript:NewWindow=window.open('ShowPopup.php','newWin','width=400,height=300,left=0,top=0,
toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No'); NewWindow.focus();
void(0);");
}

The first part (Green) tells the browser that we will be sending it some JavaScript code. Then we define a new window object called 'NewWindow' This name is important because it will allow us to reference the popup window at later times. This does not have to have the name 'NewWindow' it can be anything as long as you keep it consistent. Then we use the window.open JavaScript command to open up a new window. This function contains a couple of options. The first is the target URL to the Page that you want to open inside the pop-up window. In this case that's 'ShowPopup.php'. The next option is to give the window a Name, the name of the window in this example will be 'newWin'. Then we have the option to include any of the following window parameters - shown by this part of the above code 'width=400,height=300,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No'. By changing around the numeric values and No to Yes you can control most of the features of the window. You can of course leave any or all of these properties out and they will then be set to their default values. Here is a description of each:

* width: A numeric value representing the width of the popup window
* height: A numeric value representing the height of the popup window
* left: A numeric value representing the left (X) position of the popup window
* top: A numeric value representing the top (Y) position of the popup window
* toolbar: A Yes / No value indicating whether to add a toolbar to the popup window
* location: A Yes / No value indicating whether to add the URL Location to the popup window
* scrollbars: A Yes / No / Auto value indicating whether or not to include scrollbars in the window
* status: A Yes / No value indicating whether to add the bottom Status/Loading part to your window
* resizeable: A Yes / No value indicating whether to allow the window to be resized once opened
* fullscreen: A Yes / No value indicating whether or not to open the window fullscreen. This will open a borderless full screen window in IE but will not work with Netscape.

Then we add the NewWindow.focus(); part, this ensures that the popup will be opened on top of all other windows. You can change this to NewWindow.blur(); (which is the opposite of focus except it pushes the window behind any other browser windows that are open. Then we close off the code by adding the void(0); portion.

As you can see that since we are able to add additional functions such as NewWindow.focus(); we will be able to add quite a few more functions and effects for this pop up window. The next part describes some of the more useful ones. Also their is no real need to place this script on a button - you can just as easily place it on a certain frame in your flash movie at a specific point you want your window to open. An example would be:

getURL ("javascript:NewWindow=window.open('ShowPopup.php','newWin','width=400,height=300,left=0,top=0,
toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No'); NewWindow.focus();
void(0);");

Just don't add the on (release) { portion. With this technique you can continue to open windows place at specific locations as your movie continues to play.

Nhận xét

Bài đăng phổ biến từ blog này

dung lượng RAM lớn nhất mà HĐH cấu trúc 32-bit nhận được

Ký tự viết tắt trong chat & email

Ubuntu LAMP Server