A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: loadMovie kills method?

  1. #1
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003

    loadMovie kills method?

    Code:
    _root.createEmptyMovieClip("newMc", 1);
    _root.newMc.loadMovie("01.swf");
    //_root.newMc.attachMovie("mc", "mc", 1);
    _root.newMc.onEnterFrame = function() {
    	trace(getTimer());
    };
    After loading an external swf into the instance newMc, the method onEnterFrame, apllied to the very same instance, isn't called anymore.
    Why does this happen?
    But instead of loading, if I attach it from the library, there is no problem...

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    When you load "into" a mc, the loaded clip "replaces" the container clip. That could be the cause. that enterFrame could be triggered by an on(data) . In other terms come after loading is complete.
    gparis

  3. #3
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    lol I hit reply and I see gparis's post with almost the EXACT wording I was going to use



  4. #4
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    Code:
    _root.newMc.onData = function() {
    	trace("onData called");
    };
    the problem is that this doesn't work... for the same reason...
    Last edited by nunomira; 12-04-2002 at 07:40 PM.

  5. #5
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    And enven after I'm sure that the movie has loaded, and by clicking a button, I can't attach any method to the instace newMc, although it exists, acording to the trace action...
    Code:
    on (release) {
    	_root.newMc.onPress = function() {
    		startDrag(this);
    	};
    	trace(_root.newMc);
    }
    how to explain this?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center