# Res. Button

**URL:** https://forum.kirupa.com/t/res-button/10711
**Category:** flash
**Created:** [January 6, 2003, 5:19am UTC](https://forum.kirupa.com/t/res-button/10711 "2003-01-06T05:19:36Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![titter](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@titter](https://forum.kirupa.com/u/titter)
#### Post date: [January 6, 2003, 5:19am UTC](https://forum.kirupa.com/t/res-button/10711/1 "2003-01-06T05:19:36Z")

</div>

Ok…here we go again. I always seem to asks these kinda questions that start a 2 page thread. Anyway, here we go again. I need to make a button that on release would goto the right page either for a person running 800x600 or lower or a person on 1024x768 or higher. Thats just the beggining, I also need to have it open a centered popup window that is the correct size for the person. So if there resolution is 800x600 the window is 800x600…only other thing is if there res is 1024x768 or higher the window only needs to be 1024x768. So now I will let this thread grow and hope for the best. Thanks all in advance!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 6, 2003, 6:02am UTC](https://forum.kirupa.com/t/res-button/10711/2 "2003-01-06T06:02:47Z")

</div>

```php

myButton.onRelease = function() {
	var res = System.capabilities.screenResolutionX
	if (res == 800) {
		// do this
	} else if (res == 1024) {
		// do that
	} // and so on
}

```

untested but it should work :beam: [size=1][I hope][/size]

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 6, 2003, 6:19am UTC](https://forum.kirupa.com/t/res-button/10711/3 "2003-01-06T06:19:50Z")

</div>

My final product came to this and it seems to work:

```php

on (release) {
	myButton.onRelease = function() {
		var res = System.capabilities.screenResolutionX;
		if (res == 800) {
	address = "http://www.apocalypseclan.net/wonder/index.htm";
	target_winName = "smallres";
	width = 800;
	height = 600;
	toolbar = 0;
	location = 0;
	directories = 0;
	status = 0;
	menubar = 0;
	scrollbars = 1;
	resizable = 0;
	openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
		} else if (res == 1024) {
	address = "http://www.apocalypseclan.net/wonder/index.htm";
	target_winName = "highres";
	width = 1024;
	height = 768;
	toolbar = 0;
	location = 0;
	directories = 0;
	status = 0;
	menubar = 0;
	scrollbars = 0;
	resizable = 0;
	openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
		}
	};
}

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 6, 2003, 6:34am UTC](https://forum.kirupa.com/t/res-button/10711/4 "2003-01-06T06:34:14Z")

</div>

```auto

on (release) {
	var res = System.capabilities.screenResolutionX
	if (res <= 800) {
		address = "http://www.apocalypseclan.net/wonder/index.htm"
		target_winName = "smallres"
		width = 800
		height = 600
	} else if (res >= 1024) {
		address = "http://www.apocalypseclan.net/wonder/index.htm"
		target_winName = "highres"
		width = 1024
		height = 768
	}
	toolbar = 0
	location = 0
	directories = 0
	status = 0
	menubar = 0
	scrollbars = 1
	resizable = 0
	openWinCentre (address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable)
}

```

I’d use something like this …

[size=1]**[EDIT]**  
I change the script again to do exactly what you want it to do [I think so][/size]

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 6, 2003, 7:01am UTC](https://forum.kirupa.com/t/res-button/10711/5 "2003-01-06T07:01:35Z")

</div>

I would use yours but I need scrollbars on the smaller window. So I did this.

```php

on (release) {
	var res = System.capabilities.screenResolutionX
	if (res <= 800) {
		address = "index3.htm"
		target_winName = "smallres"
		width = 798
		height = 600
		scrollbars = 1
	} else if (res >= 1024) {
		address = "index2.htm"
		target_winName = "highres"
		width = 900
		height = 618
		scrollbars = 0
	}
	toolbar = 0
	location = 0
	directories = 0
	status = 0
	menubar = 0
	resizable = 0
	openWinCentre (address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable)
}

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 6, 2003, 7:06am UTC](https://forum.kirupa.com/t/res-button/10711/6 "2003-01-06T07:06:55Z")

</div>

```auto
on (release) {
	var res = System.capabilities.screenResolutionX
	if (res <= 800) {
		address = "http://www.apocalypseclan.net/wonder/index.htm"
		target_winName = "smallres"
		width = 800
		height = 600
		scrollbars = 1
	} else if (res >= 1024) {
		address = "http://www.apocalypseclan.net/wonder/index.htm"
		target_winName = "highres"
		width = 1024
		height = 768
		scrollbars = 0
	}
	toolbar = 0
	location = 0
	directories = 0
	status = 0
	menubar = 0
	resizable = 0
	openWinCentre (address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable)
}

```

that’s it … now you have scrollbars in the smaller window

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 6, 2003, 7:11am UTC](https://forum.kirupa.com/t/res-button/10711/7 "2003-01-06T07:11:38Z")

</div>

since you’re calling the same document in both resolutions …  
you can remove one more line of code:

```auto
on (release) {
	var res = System.capabilities.screenResolutionX
	if (res <= 800) {
		target_winName = "smallres"
		width = 800
		height = 600
		scrollbars = 1
	} else if (res >= 1024) {
		target_winName = "highres"
		width = 1024
		height = 768
		scrollbars = 0
	}
	address = "http://www.apocalypseclan.net/wonder/index.htm"
	toolbar = 0
	location = 0
	directories = 0
	status = 0
	menubar = 0
	resizable = 0
	openWinCentre (address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable)
}

```

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 6, 2003, 7:18am UTC](https://forum.kirupa.com/t/res-button/10711/8 "2003-01-06T07:18:02Z")

</div>

oops … that’s funny

you’ve edited your last post when I was posting … :sigh:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [January 6, 2003, 7:57am UTC](https://forum.kirupa.com/t/res-button/10711/9 "2003-01-06T07:57:11Z")

</div>

lol and no they point to different locations. I was just reading that like hmm we have teh smae thing.

[http://www.apocalypseclan.net/wonder/index.htm](http://www.apocalypseclan.net/wonder/index.htm)

Take a look at the final project.
