-
Multiple Variables
Hi everyone.
I am working on a site (in Flash MX) where the user can choose from a variety of t shirt colours and graphics to create their own t shirt.
http://www.thesplendiddesigncompany.com
I am using variables (the "if _root.colour ==" method) to navigate from one colour to another, and the same for the graphics for smooth transitions.
What I wan to do is add a button that says "order me" and when I click on it the button checks what the colour variable is and what the graphic variable is and then open an email button with the product name as the subject.
The bit Im stuck on is getting the button to check two variables,
I guess it would be something like this...
On (release){
If (_root.colour == 01){
&
If (_root.graphic == 01){
getURL("mailto: [email protected]
else_if (_root.colour == 02){
&
If (_root.graphic == 01){
getURL("mailto: [email protected]
The problem is when I try this it doesnt work, if anyone has any suggestions how I implement this PLEASE help me, I am sure it can be done I just dont know how.
Thanks in advance.
-
Code:
on(release){
if (_root.colour == 01 && _root.graphic == 01){
//do one thing
} else if(_root.colour == 02 && _root.graphic == 01){
// do another thing
} else {
// do a default thing
}
} // end on release
-
fwiw - omit the leading zero on your number, Flash treats it as octal -
colour = 021;
trace(colour); // 17 - returns as base 8
-
Thanks a modified dog
Knew it was something like that, but you clarified it perfectly for me.
Didnt get the last bit though - trace(colour); //17 - returns as base 8
Could you possibly explain this bit for me.
Thanks again
-
Flash treats numbers with leading zero as base 8
base10 base8
7 ------ 7
8 ------ 10
9 ------ 11
and so on ...
so base10 (21) = base8 (2 * 8 = 16 + 1 = 17)
-
basically what it means is base10 (21) in base8 is 17 because it times the first number by 8 because its base8 then adds the second digit onto it so 2 * 8 = 16 then add one to = 17 hope this clarifys things a little
-
I hear an echo .. echo .. echo :D
-
sorry i was trying to explain it in a simpler format because
so base10 (21) = base8 (2 * 8 = 16 + 1 = 17)
is hard to inderstand for some people so i tried simplifing it a little more and explained why it * 8 and not something else
-
no problemo .. the more answers the merrier .. :thumbsup: