I'm using iframes to present my games online, and I want to do a sort of ad thing, where when you click on it it opens a link in a new window, but instead it just goes to the webpage in the little 120x240 ad box- how do I make game maker open a NEW window?
Open New Window?
Started by Questionare, Oct 13 2011 01:53 AM
1 reply to this topic
#1
Posted 13 October 2011 - 01:53 AM
#2
Posted 15 October 2011 - 01:37 PM
You would have to create an extension. Create a .js file and put the following in there:
Then, within GM:HTML5, right click the extensions node > Create Extension.
Name it whatever.
Right click the newly created extension > add file, and add the .js file you created.
Press OK (leave Init, Final clear)
Right click that file > add function. Name it open_window, and click the drop-down box to select "string". Add it 3 times using the [+] in the lower left.
Press Ok.
Wherever you want to open the page add this:
open_window("http://example.com", "", "");
Use this page as a reference for attribute types. http://www.pageresou...pt/jwinopen.htm
I didn't actually test this, but if it doesn't work let me know
function open_window(url, winName, attString){
window.open(url, winName, attString);
}Then, within GM:HTML5, right click the extensions node > Create Extension.
Name it whatever.
Right click the newly created extension > add file, and add the .js file you created.
Press OK (leave Init, Final clear)
Right click that file > add function. Name it open_window, and click the drop-down box to select "string". Add it 3 times using the [+] in the lower left.
Press Ok.
Wherever you want to open the page add this:
open_window("http://example.com", "", "");
Use this page as a reference for attribute types. http://www.pageresou...pt/jwinopen.htm
I didn't actually test this, but if it doesn't work let me know
Edited by OMGCarlos, 15 October 2011 - 01:38 PM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











