I'm thinking more like this (using your most recent code as a starting
point)...
//create an instance of MovieClipLoader
var myMCL = new MovieClipLoader();
// register this as a listener
myMCL.addListener(this);
// define function to handle onLoadInit event
function onLoadInit( targetMC:MovieClip ):Void
{
subAppear(targetMC, (i+3), 95);
}
function createTreeMenu():Void {
for (i=0; i<mainMenus.length; i++) {
newBut = _root.attachMovie("but", "but"+i, 9999999+i);
newBut._x = 33+(newBut._width+5)*i;
newBut._y = 380;
newBut.txt.text = [i+1];
newBut.link = mainMenus[i].firstChild.firstChild;
subAppearX(imagemp_mc, (i+3), 344);
newBut.onRelease = function() {
// load the clip
myMCL.loadClip( this.link, imagem_mc );
};
}
}
I haven't tested this code but it should get you close to what you're after.
Note that you should use loadMovie OR MovieClipLoader - not both for the
same task.
A.
On 7/20/06, Jose Maria Barros <[EMAIL PROTECTED]> wrote:
Something like this? because it doesnt work...it remains the problem...
//create an instance of MovieClipLoader
var myMCL = new MovieClipLoader();
myMCL.onLoadInit = function (targetMC)
{
subAppear(targetMC, (i+3), 95);
}
function createTreeMenu():Void {
for (i=0; i<mainMenus.length; i++) {
newBut = _root.attachMovie("but", "but"+i, 9999999+i);
newBut._x = 33+(newBut._width+5)*i;
newBut._y = 380;
newBut.txt.text = [i+1];
newBut.link = mainMenus[i].firstChild.firstChild;
subAppearX(imagemp_mc, (i+3), 344);
newBut.onRelease = function() {
loadMovie(this.link, imagem_mc);
myMCL.loadClip(imagem_mc);
};
}
}
sorry for my dullness...maybe with a event listener?hummm
On 7/20/06, Adrian Park <[EMAIL PROTECTED]> wrote:
>
> When 'this.link' loads into imagem_mc, any existing properties and
methods
> of imagem_mc are destroyed because 'this.link' replaces imagem_mc.
>
> Immediately after loading the MovieClip, you call subAppear which
assigns
> the onEnterFrame handler. This handler is destroyed when the MovieClip
> loads
> so you don't see your animation working.
>
> Here are your options:
> 1) use MovieClipLoader and then use the onLoadInit event to evoke
> subAppear
> when the movie has completely loaded or
> 2) nest imagem_mc inside a wrapper MovieClip and assign the onEnterFrame
> handler to that wrapper.
>
> The first option is the better option as it's just neater and also
because
> I
> think it's fair to assume you only want the animation to happen once the
> MovieCLip has loaded anyway.
>
> HTH
> Adrian
>
>
> On 7/20/06, Jose Maria Barros <[EMAIL PROTECTED]> wrote:
> >
> > Hello. Im doing a test loading from xml information to load into one
> movie
> > clip one photo and having a number menu. When i press one of those
> numbers
> > a
> > function subAppear makes the movieclip slide from the top.
> >
> > Wht i dont understand is that he loads the photo, but the function
> doesnt
> > work..i tried to test the function without loading the xml and the
> > function
> > works good..but when i load the xml..it doesnt..any help?
> >
> > Thanks in advance...and here is the code from the function and the
> > function
> > that creates the buttons
> >
> > Jose Maria
> >
> > function subAppear(mc:MovieClip, val:Number, target:Number):Void {
> >
> > mc.onEnterFrame = function() {
> > if (target-this._y<0.2 && this._alpha>99) {
> > this._y = target;
> > delete this.onEnterFrame;
> > }
> > if (this._alpha<101) {
> > this._alpha += val;
> > }
> > if (this._y<target) {
> > this._y -= (this._y-target)/4;
> > }
> > };
> > }
> >
> >
> > function createPhotofolio():Void {
> > for (i=0; i<photoMenu.length; i++) {
> > newBut = _root.attachMovie("but", "but"+i, 9999999+i);
> > newBut._x = 33+(newBut._width+5)*i;
> > newBut._y = 380;
> > newBut.txt.text = [i+1];
> > newBut.link = photoMenu[i].firstChild.firstChild;
> >
> > newBut.onRelease = function() {
> > loadMovie(this.link, imagem_mc);
> > subAppear(imagem_mc, (i+3), 95);
> > };
> >
> > }
> > }
> > _______________________________________________
> > [email protected]
> > To change your subscription options or search the archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training
> > http://www.figleaf.com
> > http://training.figleaf.com
> >
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com