View Full Version : If and or statements

03-22-2001, 11:44 AM
I am trying to run a program from flash through a fscommand using several different variables at the end of the command.

The variables get turned "on" and "off" via check boxes. Now one of the variables is full and the other is called fast.

How do I make flash add only the variables checked at the check boxes at the end of the fscommand?

My old script looked sometehing like this:
//+path is variable for file path to be used
//Makes HLVIS.exe run with variables
on (release) {if (full = "on")fscommand ("exec", "E:\\Half-Life\\Zhlt\\hlvis.exe"+chr(9)+full+chr(9)+path); }
{if (fast = "on") {fscommand ("exec", "E:\\Half-Life\\Zhlt\\hlvis.exe"+chr(9)+fast+chr(9)+path);}
//Makes HLVIS.exe run without variables
on (release) {if (fast = "off") fscommand ("exec", "E:\\Half-Life\\Zhlt\\hlvis.exe"+chr(9)+path);}
//and one more for full but i am too lazy to put it

Now the syntax might not be right but i am nt sure if this would work at all, a little help is needed.

May be there is a way to make Flash add variables to only one fscommand by how they are checked!!! that would make the entire thing easier but i don't know how to do that.

03-23-2001, 12:13 AM
I can't think of any way to give Flash that sort of logic... other than hand-done If Else commands. I'd use:

on (release) {
if (fast != null && fulll != null) {
// launch wtih fast and full
} else if (fast != null && full == null) {
// launch wtih fast
} else if (fast == null && full != null) {
// launch wtih full
} else {
// launch wtih none

This assumes your variables start with no value and are given a value if they are to be true.