Flex :: Remove Object From Tweenlite?
Sep 13, 2011how can i remove object from Tweenlite
private var planeCards:Plane;
protected function animate():void
{
[code].....
how can i remove object from Tweenlite
private var planeCards:Plane;
protected function animate():void
{
[code].....
can we know what "eat" the most of memory in a swf ? is it possible with monster debugger? (i've just downloaded it)
my project works fine, but if i re-launch the swf when it is already launched (cmd+enter -> the swf is launched, then cmd+enter), this seems to give me an example of how it would be if i was on a very very slow computer, and this is "very" slow.So is there any possiblity to know what i can remove to save the memory?i use several tweenlite, no sound, and i load all my pages (5) that contains a very basic content, at the beginning, so during the preloading...
I'm trying to create a simple loop that adds a random number of stars, fades them out and removes them.The script I've come up with does everything but remove them, and perhaps I need a less on adding children to a stage.
Here's what I come up with
import flash.display.*;
import com.greensock.*;
import com.greensock.easing.*;
[code].....
I need a way to make the movie clips unique so I can tell my oncomplete function to remove the property clip, if I don't do this the movie will eventually slow down and crash because of so many (invisible) movieclips.
I'm creating visual effects using TweenLite, which currently only manages the tweens for me, can I also attach a sprite at a specific time? (using "delay")
Basically I want to use TweenLite to attach/remove sprites apart from just tweening existing objects.
I'd like to remove objects via removeChild after Tweenlite has finished tweening. But it doesn't really work because my objects are still in the DisplayList.
Code:
//TweenLite.to(sndText, .5, {alpha:0, onComplete:removeChild, onCompleteParams:[sndText]});//does not really work; still in DisplayList
TweenLite.to(sndText, .5, {alpha:0});
TweenLite.to(musicText, .5, {alpha:0});
TweenLite.to(sndSlider, .5, {alpha:0});
[code]....
This object is blitted to the canvas by a renderer via the copyPixels method. The object is NOT a display object. It's a Score-object (self made). The Score-object extends an object called BasicBlitArrayObject. The BasicBlitArrayObject extends an EventDispatcher (therefore no display object).I tried to apply several different TweenLite-plugins to my tempScore-object (i.e. TransformAroundCenter, colorMatrixFilter, etc.). But nothing happens. Absolutely nothing.Sometimes I get error messages (when a plugin requires a display object and my object is NOT a display object). So far so good.
According to Greensock (maker of Tweenlite) his engine can tween ANY numeric property of ANY object. So when a plugin like TransformAroundCenter requires a display object for tweening I have to modify the plugin to get it working for my non-display object (tempScore). Currently I can't do that because it's way too hard for m
Its pretty simple what im trying to achieve.I have a MC on Stage, which im trying to tween to different X coordinates.I've set up four TweenLite.to sequences, however for some weird reason only one is being triggered - what am I doing wrong?
TweenLite.to(slider.mc_slider,1,{x:_returnXPos(95), ease:menuEasing});
TweenLite.to(slider.mc_slider,1,{delay: 1, x:_returnXPos(35), ease:menuEasing});
TweenLite.to(slider.mc_slider,1,{delay: 2, x:_returnXPos(50), ease:menuEasing});
[code].....
I'm trying to update a dynamic text field based on the scaleY value of a mask that I'm tweening using TweenLite. Example: as the mask scales from 1 to 0, the date in my text field would change from 1970 to 1980. But it doesn't want to broadcast that scaleY property during the tween.
View 1 RepliesHow can I use TweenLite to implement effect of Flex's PopUpManager?
View 1 RepliesI've become a fan of TweenLite lately and do most of my development in Flex Builder 3. It's always annoyed me that the TweenLite.to() method doesn't show in code hinting and can't be immediately jumped to. The word "to" highlights as if it were a reserved keyword but I can't figure out what it's used for. This doesn't prevent my applications from running but just confuses and annoys me. Can anyone explain this to me?
View 1 RepliesI need to "tween" an object like in tweenlite, just x/y values, but have ran into a large issue.
[Code]....
it's kind of accurate at high 'refresh times', but low ones, or long tweens it's very inaccurate. Basically, it needs to move 300pixels/1000ms, I chose to move it every 10ms, the amount I move it is 3000/1000(ms/pixels)*ms=3pixels every 10ms, so we should get to 300pixels moved over in 1000ms. But it doesn't work- the time intervals aren't consistant, sometimes it moves it after 10ms, sometimes it doesn't catch it to move again for 30ms! Tweenlite is able to bypass it's loop being able to run every 10ms, but how?
How can I use Tweenlite effect to be invoked in the showEffect/hideEffect of a Canvas?
View 1 RepliesI have created an enemy object from document class. if my enemy score becomes zero, the enemy must get removed.Is there any way to remove that object by destroy the object from document class?.
View 2 RepliesI'm getting this error in the following script:
Code:
package com.main.classes
{
import flash.display.MovieClip;
import flash.display.SimpleButton;
[Code]....
I've highlighted where the problem is occurring. Now, I think what I'm trying to do is remove an object from within another object. I think the object I'm trying to remove is actually on the root.
I've built my game so that everytime a new level begins, a "Session" object is created. This Session class then creates everything for the level.
In theory, once the level is over I can just create a new Session object to build a new level, this works perfectly.
However, I'm having some issues removing everything associated with the old level. I've removed the "map" child which stores all visual elements, I've also set the session object variable to null before creating a new one.
This all works fine, but it doesn't remove everything, for example there are still EventListeners running in the old Session objects which are causing me a lot of complications. Do I actually have to remove every single event listener associated with the object and all other objects it creates?
I have a simple crosshair that drops blue balls when the mouse is clicked. I want those balls to be removed once they fall of the screen (as I'm under the impression that if I don't manually remove them, they'll stay in the system and hog resources - maybe I'm wrong).
ActionScript Code:
addEventListener (Event.ENTER_FRAME,mousecursor);
import flash.ui.Mouse;
Mouse.hide();
[code]...
However, the various attempts I've made to insert a removeChild function in there to get rid of newBall when it leaves the screen have all failed miserably, and the error codes give me little clue where I've gone wrong (removeChild is not a function or other vauge errors).
I have a brick class where I have created a rectangle using flash.display.graphics.I am using this brick class to create a grid of 10 X 10 in another class called grid using new brick() in a for loop.I have another class called ball where I have created a circle with flash.display.graphics.The problem is that I want to remove / destroy individual bricks when the ball hits the bricks on Event.ENTER_FRAME which is not happening.the error I get is shown only for the last brick that is created in a for loop.ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display:isplayObjectContainer/removeChild()
at grid/ball_movement()// my function in enter frame event
The code I wrote in ENTER_FRAME is
[code].....
I have a brick class where I have created a rectangle using flash.display.graphics.I am using this brick class to create a grid of 10 X 10 in another class called grid using new brick() in a for loop.I have another class called ball where I have created a circle with flash.display.graphics.The problem is that I want to remove / destroy individual bricks when the ball hits the bricks on Event.ENTER_FRAME which is not happening.the error I get is shown only for the last brick that is created in a for loop.[code]
View 1 RepliesI have made an xml object and add few children to it. I use appendChild() to add a child to the XML. But if i want to remove one, what should i do? I tried to search in the reference but I cant find a remove function.
View 7 RepliesI went a little overboard with an object on one of my layers, and converted it four times. It now has five "levels" (What is the term for the levelling described in a flash object that is described below?)--but here is how it is structured:
[Code]...
I am trying to remove an object from an array. but from some reason its not working. I am under the impression that a splice accepts 2 parameters. the position of the array. and for parameter 2 , how many to delete from then on out.I just want to delete one array so I am doing this array. splice (i,0);but it isn't working. can someone tell me what i am doing wrong. enlighten me on how it suppose to work.
View 3 Repliesi'm using as2. How do i delete these snowfalkes on a certain frame? i'm creating the snowlfakes using an array on frame 40. I want to get rid of the frames around 60.
[Code]...
How to remove my video player (SWF) at the end of the animation. Is it possible in JS ?
View 1 Repliesremoving object instance from memory.I have created a class that move objects(movie clip) on stage. and on fram 1 i created 100 instances of this class using loop. now when user click on movie clip it should be remove from stage as well as from memory. using removeChild() it is removed from stage but it is not removed from memory. for testing i use initialy only one instance to check my code and when click it is removed from stage but not from memory. here is the code
// this code is on frame 1
function move()
{
[code]...
i used delete and assigning null and GC but nothing works. any one who knows how to remove the object instance from memory I applied every thing but object instance is still in memory (because there is a trace in fall class which continuously running and i guess the object still exist in memory)
I am running a hittest to see if my avatar hits a food movie clip. When it does I want to remove the child that has been hit. I have put all the food movieclips into an array called prey.
Currently what I have when my avatar hits a food it removes the whole array but I only want the food movie clip which has been hit to be removed.
[Code]....
I have a web site that creates a page by calling another class object. When I return from that page to the Main page I want the old page removed. I have done it like this but I am getting errors.
Two vars in GlobalVarsContainer:
public static var removePages:Boolean;
public static var pageToRemove:Object;
Create new page object:
function onClickBtn1():void {
var servicesHome:ServicesHome=new ServicesHome();
addChild(servicesHome);
}
[Code] .....
This is the error:
ReferenceError: Error #1065: Variable servicesHome is not defined.
So I know it's getting back here with all vars set correctly. I've tried changing the public static var pageToRemove:Object; to a string but that is not right.
I am getting problem of memory of having repeating object. Below is my code.
import flash.system.System;
var counter:Number=0;
var systemMemory:TextField=new TextField();
systemMemory.x=200;
stage.addEventListener(Event.ENTER_FRAME,showNext);
function showNext(event:Event){
[Code] .....
Above code does repeat textField Object continuously. Now I want to destroy previous created textField Object. So that my memory will not be hang. I got some where in the blog that with System.gc() could clear garbage collection. But currently I am not working with system.gc any more I want to clear previous object in programatically way. Is there any way that I could destroy previous created object?
I hate it when I'm converting someone else's AS2 project to AS3, and there's code buried on an onstage instance somewhere, which gives me the warning:"Actions on button or MovieClip instances are not supported in ActionScript 3.0. All scripts on object instances will be ignored."
View 3 RepliesI am embedding swf object into my html document, but its showing border on top and left of swf object, how to remove it? Same result on all browsers. If I increase the dimensions of swf object then border start appearing on all sides. I don't want the border at all.
View 1 RepliesI load into an empty movieclip (via addChild) a library object (a movieclip of class MyObject that extends the MovieClip class). At some point, from the main I remove this custom movieclip from its parent and I set any reference to null to completely destroy it. The question: what if in the custom movieclip class there are eventListeners? Are them deleted when I destroy the object? Should I write a method to remove them before deleting the object?
View 3 Replies