ActionScript 3.0 :: Totally Stop A Class From Working - Making Null?
Mar 23, 2010
I have a large creation in process that requires a lot of heavy animations and movement with vectors and really processor intensive. Just want to know, regardless of whether the project is huge or small, how to totally stop a class from working? I have three classes I am calling. "class1 = new Class1();" etc. When I am in the level, say, class2, I can still talk to objects in class1 even though I removed the class listeners within that class1 after I was done using it. It still is able to be called upon, and still running something in the background that I can't figure out what it is. I just want to know, rather than searching for whatever is causing the problem, can't I simply null the class that I never ever need to use again?
I tried that, but then I ran a trace and it still tells me that it is a class object. I reckon its because I have a "public var class1:Class1" etc, which means they will always have those objects associated with them, but still. I want to totally get rid of it for garbage collection, and because I don't want to use some of them at all, ever again. So basically, what is the best way to get rid of classes so that they aren't hogging up resources any more?
View 2 Replies
Similar Posts:
Mar 12, 2006
It's been a while since I've last posted, but I read a lot of others' posts, and try to keep up to date.My question is this:I have a group of images that are loaded up using xml into a movieclip. The movieclip is masked. I have 2 buttons, that scrolls the grouping either up or down. I would like to make these buttons inactive when the grouping of images is on it's last row, meaning when there is only one row of images shown on the screen/mask.
I have tried using hitArea, but I wasn't successful. This would be easy for me to achieve if I wasn't trying to make it a bit dynamic. Basically, someone would be updating the xml file with more nodes/images and the swf would update the list of images, thus making it difficult to hardcode when the list should stop scrolling.
View 10 Replies
Mar 11, 2003
So I am tring to load a movie into a target. It is loading but all of the scripts are not working (some of the scripts are working). All the scripts work if I load the movie to a level instead of a target. But I need the movies to be in a target because of the motion that I want to apply to the loaded movie
View 1 Replies
Mar 22, 2011
I am working on a video player in Flash CS4. I'm trying to build the player such that when the user moves their mouse over the flash object, the playback controls appear and, when the user moves the mouse out of the flash object, the controls disappear.I managed to get some code put together that works in every browser but one: Internet Explorer. Well, it 'works' but only if you slowly move the mouse out on the left side of the flash object.I have done quite a bit of Google searching for an answer, but I can't seem to find someone with a similar problem.Code is as follows:
ActionScript Code:
root.onLoad = function(){
_root.clip.skinAutoHide=true;
[code].....
View 1 Replies
Apr 5, 2010
im using this code for my movie to pause for a certain time and then it play every after 5 seconds
stop();
var nInterval = setInterval(Play, 5000);
function Play() { clearInterval(nInterval); gotoAndPlay(_currentframe+1);}
[code].....
View 8 Replies
Aug 11, 2011
We have a quiet big flex application compiled with flex 3.4 SDK.We also have several modules to load after some requirements (some at startup, some later).Everything is compiled with the same version.At some point i got this exception on my machine and don't know how to fix it.
VerifyError: Error #1014: Class mx.modules::ModuleBase could not be found.
at flash.display::MovieClip/nextFrame()
at mx.core::FlexModuleFactory/deferredNextFrame()[code]....
I removed and installed already several flashplayer versions, but always the same error.When we copy the artifacts that are compiled on my machine somewhere and somebody else opens it on his machine it works.
View 2 Replies
Oct 4, 2009
I have a movieclip with a class attached to it, so obviously i can acces it with commands of the kind this.* What i want to do, is delete the movieclip after some time (it's a bullet from a tank and I want it to be gone after explosion). I can removeChild it, but the code "this = null" doesn't work.Is there any way to get it out of my memory? Because now my application slows down and in 5 minutes it's unplayable...
View 6 Replies
Sep 21, 2011
I'm currently having some trouble with referencing objects that turn out null on export. Basically I want the Document Class to run the code of another class that is the class of a MovieClip without having Error 1009 popping up everywhere in my output panel.
[Code]...
View 1 Replies
Sep 21, 2011
I declare this tween...
ActionScript Code:
private var _tweenX:Tween;
private var _tweenY:Tween;
I even fire it off it when the player hits a corresponding button...
ActionScript Code:
museumGuy.gotoAndPlay("Walk");
_tweenX = new Tween(museumGuy, "x", Regular.easeOut, museumGuy.x,categoryPaintings.x, 40, false);
_tweenY = new Tween(museumGuy, "y", Regular.easeOut, museumGuy.y,categoryPaintings.y, 40, false);
_resetAnimation = true;
As you can see I have some animation stuff in there. I need to stop the museumGuy from doing his walk animation when the tween is over so I have this on the EventEnterFrame function I set up.
ActionScript Code:
if (_tweenX.isPlaying == false && _tweenY.isPlaying == false && _resetAnimation == true)
{
museumGuy.gotoAndPlay("Idle");
[code]...
how I can stop that? In my Init() I tried to state...
ActionScript Code:
_tweenX.isPlaying = false
but it doesnt like that either.I could fire off a tiny tween as soon as the app starts that doesn't last long enough to notice,but I really want to get a hold of how to control it.
View 4 Replies
Jul 1, 2009
I'm making a website using flash,And on my movie it says Welcome to Blah Blah Blah,And then a button appears, To make sure my button works,The writing turns to bold and goes bigger,When the button appears it works and goes bigger, Until it reaches the point in the timeline where it has stop();It stops my movie from looping or restarting which is what i want, But it stops my buttons from working aswell, How to keep my button working but movie stops,If you want me to explain more just ask
View 1 Replies
Mar 17, 2004
This is the scenario:
[AS]
// Assuming a lot more properties are added to all objects
var parent:Object = new Object();
var kid:Object = new Object();
var kidToy = new Object();
[code]....
Does making the parent object null recursively release all memory used by all subordinates in the hierarchy?
View 3 Replies
Mar 5, 2007
get a bunch of objects in my library to inherit from (or even be) one class that i have made, but without having to make .as files for every single one is this possible, or is there any other way to give objects another classes functionality in an auto-generated class?
View 3 Replies
Oct 13, 2011
How do I stop a class file from automatically inserting itself into the .fla file. I want to insert it manually into a frame, and then tell it to stop after I leave the frame.The following is the code included in my .as file.
ActionScript Code:
package {
import flash.display.*;
import flash.events.*;[code].........
View 3 Replies
Mar 1, 2011
there is a problem with IE browser it does not recognize object HTMLEmbedElement and not proceed for further execution . i have no choice because there is nothing to be updated in programming code
View 2 Replies
Nov 11, 2009
Okay I'm struggling with my FLVPlayeback component. I have one on my stage, then when you click a button a movie loads in it, but as soon as i click on the home button to go back to frame 1 then the movieclip continues playing, (audio only) when i go back to the FLVPlayer, nothing is playing although you hear the audio and if you load another movie in the FLVplayer it plays over the other one.
I did try
Code: Select allMovieB.stop();
but its not working, it only gives me a
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at WorshipTeam_fla::MainTimeline/onPhotoClick2()
View 4 Replies
Dec 23, 2010
I am designing a website for a friends band, there's a picture gallery page with two buttons, a live shots button and a promo shots button, which goes to frames 2 and 3 respectively on both frames 2 and three i have a third button called back.
This back button isn't working, I keep getting
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at site2_fla::pics_31/site2_fla::frame1()
Here's the code for the buttons
Code:
stop();
live_btn.addEventListener(MouseEvent.CLICK, buttonClick);
function buttonClick(event:MouseEvent):void{
[Code]....
View 2 Replies
Feb 15, 2010
I have a main fla file, that preloads and loads three external SWF's just perfectly. The three SWF's are simple flip book animations. This is the site: [URL]. This is the only actionscript in the main.fla file.
Code:
var j = 0;
myarray = [];
cliparray = [];
createEmptyMovieClip("paper", -1);
_global.preloaderf = function(klip) {
[Code] .....
The problem is, that the first movie is really jumpy, the second is a little better and the third is the best. There's three buttons designated to each movie. My question is, why are the movies jumpy? I'm assuming it's because when one is visible, the other two in the background are still running and taking up the speed. How can I make the background SWF's go into a stop state, or whatever you might call it.
View 0 Replies
Jan 15, 2004
this may seem like an odd question. well after spending ages getting my slider to act like I want I now want it to stop at a certain point - but to act 'naturally' - basically the slider accelerates the more a button is pressed and uses a set deceleration number to slow down the slider when the button is unclicked. So the faster its going the longer and further the slider takes to slow down - 'ease' down. when it reaches zero it stops.
If you click on the blue arrow in the movie youll see what i mean. The problem comes up when i want to get the slider to stop. I want the slider not to go beyond a certain point (say 600). This gets very difficult if the slider is to act naturally (as before). I guess some kind of reverse engineering is required that works out what point to start the slow down based on where the slider is and what speed its going at??
View 9 Replies
Sep 8, 2006
This problem is driving us crazy. The idea is simple. We have one instance of the FLVplayback component on stage as well as a playlist of videos. When we click a video in the playlist the FLVplayback instance starts the progressive download and plays the video.However, when we click a new item in the playlist, the FLVplayback instance won't start playing this file until it has completed loading the previous file. Stopping playback makes no difference.Is there a way to stop the FLVplayback instance from playing AND downloading so it is instantly ready to start loading and playing a new oneOf course removing the instance and attaching it again is an option, but that screws up the functionality of the player's controls and really feels like a hack that we shouldn't have to use.
View 5 Replies
Dec 14, 2009
When my avatar bug makes contact with another type of bug, he eats it. Both bugs are movie clips; when the avatar gets into the collision detect zone of the edible bug, it triggers a quick animation in the "edible" bug: he becomes a blur for one frame then disappears (as though eaten).
The problem is the sound effect - a quick "whoosh". It needs to play once then stop. What happens now is that it's triggered repeatedly - a problem if the avatar passes over the edible bug slowly. If the avatar later passes over the spot where the edible bug was, the sound is triggered multiple times again. So I need the sound to play only once, then stop. There will be several copies of the edible bug's movie clip that need to behave the same way, so once the sound stops playing it needs to be available again for the next collision.
Here's what it looks like now:
private var sfx_edible:Sound = new eat();
function detectCollision(myevent:Event):void {
if (avatar_mc.hitTestPoint(edible_a.x, edible_a.y, false)==true) {
[code]....
View 1 Replies
Dec 5, 2009
I am trying to load an image. The image paths are stored in an xml file called "setup.xml". I'm getting the strangest error. Never seen it before.
[Code]...
View 3 Replies
Sep 24, 2010
I'm using the code and assets from this page. [URL] I'm creating ads for websites and they don't allow continual animation after 3 loops. I added to the above code to make it fade at the end. I think I'm close, but it doesn't seem to fade away as I had hoped, it just keeps falling.
Am I missing some code that I need to replace? Do I need to put a frame # somewhere when I want it to fade? Does the last part of the code go on a frame at the end? The snow just keeps falling even though it's reached the last frame. What do I add to make it stop?
Here is the code. The link above will show you exactly the type of animation I'm looking at. I added the fade part after "init ( );"
init = function () {
width = 300;
// pixels
height = 250;
[Code].....
View 2 Replies
Sep 24, 2010
(remove the spaces to correctly link, my post count is too low to include links)
kirupa. com/ developer/flash8/snow. htm
I'm creating ads for websites though and they don't allow continual animation after 1 to 3 loops. What I'm hoping to do is one of the following:
Rather than have an abrupt stop to the snow on the last frame and have them oddly disappear, I'd like to have it stop creating snow on (for example) frame 100 so it's all gone by the last frame (for example) 130.
Here is the code.
init = function () {
width = 300;
// pixels
[Code]....
On a side note, I have the AS code on frame 1 currently, and just to test it out I added a stop(); to the last frame, but the snow kept falling. Do I have to add code to this snow code to get it to stop at a certain frame?
View 6 Replies
Dec 17, 2007
My game is simple game where you are a block at the bottom of the screen and you have to move side to side to avoid larger blocks that are falling from above. Now the only problem is that i am very nw to action script so i have no idea of the code i need to insert in my MC. So far i have been able to make the players block move from side to side with the arrow keys and make a block fall from the top with this very pathetic script i found out:
PHP Code:
onClipEvent(EnterFrame) {
this._x += 5
}
I was wondering if anyone could give me some code so that the players block will stop moving when it hits the side of the stage and that the block that falls down will apper at the top again but with a random Y position on the stage.
View 1 Replies
Sep 24, 2010
I'm using the code and assets from this page. [URL]. I'm creating ads for websites though and they don't allow continual animation after 1 to 3 loops. What I'm hoping to do is one of the following:
Rather than have an abrupt stop to the snow on the last frame and have them oddly disappear, I'd like to have it stop creating snow on (for example) frame 100 so it's all gone by the last frame (for example) 130. I'm using flash 8, AS2.
Here is the code.
init = function () {
width = 300;
// pixels
height = 250;
On a side note, I have the AS code on frame 1 currently, and just to test it out I added a stop(); to the last frame, but the snow kept falling. Do I have to add code to this snow code to get it to stop at a certain frame?
View 1 Replies
Mar 20, 2011
In my game, people can go back to the menu when they want. So when I go back to the menu, I make null all of the classes I instantiated. I then make them new again:
private var myClass:MYCLASS; // this happens once
someFunction () { // called when game begins and every time i go back to the menu and restart
[Code]....
Do I have to remove all of the listeners in the class I am making null?
Now when I go back to the menu, and do this, it is like the class is still instantiated and now there are two! When I shoot my gun, I hear it twice, and it traces out twice when I begin the game again. If I go back to menu for the second time, and restart game, when I shoot my gun it traces out three times from that same class that I made null.
I don't understand what is happening. It is like it is not truly getting rid of the class. Is it because I possibly still have something connected to that class? When I make it null though, I trace it and it reads "null".
View 3 Replies
Oct 28, 2011
I wonder if it is posible to create a new variable in actionscript like this...
ActionScript Code:
//create a new variable
var ["new_var_" + myNumber]:Array = ["hello, hey, more_silly_stuff"];
//putt my new variable inside my old Array
row[myNumber] = ["new_var_" + myNumber];
If you understand what I want to do, is it in some way possible to acomplish this?
View 9 Replies
Mar 13, 2012
I am making a platform game in flash. I have a goal class(the class which contains code for the goal sprite, where when you hit it, it continues to next part of game).
[Code]...
The beginClass function is fine, and only runs once, but eFrame is what checks if the player has hit the goal, so it is constantly running. The problem is, once the player hits the goal, eFrame continues to run, while in a menu describing the next scene to the player. My eFrame function is below.
[Code]...
View 3 Replies
May 13, 2011
In my document class named Engine, the stage variable is for some reason null:
package game
{
import flash.display.MovieClip;
[Code]....
This was working fine up until now. I just recently added two dynamic text fields into a symbol, and all of a sudden the stage is null. I really don't see the connection.
View 2 Replies
Jun 13, 2010
So, I popped open up Flash CS5 just now, and I couldn't find my projects panel. I was working on a dual screen set up previously, so my windows were everywhere anyways (sans external). I switched over to a smaller screen workspace, and popped opened the projects panel. Oddly enough, the code snippets panel came up instead. So, I switched off the code snippets, and tried again. I've been trying different ways of opening this panel for about 15 minutes, and I'm totally stumped. Some thorough googling didn't present any relevant results, so, StackOverflow, I turn to you. Is this a known issue? is there a secret backdoor way to open this panel?
View 1 Replies