A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Multiple Variables

  1. #1
    Senior Member
    Join Date
    Aug 2001
    Posts
    183

    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.

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    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

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    fwiw - omit the leading zero on your number, Flash treats it as octal -
    colour = 021;
    trace(colour); // 17 - returns as base 8

  4. #4
    Senior Member
    Join Date
    Aug 2001
    Posts
    183
    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

  5. #5
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    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)

  6. #6
    The Flash AS Newb
    Join Date
    May 2006
    Location
    Australia
    Posts
    179
    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

  7. #7
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    I hear an echo .. echo .. echo

  8. #8
    The Flash AS Newb
    Join Date
    May 2006
    Location
    Australia
    Posts
    179
    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

  9. #9
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    no problemo .. the more answers the merrier ..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center