A Flash Developer Resource Site

Results 1 to 20 of 33

Thread: Rollover within Rollover?

Threaded View

  1. #4
    Senior Member jbum's Avatar
    Join Date
    Feb 2004
    Location
    Los Angeles
    Posts
    2,920
    Unfortunatly, Flash will only allow one object to be roll-overed at a time.

    Also, if you nest the hotspots inside the picture, then the hotspots won't receive rollover events at all, because the outer clip eats the event.

    In short, Flash does not support nested rollovers which is what you want here.

    However, I found a somewhat kludgy work-around, and I'm enclosing a FLA file that demonstrates it.

    You nest the movieclips, and then use an onEnterFrame handler to generate a fake rollover event for the inner (nested) clips by using hitTest.

    Here's the script. It assumes the outer clip is named mcclip and the inner clip is named mc (or mcclip.mc).

    code:


    mcclip.onRollOver = function()
    {
    trace("outer rollover: " + this);
    }

    mcclip.onRollOut = function()
    {
    trace("outer rollout: " + this);
    }

    mcclip.mc.onEnterFrame = function()
    {
    if (this.hitTest(_root._xmouse, _root._ymouse, true))
    {
    if (!this.isRollOver)
    {
    this.isRollOver = true;
    trace("inner rollover: " + this);
    }
    }
    else {
    if (this.isRollOver)
    {
    this.isRollOver = false;
    trace("inner rollout: " + this);
    }
    }
    }

    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