-
duplicateMovieClip and button behavior
In MX
I'm creating a series of thumbnail images that when clicked open a description of the image.
I'm using:
duplicateMovieClip(thumbSubProduct, "thumbSubProduct"+z, z);
To create my thumbnails.
At least that's what I'm trying to do. And I can't get the button behavior to work.
I have tried:
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
CurrentThumbButton = this._name;
}
if (!this.hitTest(_root._xmouse, _root._ymouse, true)) {
}
}
Also tried: onClipEvent (mouseUp) {
I also tried putting a button inside the movieclip. No go.
I can't:
1: get a unique name from the movieclip when I mouseover the movieclip. When I do a trace it gives me the names of all the dynamic movieclips.
2: Simply call a function
So I can't get button behavior to work at all with my dynamic movieclips.
-
my solution
So this is how I got the button to work:
onClipEvent (mouseUp) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
trace(this._name);
DupButtonName = this._name
currentSubprod = DupButtonName.charAt(DupButtonName.length-1);
_parent.currentSubprod = currentSubprod;
_parent.gotoAndPlay(2);
}
if (!this.hitTest(_root._xmouse, _root._ymouse, true)) {
}
}
I hope that helps someone else. Seems I needed to change frames to get it to work.
Still wasn't able to call a function though.
-
lemme get this straight wht u want to d is generate gallery and then when a thumbnail is clicked in the gallery... u want a function to be called and which in turn displays the desired description... right?
well i wud suggest u first make a multidimensional array of all the names of the descriptions, id's and anyother info u require and then from within the loop u r using to create the gallery, u start asigning the onrelease events for each thunbnail.
something like this:
PHP Code:
for (i = 0; i < total; i++) {
horz_mc.menu.attachMovie(hotels_array[i][2], "menu" + i, 1000 + i);
horz_mc.menu["menu" + i].count = i;
horz_mc.menu["menu" + i].onRelease = function() {
populate(this.count);
};
}
CooL "N" CalM
my body is sore
my eyes are red
i still itch for more
before i hit the bed
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|