A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Onload Unloadaing moveclip within movieclip.

  1. #1
    Member
    Join Date
    Dec 2009
    Posts
    51

    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.

  2. #2
    Member
    Join Date
    Dec 2009
    Posts
    51

  3. #3
    Member
    Join Date
    Dec 2009
    Posts
    51
    anyone got any ideas?

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    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

  5. #5
    Member
    Join Date
    Dec 2009
    Posts
    51
    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

  6. #6
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    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

  7. #7
    Member
    Join Date
    Dec 2009
    Posts
    51
    Thanks will do!

  8. #8
    Member
    Join Date
    Dec 2009
    Posts
    51
    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

  9. #9
    Member
    Join Date
    Dec 2009
    Posts
    51
    this is still unsolved

  10. #10
    Member
    Join Date
    Dec 2009
    Posts
    51
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center