Help: Actionscript 3 and movie with scenes

Discussion in 'Web Design and Development' started by Starhorsepax, Aug 4, 2010.

  1. Starhorsepax macrumors member

    Starhorsepax

    Joined:
    Jun 6, 2010
    #1
    HI

    Did this thing on the class PC with Flash CS3 and Actionscript 3. It works: to a point. The mini video works fine but the text goes kind of fast so I'm trying to do a pause button. Only the button is only working in the first scene.
    It's supposed to be you move the cursor on the button it stops, and continues when it rolls off. I took it right off of an Adobe tv video.
    Anyone know where I can find an answer? I'm not finding much about how to use actionscript 3 with scenes (except the belated advice not too!)

    Really would like to get this. Thought it would be nice to stick it up on the class website so I can point to it when I try to get my counselor in job training to help me pay for adobe for my mac. :D (Kind of a 'see, look what I could do if I had it for myself and could get freelance jobs until I'm done school' thing.)
     
  2. Ride9650 macrumors 6502

    Joined:
    Jun 29, 2007
    #2
    If I'm reading your post right, a video is supposed to play until you move your mouse over a button, and continue after the cursor is off the button correct?

    I'm not sure how to integrate this with different scenes, but hopefully this can get you pointed on the right path

    (mouseIsOver, mouseIsNotOver and button aren't required names, you can change these to whatever you want)

    Code:
    
    button.addEventListener(MouseEvent.MOUSE_OVER, mouseIsOver);
    button.addEventListener(MouseEvent.MOUSE_OUT, mouseIsNotOver);
    
    function mouseIsOver(e:MouseEvent){
          //code to play your video
    }
    
    function mouseIsNotOver(e:MouseEvent){
          //code to stop your video
    }
    
    
    This should go on whatever frame the video and button are on.
     
  3. Groovetube macrumors member

    Joined:
    Jul 19, 2008
    #3
    scenes = bad. Don't use them. They're mainly for animators etc.

    If you can, ditch them. Use labels instead. That's your very best option.

    But, make sure you put the actionscipt into the new scene as well, because it won't affect the button in scene 2 if you don't.

    Also, if you want a handcursor, use
    button.useHandCursor = true;
    and
    button.buttonMode = true;

    HTH.
     
  4. Starhorsepax thread starter macrumors member

    Starhorsepax

    Joined:
    Jun 6, 2010
    #4
    Got it!

    Thanks all. I got it.:)

    I only did this as an experiment on learning flash and incorporating / experimenting with the different stuff. Not likely to use animation and scenes for the serious web stuff. (Although I might experiment for youtube or something! I'm an artist so I like animations.)
     

Share This Page