Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 11th, 2004, 11:57 PM
LanTech LanTech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 9 LanTech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Need help with MC detecting mouse event on button...

Hi,

I'm having some diffculty and hopefully some one here can help.

What I would like to do is this (using MX/MX2004):

- I have a mask layer (which is a movie clip) "mask1"
- I have a button(s) on my menu "b1","b2", ...
- I have programmed actions into the mask movie clip, but need to have the movie clip detect when the/a button is on a RollOver state to trigger the appropriate behaviour.

Nothing I have tried so far seems to work. Can anyone help?

Many thanks!

Reply With Quote
  #2  
Old February 12th, 2004, 02:48 AM
Tann San Tann San is online now
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,718 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 11326 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 12 h 57 m 54 sec
Reputation Power: 580
Facebook MySpace
Hi,
Code:
on(rollOver)
   {
       _parent.mask1.buttonCaller = this;
   }

then in mask1 you can use buttonCaller to reference the button i.e.
Code:
if(buttonCaller._name == "b1")
   {
      //get up, get out, do something!
   }
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #3  
Old February 12th, 2004, 01:21 PM
LanTech LanTech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 9 LanTech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It's still not working, and I can't understand why , did I do something wrong in my code?:

b1:

on(rollOver){
_parent.mask1.buttonCaller = this;
}

mask1:

onClipEvent (load) {
_y = getProperty(_root.mask1._y, _y);
speed = 5;
menuOffy = -7.0;
menuOny = 129.0;
}
onClipEvent (enterFrame) {
if (buttonCaller._name == "b1") {
_y = getProperty(_root.mask1._y, _y);
endY = menoOny;
_y += (endY-_y)/speed;
}
else {
_y = getProperty(_root.mask1._y, _y);
endY = _y;
_y += (menuOffy-_y)/speed;
}
}

Also attached is a test fla file.

Thanks for your help.
Attached Files
File Type: zip test_maskscroll.zip (4.6 KB, 88 views)

Reply With Quote
  #4  
Old February 12th, 2004, 01:37 PM
Tann San Tann San is online now
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,718 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 11326 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 12 h 57 m 54 sec
Reputation Power: 580
Facebook MySpace
Hi, ok time to do some checking

I assumed you had something like:

_root
--------
mask1 | b1 | b2 | b3

is that right? basically with everything directly under _root.
Code:
on(rollOver)
   {
      _parent.mask1.buttonCaller = this;
      trace(_parent.mask1.buttonCaller);
      trace(this);
      trace(this._name);
   }

You could try:
Code:
on(rollOver)
   {
      _root.mask1.buttonCaller = this;
   }

or:
Code:
on(rollOver)
   {
      _root.buttonCaller = this;
   }

and then:

if(_root.buttonCaller._name == "b1"){}

or:

if(_root.buttonCaller == _root.b1){}

Reply With Quote
  #5  
Old February 12th, 2004, 01:46 PM
LanTech LanTech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 9 LanTech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Still not working, but receiving...

Hey,

It's not working, but when I added the trace I receive this message when I roll over the button:

undefined
_level0

Any ideas?

Thanks.

Reply With Quote
  #6  
Old February 14th, 2004, 08:43 AM
Tann San Tann San is online now
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,718 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 11326 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 12 h 57 m 54 sec
Reputation Power: 580
Facebook MySpace
Hi, can you back save to MX format so I can take a look. I'll check it out tomorrow as I'll be a bit busy tonight ;¬)

Reply With Quote
  #7  
Old February 15th, 2004, 03:10 PM
LanTech LanTech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 9 LanTech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Here is the test Movie in MX format...

See attached...
Attached Files
File Type: zip Test_MaskScroll.zip (4.5 KB, 237 views)

Reply With Quote
  #8  
Old February 15th, 2004, 05:03 PM
Tann San Tann San is online now
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,718 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 11326 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 12 h 57 m 54 sec
Reputation Power: 580
Facebook MySpace
Hi, ok looked it over:

on the button
Code:
on (rollOver) {
	mask1.buttonCaller = "b1";
}
on (rollOut) {
	mask1.buttonCaller = "none";
}


on the moving movie
Code:
onClipEvent (load) {
	speed = 5;
	menuOffy = -7.0;
	menuOny = 129.0;
}
onClipEvent (enterFrame) {
	if (buttonCaller == "b1") {
		endY = menuOny;
		_y += (endY-_y)/speed;
	} else {
		endY = _y;
		_y += (menuOffy-_y)/speed;
	}
}

Reply With Quote
  #9  
Old February 15th, 2004, 06:45 PM
LanTech LanTech is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 9 LanTech User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking

Tann: Thank you SO MUCH!

Works great, I haven't implemented it yet, but I am really happy!

Please chack out one of the sites that will use a variation of this code (this is not a finished site, and I cheated on the code, it looks like it works, but I used coordinates as opposed to an event listener):

http://lanny.xistential.com/yolande


Reply With Quote
  #10  
Old February 15th, 2004, 06:49 PM
Tann San Tann San is online now
Gotta get to the next screen..
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,718 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 11326 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 12 h 57 m 54 sec
Reputation Power: 580
Facebook MySpace
Hi, thats a nice site, sharp :¬)

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Need help with MC detecting mouse event on button...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |