dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] F8 | See my light switch code > it don't work | any suggestions?

  1. #1

    [F8] F8 | See my light switch code > it don't work | any suggestions?

    Hi,

    I'm just learning about flash and Action scripting and tried to create a simple button that turns an MC(tintbox1) on and off, via the alpha, like a light switch perhaps. So this was the code that i thought might work, but as you can imagine ...


    on (release) {
    if (_root.tintbox1._alpha=100) {
    _root.tintbox1._alpha = 0;
    } else {
    (_root.tintbox1._alpha=100);
    }
    }
    on (rollOut) {
    gotoAndStop(1);
    }


    Any pointers where i'm going wrong?

    Cheers - Dave
    dave 8-)

  2. #2
    Banned NTD's Avatar
    Join Date
    Feb 2004
    Posts
    3,438
    Hi,

    Something to remember is that a single equals sign assigns a value. A double equals sign compares a value....

    if (_root.tintbox1._alpha=100) {

    .... should be...

    if (_root.tintbox1._alpha==100) {

  3. #3
    CHeers, yep i missed that one, i'll give it a try and see if i have any luck, do you think it should work?
    dave 8-)

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