A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Controling a movie in a button

  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    8

    Question Controling a movie in a button

    I have a button with a movie clip in it. When i scroll over the button the first part of the movie plays. I want the second part of the movie to play when i scroll off the button. The movie clip is inside the button on the "over" state frame. i tried the following code and it didn't work.

    Button name = ice_btn
    Movie name = slider_mc

    Code
    ice_btn.addEventListener(MouseEvent.MOUSE_OUT, toIce);


    function toIce(event:MouseEvent):void {
    slider_mc.gotoAndPlay(6)
    }

  2. #2
    Junior Member
    Join Date
    May 2008
    Posts
    8

    Question

    Kinda got it working but now i have another problem. I restarted and make a movie clip with 4 button states; up, down, over, out. All of the states work however, the "stop();" isn't working. So when ever i mouse over the button all the button states loop. I attached the file below. If someone could help me out it'd be greatly appreciated.


    stop();


    this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
    this.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
    this.addEventListener(MouseEvent.CLICK, onRelease);
    this.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);


    function onMouseOver(e:MouseEvent) {
    e.target.gotoAndPlay("over");

    }

    function onMouseOut(e:MouseEvent) {
    e.target.gotoAndPlay("out");

    }

    function onRelease(e:MouseEvent) {
    e.target.gotoAndPlay("over");

    }

    function onMouseDown(e:MouseEvent) {
    e.target.gotoAndPlay("down");

    }
    Attached Files Attached Files

  3. #3
    Member
    Join Date
    Jul 2005
    Posts
    37
    Hi there,

    Instead of using a movieclip inside try to use graphic element. Coz if u use movieclip then "MouseOver" event happens to the inside movieclip and that triggers the "MouseOut" event of the outer movieclip. Therefore you have a loop effect.
    Please see the attachment. I have converted the inner movieclip into graphic and it works.
    I would suggest you to add the drop shaddow effect mannually, that way you will be able to downsize the rendering time at runtime.

    Cheers
    Dipz
    ---------------
    www.webvariations.com
    Attached Files Attached Files

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