Yes, but my example was meant to be different to demonstrate there is
probably a reason for allowing different clips to be assigned to a
variable.
My argument was, the original post may have been moot / redundant /
not-so-surprising if you think a little about how Flash works. Once the
varia
So, the case he brought up was different from what you said.
In your case you're creating differently named movie clips, and
explicitly assigning them to the mc variable.
In the original code, a new movie clip was attached with the same
name, but NOT assigned to the variable. After doing so you
Sorry if I am speaking out of turn, but isn't this point a bit moot
(redundant)?
How else would you expect to be able to attach movieclips and manipulate
them in a loop as you would normally?
e.g.
function doClips() {
var mc:MovieClip;
for(var i = 0;i < 10;i++) {
mc = attachMovi
So you're saying variables like mc are effectively pointers?
Well crap. I thought I didn't have to worry about pointers when I
wasn't working in C... :)
(I say after just debugging some really weird memory issue in C++ code...)
-Andy
On Mon, Mar 10, 2008 at 4:08 AM, strk <[EMAIL PROTECTED]>
On Sun, Mar 09, 2008 at 06:50:58PM +0300, Pavel Empty wrote:
> //Create a clip from the library and store its reference to "mc" variable.
> var mc:MovieClip = _root.attachMovie("Star", "star_mc",
> _root.getNextHighestDepth());
'mc' is a "soft reference" to the Star instance.
> //Destroy the cli
You are right about the "_root.star_mc" thing. I think it's more like
_root["star_mc"]. If you add your 2nd movie clip but not naming it as
"star_mc" I'm sure " mc._x = 100" will not work.
On Mon, Mar 10, 2008 at 12:39 AM, Keith <[EMAIL PROTECTED]> wrote:
> //--> You only removed the MovieClip.
>
//--> You only removed the MovieClip.
mc.removeMovieClip();
//--> If you use "delete" it will remove the reference to the variable.
delete mc;
I'm glad it works this way, because I can reuse my variables.
When I'm done I can call "delete"
-- Keith H --
Pavel Empty wrote:
Hey!
Recently I wa
Hey!
Recently I was surprised with Flash environment behavior.
Just want to share with you my observations.
Look at this very simple code:
//Create a clip from the library and store its reference to "mc" variable.
var mc:MovieClip = _root.attachMovie("Star", "star_mc",
_root.getNextHighestDepth()
8 matches
Mail list logo