A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Variables

  1. #1
    Junior Member
    Join Date
    Apr 2001
    Posts
    8

    Variables

    Hi,

    I´m just starting to learn the basics of programming, but it seems my set variable actions are just being ignored in the movie. In the first frame I put this actionscript

    bluebloc = "1";

    In the 5th I put this

    if (bluebloc = 1) {
    gotoAndPlay(2);
    }
    if (bluebloc = 2) {
    gotoAndPlay(8);
    }

    Then I put a button with a set variable actionscript in it like this

    on (release) {
    bluebloc = "2";
    }

    N matter how much I change things round, the flash movie just ignores all the variable, does anyone know why?

  2. #2
    Space Monkey daarboven's Avatar
    Join Date
    Sep 2001
    Location
    in the basement boiling soap...
    Posts
    217

    Re: Variables

    code:

    bluebloc = "1";



    means you set bluebloc to a string "1", not to a number (which would be without quotes )


    code:

    if (bluebloc = 1) {



    here you set bluebloc to 1 instead of comparing it's value with 1 which would be :
    code:

    if (bluebloc==1)



    but go on since we learn only from mistakes


    :::i am jacks complete lack of surprise:::

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