A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Nasty IF problems!

  1. #1
    Junior Member
    Join Date
    Apr 2004
    Location
    Devon, England
    Posts
    10

    Nasty IF problems!

    Hello All.

    I have a nasty IF problem which I can't work out, can anyone help me? What I want to is make a pop up box which pops up when the user has been 'moused over' a button for a certain length of time. This in itself is not to do, however i want to animate the pop up, so that it alpha blends in then the button is moused over, and then alpha blends out when the user either clicks on the button or rolls out.

    I have tried to do this with a seperate MC, which is stopped on the first frame and then blends in, stops and blends out. The code i have put in my button is this:

    on(rollOver) {
    tellTarget("Sites MO") {
    gotoAndPlay(2);
    }
    }

    on(rollOut) {
    tellTarget("Sites MO") {
    gotoAndPlay(30);
    }
    }

    on(release) {
    gotoAndPlay(86)
    }

    This works, however creates a problem. When the user has only rolled over the button for a very short time and the animation hasnt started yet, and then they roll out very quickly, the animation plays which makes the object dissapear, when it hasnt even appeared yet!!!

    Does anyone know a way around this or a better way of doing it??
    Is it possible to say "If the Sites MO current frame < 20 then goto and play 1 (which will reset the animation without making the box 'dissapear') else gotoAndPlay(30)"

    Is this possible??

    Thanks for your help!
    Commander Xtreme
    "I don't need a safety screen, BANG!!!" ~ Me!

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

    Code:
    onClipEvent (load) {
        _alpha = 0;
    }
    onClipEvent (enterFrame) {
        if (alpha == true && _alpha<100) {
            _alpha += 5;
        } else if (alpha == false && _alpha>0) {
            _alpha -= 5;
        }
    }



    on button

    Code:
    on (rollOver) { 
    clip.alpha = true; 
    } 
    on (rollOut) { 
    clip.alpha = false; 
    }

    NTD

  3. #3
    Junior Member
    Join Date
    Apr 2004
    Location
    Devon, England
    Posts
    10
    Thanks for bailing me out a second time NTD!!!
    Commander Xtreme
    "I don't need a safety screen, BANG!!!" ~ Me!

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