-
Onload Unloadaing moveclip within movieclip.
Ok so i have a movieclip called 'home' which is within the container called 'sections'. On the 'home' movieclip there are buttons which go to other movieclips e.g. 'health' which are within the container 'holder'.
I want it so that when the 'health' button is clicked it unloads the home movieclip within the 'sections' container and open that movieclip.
I have tried:
PHP Code:
on (release) {
if (_root.sections.home) {
_root.sections.home.removeMovieClip();
}
}
And this does not work.
I'm using: to go to the 'health' movieclip
PHP Code:
on(release){
_root.holder.attachMovie("health","health",1000)
}
I'm thinking the problem is because im trying to unload the movieclip in which the button is in.
-
-
-
if you have _root.holder.attachMovie() then use _root.holder.removeMovieClip()
If you want to remove another mc that was not created dynamically (like attachMovie does) you'll need to swap its depth, thus rendering it dynamic, before you attempt to remove it.
gparis
-
I'm confused what do you mean by depth? I've only just learnt how to use flash within a week or so and created that so i'm very new to this.
I tried the _root.holder.removeMovieClip() and that didn't work ;S
-
Since you're just starting with actionscript, you should carefully read the documentation on both methods:
removeMovieClip()
swapDepths()
There are code samples that you can try yourself to understand better how they work.
gparis
-
-
I have another question though, at the moment my home movieclip is below the other movieclip. Wouldn't that depth thing just be the same thing? I don't want this happening as the video will still play and also the buttons can still be pressed from the other movieclip
-
-
Still unsolved i can't get my head around it..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|