# Quality select with a button?

**URL:** <https://forum.kirupa.com/t/quality-select-with-a-button/12101>\
**Category:** flash\
**Created:** [January 26, 2003, 10:36pm UTC](https://forum.kirupa.com/t/quality-select-with-a-button/12101 "2003-01-26T22:36:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Afro\_Ninja](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Afro\_Ninja](https://forum.kirupa.com/u/Afro_Ninja)\
**Post date:** [January 26, 2003, 10:36pm UTC](https://forum.kirupa.com/t/quality-select-with-a-button/12101/1 "2003-01-26T22:36:53Z")

</div>

I’m disabling the (right click)menu in my flash movie, so I want to make it so that the user can cycle through low, med, and high quality by pressing “q”

ummmm… so how do I go about doing this?

I know I’ll use

if (Key.isDown(Key.Q)

{

}

but that’s about it. I’m also aware of two properties, those being \_quality and \_highquality, I just dont’ know how to use them. And don’t I need to stick this inside of

onclipEvent (enterframe) {  
}  
??

ack, still trying to get the hang of coding…

---

<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 26, 2003, 11:06pm UTC](https://forum.kirupa.com/t/quality-select-with-a-button/12101/2 "2003-01-26T23:06:37Z")

</div>

Actually it’s quite simple…

```php

// Put this code in the first frame of your movie

function toggleQuality()
{
    if(toggle <= 3)
    {
        toggle++;
    } else {
        toggle = 0;
    }
    _quality = qualitynames[toggle];
}

// Place this in the first frame of your movie

_root.onLoad = function()
{
    toggle = 0;
    qualitynames = new Array();
    qualitynames = ["LOW", "MEDIUM", "HIGH", "BEST"];
}

// Place this where you want the action to happen... 
// Whichever frame that might be

if(Key.isDown(Key.Q))
{
    toggleQuality();
}

```

There you go man… Albeit… I wouldn’t totally get rid of the right click menu…

Peace

---

<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 26, 2003, 11:21pm UTC](https://forum.kirupa.com/t/quality-select-with-a-button/12101/3 "2003-01-26T23:21:33Z")

</div>

wow, you need all that for quality select…?

I can barely follow it… I mean I get most of it, in my programming course we briefly touched on arrays and stuff.

I’ve so much to learn :o

thank you very much!

---

<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 26, 2003, 11:33pm UTC](https://forum.kirupa.com/t/quality-select-with-a-button/12101/4 "2003-01-26T23:33:53Z")

</div>

hmmm… it doesn’t seem to be working…

The very first frame of my movie is part of the preloader. the movie cycles through the first 3 frames until all frames are loaded. The code you gave me is on that first frame. I put the next part of the code (the if key down) on the fourth frame, the first frame that comes up when the movie is loaded.

And I want the quality select to be available through the whole movie

what am I doing wrong?

---

<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 27, 2003, 12:14am UTC](https://forum.kirupa.com/t/quality-select-with-a-button/12101/5 "2003-01-27T00:14:02Z")

</div>

Hmm…

I forget people put preloaders on their movies… _lmao_

Umm… Just move what is to be on the first frame… To a frame that’s closest to the first without having a preloader…

Then in every frame that you have the movie… Include the toggleQuality thing.

---

<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 27, 2003, 4:23pm UTC](https://forum.kirupa.com/t/quality-select-with-a-button/12101/6 "2003-01-27T16:23:51Z")

</div>

I don’t know man, this still isn’t working…

The whole first scene deals with the preloader and stuff. So I go to the second scene. On the first frame, in a new layer, I put all this:

function toggleQuality()  
{  
if(toggle \<= 3)  
{  
toggle++;  
} else {  
toggle = 0;  
}  
\_quality = qualitynames[toggle];  
}

// Place this in the first frame of your movie

\_root.onLoad = function()  
{  
toggle = 0;  
qualitynames = new Array();  
qualitynames = [“LOW”, “MEDIUM”, “HIGH”, “BEST”];  
}

Then in a new layer above it, in the first frame, I put

if(Key.isDown(Key.Q))  
{  
toggleQuality();  
}

and nothing happens when I press Q.

oh, wait… ok, I am using Flash 5. Will this only work in MX? Sorry, I just have a habit of posting on this board.
