View Full Version : Trouble with movie clips as clickable objects
banana_sam
04-20-2006, 03:19 AM
i need the action script to make a movie clip a clickable object so that it can perform different tasks such as changing frame running additional code etc.
i also need to find out how to use the components especially the button component that comes with macromedia flash mx 2004
thanks it will be very apreciated
banana_sam
Flash Gordon
04-20-2006, 03:22 AM
hello :)
button:
button_name.onRelease = function() {
// stuff
}
Different actions for MC
var B:Boolean = true
mc.onRelease = function() {
if (B) {
// stuff
} else {
// other stuff
}
B = !B;
}
DavidBowie
05-30-2006, 07:46 PM
Different actions for MC
var B:Boolean = true
mc.onRelease = function() {
if (B) {
// stuff
} else {
// other stuff
}
B = !B;
}
Can this be done for movie clips that are created and loaded dynamically?
Flash Gordon
05-30-2006, 07:47 PM
sure, why not?
DavidBowie
05-30-2006, 08:04 PM
Well, i'm trying to do just that, and am having some trouble.
I go through an array and create an empty movieclip for each array item, the movieclips show up fine but they're not clickable. Am I referencing the clip wrong when i create the onRelease function?
var movieClipName = "mC_PetPiece" + j;
var movieRef:Object = new Object();
movieRef.theSwf = this.createEmptyMovieClip(movieClipName, 100 + j);
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.loadClip(pieceInfo[3], movieClipName);
// pieceInfo[3] contains the location of an image to be loaded into the clip
// create the click event for this movie clip
movieRef.theSwf.onRelease = function() {
trace("gets to onRelease()");
}
DavidBowie
05-30-2006, 08:39 PM
Nevermind, I found my answer here:
http://www.actionscript.org/forums/showthread.php3?t=65571&highlight=clickable+movie+clip
DavidBowie
06-01-2006, 04:03 PM
I'm still having trouble actually....
I have a movieclip which loads another movieclip to hold an image. How do I create an onRelease action for the outer movieclip after it and everything in it (the picture and it's movieclip) has loaded?
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.