dcsimg
A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: movie clip question

  1. #1
    Junior Member
    Join Date
    Jan 2004
    Location
    Los Angeles
    Posts
    13

    movie clip question

    Howdy, I wanted to know how the following site achieved the effect of the movie clip being uder activated without it being a button....

    click the following link:

    http://www.stereolab.co.uk/news/

  2. #2
    Junior Member
    Join Date
    Jan 2004
    Location
    Los Angeles
    Posts
    13
    i meant user activated

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    A hitTest on the movie clips.

  4. #4
    Junior Member
    Join Date
    Jan 2004
    Location
    Los Angeles
    Posts
    13
    Thanks Oldnewbie for pointing me in the right direction!
    phawk

  5. #5
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Wasn't it in the left direction I pointed you?

  6. #6
    Junior Member
    Join Date
    Jan 2004
    Location
    Los Angeles
    Posts
    13
    ok, so I used the actionscript to be able to change the mouse pointer to a different graphic when I mouseover the movie clip. How do I keep it just the pointer, and make the clip user activated as in the link above?

    thanks!

    here's what I used:
    circleLarge_mc.onMouseMove = function() {
    if(this.hitTest(_root._xmouse,_root._ymouse, true)){
    if (!(circleSmall_mc instanceof MovieClip)) {
    _root.attachMovie("circle", "circleSmall_mc" ,1);
    }
    circleSmall_mc._x = _root._xmouse;
    circleSmall_mc._y = _root._ymouse;
    Mouse.hide();
    updateAfterEvent();
    } else {
    if(circleSmall_mc instanceof MovieClip){
    circleSmall_mc.removeMovieClip();
    }
    Mouse.show();
    }
    };

  7. #7
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Sorry!

  8. #8
    Banned by GMF ™
    FK´s Banning Machine
    jerez_z's Avatar
    Join Date
    Jun 2001
    Location
    Calgary
    Posts
    235
    if you use just a simple hittest it shouldn't affect the cursor:

    Code:
    //this code goes on the movieclip
    if(this.hitTest(_root._xmouse,_root._ymouse,false)) {
    //actions to perform while mouse is over
    }

  9. #9
    Junior Member
    Join Date
    Jan 2004
    Location
    Los Angeles
    Posts
    13
    Let me back up here for a second -

    How would I start from the ground up to achieve the affect on the site link I listed above?

    I need more actionscript than just the HitTest because the clip needs to know when to play, and putting it in the button's over state automatically turns the pointer into the hand.

    Any solutions?

    thanks!

  10. #10
    Banned by GMF ™
    FK´s Banning Machine
    jerez_z's Avatar
    Join Date
    Jun 2001
    Location
    Calgary
    Posts
    235
    ok I think I know what you want here..

    Code:
    if(this.hitTest(_root._xmouse,_root._ymouse,false)) {
    this.play();
    } else {
    this.stop();
    }
    //put this code in the onClipEvent(enterFrame)

  11. #11
    Junior Member
    Join Date
    Jan 2004
    Location
    Los Angeles
    Posts
    13
    Thanks for the tip - let me go take another crack at it!

  12. #12
    Junior Member
    Join Date
    Jan 2004
    Location
    Los Angeles
    Posts
    13
    Ok, do I attach the script above to the actions layer in the movie clip timeline, or the main movie timeline?

  13. #13
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    onClipEvent (enterFrame) {
    // if the mouse IS over the clip ...
    if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
    // do something like play the clip...
    } else {
    // do something else..
    }
    }

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