|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have a flash movie that contains 5 movies clips. Within each of those movie clips there is a button. My problem is this, I have a global variable called _global.c (by the way I am using Flash MX) which I want to set depending on which movie clip I click on. I know I am probably doing this wrong, but each movie clip has an onClipEvent(mouseUp) with the following code:
Code:
onClipEvent (mouseUp)
{
//ButtonNews.onRelease
_global.c = 2;
}
As you can tell depending on which movie clip is acted on the variable is set to that movie clip number. The problem is that the global variable is reset through each movie clip's onClipEvent(mouseUp) all the way to movie clip 1. I set breakpoints at each onClipEvent and when I clicked on movie clip 5 it would stop and set the variable to 5 then stop at the next breakpoint which is movie clip 4 onClipEvent and set the variable to 4 so on and so forth... Movie clip 1 handles the getURL: Code:
if(_global.c > 1)
{
getURL("index.php?c=" + _global.c, "_self", "POST");
}
else
{
getURL("index.php?c=1", "_self", "POST");
}
I want to be able to distinguish which movie clip was "clicked on" and set that variable to that movie clip's number without having to reset itself everytime through every movie clip's onClipEvent. I have even added a function in the onClipEvent "ButtonName".onRelease, but it still resets the variable through out each onClipEvent. I would appreciate any help. |
|
#2
|
|||
|
|||
|
Thanks to everyone who helped me out.
Here is the solution that tarakullof from macromedia's forum site helped me out with. I went ahead and added code to each movieclip: onClipEvent(mouseUp) { this.cVal = SomeInteger; } Then in the button I added the event: on (press) { _global.c = this.cVal; } |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Having problems with onClipEvent (mouseUp) with multiple movie clips |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|