ActionScript 2.0 :: Check If "delete This.onEnterFrame;" Is Working?
Mar 5, 2005Is there any method how can I check if "delete this.onEnterFrame;" is working or not?
View 5 RepliesIs there any method how can I check if "delete this.onEnterFrame;" is working or not?
View 5 Replieshow can I check if "delete this.onEnterFrame;" is working or not?
View 5 RepliesonEnterFrame=null, onEnterFrame=undefined & delete onEnterFrame....
Which one to use??? What are the performance considerations. If all my movieclips on-stage are running a MovieClip.prototype.onEnterFrame = function() {run initial stuff before setting onEnterFrame=null/undefined... }, will there be performance hits? It's sad that delete onEnterFrame doesn't work unless I delete the prototype enterFrame as well, which would make the clips reinitailise itself again once you declare the enterFrame prototype again (i need to do this since there's more movieclips that end up appearing on-stage, and they need to automatically initialises themselves the moment they appear).
[Code]...
any consise methods to restart a deleted onEnterFrame that has been deleted?
View 3 Repliescan you delete a onEnterFrame that is placed on the MC its self, for example:
Code:
onClipEvent(load){i=0}
onClipEvent(onenterFrame){
i++
if(i>50){
delete this.onEnterFrame
}
}
the concept is simple and works when placed on the timeline but does not work when placed directly on the MC.
trying to stop the onEnterFrame loop but it won't stop.
[Code]...
I'm trying to exit the loop and go to frame openWin but that doesnt jumps so I tried to delete the onEnterFrame but the loops contiues.
1) how can I exit the loop to frame openWin? thats most importent it's what I need!
2)if I dont use this.onEnterFrame = function(){ just earth.onRelease = function doent work either unless its in the onEnterFrame why? the earth has animation on it but here i'm using it just as a button so I see no conection to why it isnt working unless its in the onEnterFrame?
i have this code:
Code:
gallery_mc.thumbs_mc.onEnterFrame = function() {
if (this._currentframe == 95) {
loadThumbs(0);
delete this.onEnterFrame;
[code].....
problem is when i get to 95, everything works well, but when i get to 105, the onEnterFrame had already been deleted so that code doesnt run anymore. how can i accomplish this so that the code on 105 runs?
I'm using a number of onEnterFrame functions in my project and to slow down the CPU consumption I want to delete them when they've done their job. I've got this code to work with things like alpha fades, but the delete this.onEnterFrame doesn't work with the easeing code. I think it's the division part of the code that's affecting it. Can someone lend me a hand?
Code:
var targetY = 220;
this.onEnterFrame = function() {
[code].....
onEnterFrame = function(){
if(such and such){
delete this.onEnterFrame;
}else if(such and such){
start this.onEnterFrame;
}
}
whats the proper syntax for this one?
how can i delete all the onEnterFrame event in my movie/swf?
View 4 RepliesI've got a minor issue with a non-functioning delete instruction in a onEnterFrame statement. Here's the code
this.onEnterFrame = function() {if ((_root.gira1 == 1) && (_root.gira2 == 1) && (_root.gira3 == 1) && (_root.gira4 == 1)) {gotoAndPlay("action");delete this ["onEnterFrame"];_root.tunnelaperto = 1;
}}
what you suggest? Till now "delete this ["onEnterFrame"]" always went allright...
[code]How can I create a condition to delete this onEnterFrame at the proper moment?
View 2 Repliesi am using the following AS to scale a movieclip with ease
[Code]....
should i be using a delete this.OnEnterFrame when the clip reaches the desired width? the problem is that ive noticed a lag in my tweens and i wonder if this is whats causing it.
i am using the following AS to scale a movieclip with ease
[Code]...
should i be using a delete this.OnEnterFrame when the clip reaches the desired width? the problem is that ive noticed a lag in my tweens and i wonder if this is whats causing it.
I'm creating a complex site, with lots of calculations, while I have to keep it as light as possible. I don't want to have 50 .onEnterFrame's running simultaneously, so, how do I stop them? See example: Let's say I want a simple movement, invoked by some reason:
Code:
mcChild.onEnterFrame = function(){
if(mcChild._x < mcParent._width){
mcChild._x += 5;
}}
Now I want to stop the .onEnterFrame check, because it reached the if = false - How??
var mcHolder:MovieClip = _root.mcHolder;
mcHolder.onEnterFrame = function() {
trace"hello");
[code].....
I am running a test using onEnterFrame in flash mx but its not working for the life of me... Heres the code:
[Code]...
I am trying to get the text box to always register the width of the "test_mc" however it will not change from 100 it doesn't even start at 100! I tried changing the "_xscale" to _xmouse to see if it would change the text and it worked but still not for "_xscale"!
How can I combine these two functions without any of them failing or interrupting each other.
[Code]...
I'm not getting errors but my program wont call my function.
Code:
this.onEnterFrame = function() {
if(wm == 10)[code].....
I want to change to my end game screen when my value of variable wm gets to 10. Sorry I cant figure out whats wrong with the if statement. It doesnt work outside a function either.
why?
//This doesn't work
my_mc.onEnterFrame = function() {
this.alphaTo(1,1,"easeoutSine");
[code]........
I used kirupas tutorial 'Complex Button RollOver/Rollout Effects' to make a menu that slides down when you roll over it. I have buttons inside that menu_mc - but they dont work.
My question is - does the on enter frame function prevent buttons from working?
Here is the code that is inside my menu_mc:
stop();
this.onEnterFrame = function(){
if(rewind == true){
prevFrame();
[Code].....
why does this not work
[code]...
as soon as i put an object into an array it stops working with onEnterFrame
I am working on someones as2 file and I noticed that they had an onEnterFrame running non stop in the movie. I don't use onEnterFrame personally. So I tried to create a conditional to stop it. While the conditional worked its stopped the fluid animation they had used. So I need to figure out some other way to get rid of the onEnterFrame. Anyone have any ideas here? The AS basically resizes a box on stage when certain movies are loaded.[code]
View 5 RepliesThere is a function that I use all the time written in AS2 with buttons and rollovers to create a smooth animation in and out that doesn't relly on gotoAndPlay or gotoAndStop methods (as I have found them to be quite buggy. The AS2 code follows. I have started to write the same function in AS3, but keep getting errors when attempting to create a nested even listener for the onEnterFrame function that will drive the animation forward. How can I rewrite the AS2 function to work the same way in AS3.This is the AS2 Code
Code:
btnBox.onRollOver = function()
{
[code]....
i'm very new to Flash (although have plenty of experience in Java, C++, PHP, etc). For a University assignment, I am creating a World Cup Guide and i'm creating a countdown to the tournament. I've followed a tutorial and modified it slightly but i'm receiving an error message. The error message is:
[Code]....
I have already foud out where I want to place my sprites in my game, and I don't want to have to go through th elengthy "duplicateMoveClip" procdure (or it seems to be lengthy to me anyways, it's probably like 2 lines of code, but still, I WANNA DO IT MY WAY!) ok, anyways, does delete only work on variables and not movie clips?here's what I have so farthis is in the bullet movie clip:
Code:
onClipEvent ( enterFrame){
if (Key.isDown (Key.SPACE)){
[code]....
How come this code is not working:
PHP Code:
voca = new Object();
voca.onKeyDown = function( {
[code].....
I am working on a project in flash cs4 and have Adobe Air 1.5 as player as this will be air appi. But other than using localstore to save my data everything else is pure flash as3 code. Nothing special really. And I was just about to finish it when this problem occurred. If I delete a layer that has nothing else but a picture inside which I was using to position movies correctly, everything in frame 3 where my main code is stops working. It doesn't trace anything, it just stops but actions on frame 1 and 2 work just fine. I don't get any errors either.
I deleted all the code from my main action layer in frame 3 and it still doesn't trace simple trace("aa");. As if everything I've put on the layers can't be changed or it just stops working. Same thing if I change a sound in the library, just updating it with another and it stops working. I just can't find the answer really. I rearranged things, deleted movies, basically everything and still no answer. I even tested it in flash cs3 and same thing happens. But I used this kind of methods before (deleting layers that I didn't need) and never had this problem before.
I have a movie that loads a head and a body onto the stage. I want to send it a command to delete the existing load different heads and bodies. Heres what I have and in theory would like to do:
[Code]...
I got these four errors when I tried to create a button on the stage that would delete the text I inputted in the inputtext(ti). Based on the scripts I have and the errors, what should I write to create the delete button?
[Code]....