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.
> 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 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());
> >
> > //Destroy the clip
> > mc.removeMovieClip();
> >
> > //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".
> >
> > Do you know why does Flash behave this way?
> >
> > My guess is that Flash keeps an absolute path to the clip inside clip
> > reference.
> > So, in my case, the clip "_root.star_mc" was found and then moved
> > successfully.
> >
> > Pasha
> > _______________________________________________
> > Flashcoders mailing list
> > [email protected]
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> >
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
www.shang-liang.com
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to