Log in

View Full Version : Action Script problem



jamie_di
05-01-2008, 10:40 AM
Hello,

I'm having some major problems with a flash movie with external .swf's I've been making. Came on here hoping that a genius may be able to help me resolve my problem. :p

Ok.. the problem is, I have an opener page in the movie with a small menu on the left which loads the other swf's into my holder, this works all good! This is where my problem occurs, within the other swf's are more buttons which load, and because I am using:
this.onRelease = function(){
_root.gotoAndPlay(31);
}

The problem with using the "_root" command is that it jumps upto the main swf (the one the movie is loaded into) when I dont want it to :(. I need it to use a similar command to "_root" but only to the movie which has been loaded... If that makes sense.

At the moment it loads the swf, but as I click the newly loaded links, it uses _root and jumps to frame 31 of the main document, when i need it to go to frame 31 of the external swf.

Hopefully someone can help me come up with a solution to this.

Many thanks in advance.

jamie_di
05-01-2008, 11:37 AM
Not to worry, I've found a solution.. it seems that you can use _parent more than once, wish I knew that. So i've just used parent the amount of times it was nested and it worked fine.

Medyman
05-01-2008, 12:19 PM
As a general rule, you never want to use _root. It causes the exact problems that you're experiencing.

this._parent._parent._parent is a much better technique.

Glad you got it working :D

jamie_di
05-01-2008, 12:22 PM
I will do from now on, thanks for your reply :)