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]> wrote:
> 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 clip
>  > mc.removeMovieClip();
>
>  'mc' becomes a "dangling" reference, which means it'll be looking
>  for a substitute with same target name when dereferenced.
>
>
>  > //Create another star clip once again with the same name "star_mc"
>  > //Notice that I do not assign the clip reference to "mc" variable.
>  > _root.attachMovie("Star", "star_mc", _root.getNextHighestDepth());
>  >
>  > //And now I move "mc". It references the first clip, which was destroyed.
>  > //I expect nothing to happen, but...
>  > mc._x = 100;
>  >
>  > The second clip moves!
>  > That is, the second clip was referenced using "mc".
>
>  Dereferencing 'mc' here yelds the new Star insatnce, having
>  the same target path as the original one.
>
>  --strk;
>
>
> _______________________________________________
>  Flashcoders mailing list
>  [email protected]
>  http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to