5 Replies Latest reply on Dec 25, 2006 10:34 AM by kglad

    basic define variable code won't work

    smilinpiggy
      hi.

      this is very odd. i took a 3-day actionscript workshop. we used the same one-line method of declaring and assigning a String/Number/Boolean/etc instance many many times. now i am on my home computer and trying to review the basics. the basic code (STRAIGHT OUT OF THE BOOK) is not working! i have tried variations of the same type of declaration by grabbing code from the macromedia sample tutorials and same problem. both the computer that i was using at the workshop and my home computer have Flash 8. the only difference i can think of is the class had a PC, whereas i use a mac at home. i am totally baffled. if anyone has any insight, i'd be very appreciative.



      my code...

      var userName:String = "fred";
      trace(userName);


      returns undefined.



      on the other hand, this 2-line method of declaring/assigning does work for me on my mac:

      var userName:String;
      userName = "fred";
      trace(userName);




      merry christmas btw :)