View Full Version : VISIBILITY Visible = false vs removeMovieClip()
ksfkay
June 26th, 2007, 06:13 AM
Alpha = 0
visible = false
removeMovieClip (only works with attachmovieclip)
am i missing any others ways to turn off, delete, remove, clear movieclips ?
Can anyone recommend the usage value here? I'm trying to be conserve memory used by flash.
dthought
June 26th, 2007, 08:42 AM
If you don't need to reuse things, remove 'em from the display list with removeChild and then set 'em to null. Or delete them. I always get confused with those two.
fw2803
June 26th, 2007, 11:06 AM
Alpha = 0 and visible = false only make the movieclip invisible to human eye. They are still using the resources of your computer. For example, you make a game. An aircraft flies around to shoot down enemy planes. Whenever the aircraft fires missiles, you have to attach movieclips to desired positions. Instead of removing the movieclips when they collides with the enemy, you just make them invisible. Then you'll soon notice that your computer becomes very slow as thousands of missiles are still moving "invisibly".
This can be solved by using removing the attached movieclips. Then the performance of your computer will not be affected.
ksfkay
June 26th, 2007, 03:01 PM
how do you handle the issue that i cannot remove the attached movieclips because they are "placed" on the stage without the attachMovieClip(). The reason for doing this is because their placement (of 40 MCs) is important. Like letters in a headline. To attach and use xy positioning would be tedious to do for each letter.
how best can one handle making objects invisible yet maintain their x/y cordinates as they move around on the screen? Games like warcraft, starcraft and lets say quake have many things going on while not on the screen. Somehow the other players movements are maintained, yet they are invisible on the screen.
senocular
June 26th, 2007, 03:10 PM
read http://www.kirupa.com/developer/actionscript/depths.htm
(Applies to AS1 and AS2)
Be sure to read on to page 2, were the more important information is regarding attach/remove movie clip
ksfkay
June 26th, 2007, 03:36 PM
read http://www.kirupa.com/developer/actionscript/depths.htm
(Applies to AS1 and AS2)
Be sure to read on to page 2, were the more important information is regarding attach/remove movie clip
my fault for not explaining in better detail, but this seems to be a depth related issue. how does this relate to removing movieclips that haven't been attached or duplicated while maintaining their xy positions to be used later. visibile = false and alpha = 0 makes the mcs disappear but use up resources while that are transparent
senocular
June 26th, 2007, 03:44 PM
I guess that tutorial doesn't spell it out as clearly as it could.
To remove an object placed on the screen in Flash, use swapDepths first, then removeMovieClip
ksfkay
June 26th, 2007, 03:53 PM
oh nice, i can't wait to see if that works, thanks
NaughtyPine
June 26th, 2007, 04:51 PM
i'm lazy i use .visible = true or false.
But thats only cause i re-use alot of junk.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.