A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Controlling timeline and movie clips with AS3

Hybrid View

  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    1

    Controlling timeline and movie clips with AS3

    After 4 years pause I'm back in graphic design, and where I live, we get to do everything. I used to be quite good at Flash (web banners mostly), but now there is ActionScript3, i totally hate.
    From my standpoint it's incredibly frustrating. If something is wrong in the AS3 code, the whole playback gets fckd up, stop(); does not work, and it just keeps playing in loop (wdf?).

    it seems incredibly hard to find any information, there used to be a lot of tutorials for AS2, but as Flash is doomed anyway, it seems as nobody invests time in Flash any more.

    What i want is give my clickTAG btn a ROLL_OVER function, to have a ROLL_OVER state for my web banner

    in AS2 it looks and works like this:

    Code:
    on (rollOver) { 
    movieClipBOX.gotoAndPlay('bannerStage2AnimIN'); 
    } 
    
    on (rollOut) {
    movieClipBOX.gotoAndPlay('bannerStage2AnimOUT); 
    }
    Can someone translate this to AS3?
    Thank you.

  2. #2
    Senior Member
    Join Date
    Jun 2008
    Posts
    549
    Try this.

    Code:
    		yourClickTagInstanceName.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
    		yourClickTagInstanceName.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
    		
    		function onMouseOver(e:MouseEvent):void {
    			movieClipBOX.gotoAndPlay('bannerStage2AnimIN'); 
    		}
    		
    		function onMouseOut(e:MouseEvent):void {
    			movieClipBOX.gotoAndPlay('bannerStage2AnimOUT); 
    		}

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