The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.39 / 5.00 38,635 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 15,161 ViewsI am trying to apply clipevents to movieclips to my flash animations but I get syntax errors saying "clipevents can onlybe applied to movieclips." But I AM applying it to a movie clip soooooo, help?
At first I was like O.o but then, I LoLed! XD
It would not give that error if you were actually applying it to a movieclip. Make sure its not a button or a frame you are trying to apply the code to.
Are you putting it on the actual mc itself? or on a frame inside the mc?
On a frame in the mc. is that the problem? If so then what DO I do?
At first I was like O.o but then, I LoLed! XD
What kind of clipevent is it? If it's enterFrame, then you can just take out the ClipEvent.
sig'd
At 5/24/09 11:31 PM, MilesKitsune wrote: On a frame in the mc. is that the problem? If so then what DO I do?
Yup, that's the problem. The proper place for onClipEvents is if you simply left click the MC one time from the _root (or it's parent clip). You should get a blue bounding box. Open the actions panel, and put the code there.
Perpetually looking for time to return to the arts.
Thats all? holy crap! do you know that I have spent the past 3 months trying to figure out what was wrong? I always thought I was using the wrong code. man do I feel dumb! but thx that is a MONUMENTAL help.
At first I was like O.o but then, I LoLed! XD
Hey wait I just tried what you said but it applied the code to the main movie and STILL gave me the same syntax error!
At first I was like O.o but then, I LoLed! XD
Let us see what code you're trying to apply to your clip.
Perpetually looking for time to return to the arts.
onClipEvent (load) {
numCopies = 10;
this.swapDepths(1100);
if (_name == "pie") {
for (i=1; i<numCopies+1; i++) {
duplicateMovieClip("_root.pie", "dmc"+i, i+1000);
_root["dmc"+i].nm = i; //Holds the # of the MC
_root["dmc"+i].af = 100/numCopies;
_root["dmc"+i].onEnterFrame = function() {
with (this) {
if (_root.pie._currentframe == _root.pie._totalframes) {
_alpha-=af;
if(_alpha<=0) {this.removeMovieClip();}
} else {
gotoAndStop(_root.pie._currentframe-nm);
_alpha = 100-(af*nm);
}
}
};
}
}
}
At first I was like O.o but then, I LoLed! XD
At 5/25/09 02:20 PM, MilesKitsune wrote: a mess of code
its because you're doing it wrong
onClipEvent(enterFrame){} goes on MC
onEnterFrame = function(){} goes on a frame
you've done both on the MC
try:
onClipEvent (enterFrame) {
numCopies = 10;
this.swapDepths(1100);
if (_name == "pie") {
for (i=1; i<numCopies+1; i++) {
duplicateMovieClip("_root.pie", "dmc"+i, i+1000);
_root["dmc"+i].nm = i; //Holds the # of the MC
_root["dmc"+i].af = 100/numCopies;
if (_root.pie._currentframe == _root.pie._totalframes) {
_root["dmc"+i]._alpha-=af;
}
if(_root["dmc"+i]._alpha<=0) {
_root["dmc"+i].removeMovieClip();
} else {
_root["dmc"+i].gotoAndStop(_root.pie._currentframe-nm);
_root["dmc"+i]._alpha = 100-(af*nm);
}
}
}
}
all i did was take your code and put it into one onClipEvent(enterFrame){}
it should work how you want it to work if you put that code on the MC
if the rest of the code is right that is
At first I was like O.o but then, I LoLed! XD
At 5/25/09 02:56 PM, MilesKitsune wrote: Nope, still having syntax errors.
what errors?
Try 'On' instead of 'onClipEvent'... xP
ain't about how hard you hit... It's about how hard you can get hit, and keep moving forward... how much you can take, and keep moving forward.
Clip events are permitted only for movie clip instances
At first I was like O.o but then, I LoLed! XD
At 5/25/09 03:49 PM, MilesKitsune wrote: Clip events are permitted only for movie clip instances
:S well put it on a movie clip?
select the movie clip, make sure it is by looking in the bottom left of the properties panel it should say Movie Clip above where you enter the instance name. to open the properties panel press CTRL+F3
while the MC is slected press F9 to open the actionscript panel, then paste the code i put in there.
NOT ON A FRAME IN THE MOVIE CLIP!
I am using the code on a movie clip, see thats the problem for some reason my flash doesn't realize that i am using it on a movie clip! or somethin' like that.
At first I was like O.o but then, I LoLed! XD
Just upload the FLA somewhere. Will be much easier for someone to find the problem that way.
Perpetually looking for time to return to the arts.
maybe this is a longshot but could you be useing AS2 code inside an AS3 enviroment? I would try selecting an AS2 document when you first start up flash, then trying your code in there.
I am using AS2. and to the guy 2 above me, what?
At first I was like O.o but then, I LoLed! XD
At 5/25/09 06:49 PM, MilesKitsune wrote: I am using AS2. and to the guy 2 above me, what?
he means to upload the .fla file to here for one of us to have a look at and see what is wrong, as so far we've proven to be ineffective
i know your useing AS2 code but im pretty sure thats the exact error i got when throwing AS2 code into an AS3 document.
At 5/25/09 06:51 PM, 51lver wrote:At 5/25/09 06:49 PM, MilesKitsune wrote: I am using AS2. and to the guy 2 above me, what?he means to upload the .fla file to here for one of us to have a look at and see what is wrong, as so far we've proven to be ineffective
Umm... I, uh, okay?
At first I was like O.o but then, I LoLed! XD
At 5/25/09 09:20 PM, MilesKitsune wrote: Umm... I, uh, okay?
The .fla file? When you do something in flash and save it, it creates an .fla file.
If you upload that file, we can basically see exactly what you did, and where the problem is.
Perpetually looking for time to return to the arts.
yeah i get it now, and ive uploaded it to the link that other guy gave me. right now im just trying to learn the code i need for the game im making, so what i uploaded is just a test run of the code im using.
At first I was like O.o but then, I LoLed! XD
We need a link to where you uploaded it... the exact path, so we can download it and review it.
Perpetually looking for time to return to the arts.