A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: AS 2.0 pause timeline on MC rollover ?

  1. #1
    Member
    Join Date
    Jan 2009
    Posts
    30

    AS 2.0 pause timeline on MC rollover ?

    I have a movie clip.
    within this mc I have an image and an as layer with this code to link on click

    this.onRelease = function() {
    this._parent.getURL('http://www.???.com');
    };

    I would like to also have on mouseover pause for the main timeline. I basically have cycling images that link but would like them to not cycle while a user is moused over one of them. Pausing the main timeline on mousover of one of these movie clip images would work great. Can someone help me to combine a pause on mouseover with this above code?
    Thank you.

  2. #2
    Member
    Join Date
    Oct 2006
    Location
    Belgium
    Posts
    36
    Hi raine976,

    Code:
    this.onRelease = function ()
    {
       getURL ("http://www.flashkit.com", "_blank");
    };
    
    this.onRollOver = function ()
    {
       // pause the cycling image
       this.stop ();
    
       // pause the main timeline
       _root.stop ();
    };
    
    this.onRollOut = function ()
    {
       // start the cycling image
       this.play ();
    
       // start the main timeline
       _root.play ();
    };

  3. #3
    Member
    Join Date
    Jan 2009
    Posts
    30
    Thanks for fast reply.
    This isn't really working for me though . It doesn't seem to pause my main time line. Im pretty sure as to why its doing this but again don't know how to resolve it.
    I have 4 frames each with an image (movie clip). each frame has a pause done in AS so the image is displayed for a short time before moving onto the next image/frame. I think it is probably this AS that is not letting the mouseover work because it appears it will run the as that is telling it to go to next frame after pause regardless of this mouse over. Do you have any idea on a fix for this? Here is the code I am using for the pause. I picked it up from another site.


    //script layer
    this.createEmptyMovieClip("timer",50);
    timer.onEnterFrame = function()
    {
    if (this.startTime>0)
    {
    var diff = getTimer()-this.startTime;
    if (diff>this.timerLength)
    {
    this.target.play();
    this.startTime = 0;
    }
    }
    };
    function pauseFor(theTime)
    {
    stop();
    timer.timerLength = theTime;
    timer.startTime = getTimer();
    timer.target = this;
    }

    //each frame I want to pause has "pauseFor(4000)"


    Thanks again.
    Last edited by raine976; 07-06-2009 at 04:22 PM.

  4. #4
    Member
    Join Date
    Oct 2006
    Location
    Belgium
    Posts
    36
    Is this what you mean?
    Attached Files Attached Files
    Last edited by WPRS; 07-06-2009 at 07:54 PM.

  5. #5
    Member
    Join Date
    Jan 2009
    Posts
    30
    yeah this is pretty much spot on to what I have. I will have to compare to my file when I get on my other computer tomorrow and see what I have done wrong. Thanks for the file its very much appreciated.

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