all groups > flash actionscript > september 2007 >
You're in the

flash actionscript

group:

Instance names and loadClip


Instance names and loadClip elwood37
9/2/2007 11:58:21 PM
flash actionscript:
I am trying to load a swf containing a draggable border movie clip using
MovieClipLoader.loadClip(). I have a mc on the stage called "application" with
an empty mc inside called "appContainer2". The swf is loaded using the code:

var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();

myMCL.addListener(myListener);

myMCL.loadClip("coachapp.swf", "application.appContainer2");

The draggable border has an instance name of "dragBar" in the coachapp.swf,
but the code:

this.application.dragBar.onPress = function():Void{
application.startDrag();
}

is not working. Do instance names not carry over when using loadClip, or is
there something else I am missing?

var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();

myMCL.addListener(myListener);

myMCL.loadClip("coachapp.swf", "application.appContainer2");
Re: Instance names and loadClip kglad
9/3/2007 5:22:06 AM
your path to dragBar is incorrect, no matter where that code is located.

if dragBar is on the main timeline in coachapp.swf, you should be use the
following path from the timeline that contains application in your main swf:



application.appContainer2.dragBar
AddThis Social Bookmark Button