Example #1
0
        public void SetMovieEventHandler(string instanceName,
                                         MovieEventHandler load   = null, MovieEventHandler postLoad   = null,
                                         MovieEventHandler unload = null, MovieEventHandler enterFrame = null,
                                         MovieEventHandler update = null, MovieEventHandler render     = null)
        {
            int instId = SearchInstanceId(GetStringId(instanceName));

            if (instId >= 0)
            {
                SetMovieEventHandler(
                    instId, load, postLoad, unload, enterFrame, update, render);
                return;
            }

            if (!instanceName.Contains("."))
            {
                return;
            }

            if (m_movieEventHandlersByFullName == null)
            {
                m_movieEventHandlersByFullName = new MovieEventHandlersDictionary();
            }

            if (load != null || postLoad != null || unload != null ||
                enterFrame != null || update != null || render != null)
            {
                m_movieEventHandlersByFullName[instanceName] =
                    new MovieEventHandlers(
                        load, postLoad, unload, enterFrame, update, render);
            }
            else
            {
                m_movieEventHandlersByFullName.Remove(instanceName);
            }
        }