?
Solved

movieclip within movieclip click through problem

Posted on 2009-02-18
4
Medium Priority
?
448 Views
Last Modified: 2013-11-11
I have 2 movieclips, MC called A is a big MC ontop (in layer) of a MC called B. Say MC A is about 2x bigger than B. Ultimately what i would like to do is make the big MC non-clickable but have a rollOver and rollOut function (but i dont want the hand cursor to show over MC A). MC B is going to be the clickable area and when i click on it it will make MC A disppear (i.e. sets MC A = _visible = false). The code is what i have so far but doesnt work.
Screenshot shows 3 MCs, MC A that im describing and 2 others of which 1 is MC B, you can just ignore the other one.
mc1_mc.useHandCursor = false;
mc2_mc.useHandCursor =  true;
 
mc1_mc.onRollOver = function()
{
}
 
mc1_mc.onRollOut = function()
{
}
 
 
mc2_mc.onMouseDown = function()
{
	if (this.hitTest(_root._xmouse, _root._ymouse, true))
	{
			trace("im clicked")
			this.swapDepths(this._root.mc1_mc);
			_root.mc1_mc.swapDepths(-100)
			this.swapDepths(10)
			mc1_mc._visible = false;
			mc2_mc.useHandCursor =  true;
	}
 
}

Open in new window

untitled.PNG
0
Comment
Question by:guswebb
  • 2
  • 2
4 Comments
 
LVL 11

Expert Comment

by:Eaddy Barnes
ID: 23675702
which part of the script does not work.

because everything seems to work except the useHandCursor method

however the useHandCursor is only meant to be used on buttons and not

movieClips.

GE
0
 
LVL 9

Author Comment

by:guswebb
ID: 23679399
Well what i want it to do is as follows:
Only when i hover on the small block behind the big block do i want the cursor to appear and then when i click on that same block i want the big block to disappear while the hand cursor remains existant on the small block. If you notice from my code, it does not do this. And i didnt know you could only use it on buttons because the documentation says its for movieclips.useHandCursor.
0
 
LVL 11

Assisted Solution

by:Eaddy Barnes
Eaddy Barnes earned 1000 total points
ID: 23686601
0
 
LVL 9

Accepted Solution

by:
guswebb earned 0 total points
ID: 23719869
GE thx for that example although in your example youve placed the green layer behind the front layer. In my example i need the big green layer to be infront of the gray one. The idea is as follows:
I want to be able to hover over the green area fine but if i click on the green area where the gray area exists underneath then the gray area should indicate it was clicked.
I think i have found a solution though:
greenArea.onRollOver = function()
{
      this._parent.gotoAndStop(2);
}

greenArea_mc.onRollOut = function()
{
      this._parent.gotoAndStop(1);
}

grayArea.onMouseUp = function()
{
      if (this.hitTest(_root._xmouse, _root._ymouse, true)) // mouseClick was within grays region
      {
            // gray MC in layer behind Green one was clicked :)
      }
}

If you have anything better by all means let me know otherwise thx for ya help.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses
Course of the Month14 days, 15 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question