A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: Calling frames inside another MC

  1. #1
    Junior Member
    Join Date
    May 2004
    Posts
    14

    Calling frames inside another MC

    Hi, i've got a problem... I have a few buttons inside this movie clip named "container"... however, I want the buttons inside that MC to load a specific frame in another MC. So for instance, I click on a button that's in the "container" MC, and once I release the mouse button, a car appears passing by the screen. then when i click another button in that container mc, the car unloads and a truck appears passing by the screen, and so on...

    Thanks :P

  2. #2
    African Savage
    Join Date
    Nov 2001
    Posts
    76
    You need a little actionscript to do what you seek.

    If you button is on the main time line you can simply but this into the code

    on(release)
    {
    myMC.gotoAndPlay(desiredFrame);
    }

    However if your button is inside another movie clip you would simply change

    myMC.gotoAndPlay(desiredFrame); to

    _root.myMC.gotoAndPlay(desiredFrame)

    myMC would be the instance name of the MC you wish to control

  3. #3
    Junior Member
    Join Date
    May 2004
    Posts
    14
    Thanks for the prompt response
    its a little complicated... the "container" mc is located inside another mc that's named "news" and that "news mc" is located in the main timeline... so what I got from you would be:

    on(release)
    {
    _root.news.container.gotoAndPlay(desiredFrame)

  4. #4
    Junior Member
    Join Date
    May 2004
    Posts
    14
    I tried the code but had no luck...

    Here's what im trying to do...

    I've got an mc called "news" on my main timeline... then i've got an mc called "container" inside that news timeline. the buttons are located in:

    root/news/container/content

    what i'm trying to do is once i press on a button in that "content" mc, that will make a certain frame to load up in another movie located at:

    root/news/container/hexport

    now... i tried using the following code:
    Code:
    on(release)
    {
    _root.News.container.hexport.gotoAndPlay(2)
    }
    thanks!

  5. #5
    African Savage
    Join Date
    Nov 2001
    Posts
    76
    From the position of each of these MC, acording to what you described you would only need to put in the "concent" MC

    _parent.hexport.gotoAndPlay(2);

    Since both hexport and content are both in the container MC you don't need to go any higher than that.

  6. #6
    Junior Member
    Join Date
    May 2004
    Posts
    14
    hmmm... apparently it doesnt work... it just doesn't load up the frame.

    I tried the following code on the button inside the "container" mc:

    Code:
    on(release)
    {
    _parent.hexport.gotoAndPlay(2);
    }
    nothing happened..
    here's the tricky part though, i want a frame inside an mc to load in that same mc by clicking on a button located outside that mc. this is confusing me so much :P

  7. #7
    African Savage
    Join Date
    Nov 2001
    Posts
    76
    can you post your fla?
    If you're going to shoot...shoot. Don't talk!
    - The Good, The Bad and The Ugly

  8. #8
    Junior Member
    Join Date
    May 2004
    Posts
    14
    the problem is that everything is already set up and im tweaking the site. if i post the fla file, all of my work will be exposed for free download

    what i could do though is post a .swf file to what ive come up with...

  9. #9
    sockpuppet
    Join Date
    Mar 2005
    Posts
    323
    You could mail it to him or me, zipped up and in a MX only not MX2004.
    I PM you an address if you want.

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