A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: could somebody help with this button problem?

  1. #1
    Senior Member
    Join Date
    Apr 2000
    Posts
    168
    I have a movie loading in on level 14, in that movie is a MC that holds a menu. The menu is suppose to be commanding the _level0 or .root Yet for some reason the main movie is not reacting at all!??!
    here is the script on one of the buttons in the menu MC:

    on (release) {
    unloadMovieNum (2);
    tellTarget ("_root") {
    gotoAndPlay ("STUDENTGALLERY");
    }
    }

    THANKS ALL!!!

  2. #2
    Firmly Fastened to the Milk Sac of Misanthropy
    Join Date
    Aug 2000
    Posts
    463
    Hmm, I'm only decent with dot notation, but here;'s my take on the problem:

    There's some problems in your pathing. When you refer to the root timeline in level 14 movie, you are referring to the root timeline of level 14, not level0.

    That unloadMovieNum - are you attempting to unload the level2 swf?

    I would rescript the button action:
    Code:
    on (release) {
    unloadMovie (2);
    _level0.gotoAndPlay ("STUDENTGALLERY");
    }
    Give it a try and see if it works for you.

    Sem.

  3. #3
    Senior Member
    Join Date
    Sep 2000
    Posts
    910
    Hi Schimke...well you're confusing "_root" with meaning "_level0"...

    "_root" merely refers to the main timeline of the movie you're currently in...the swf on _level14 has a "_root"...

    so to tell the main timeline on _level0 to do something from _level14, you'll have to address _level0 as such...

    on (release) {
    _level0.gotoAndPlay("STUDENTGALLERY");
    }

    Hope this helps...

    -pigghost-

  4. #4
    Similar question from me piggy...how do you target a movie in level one from a moive in level 2? I have a main swf (level 0) which has two movie clips which each contian one external swf each. one is a control bar, the other is the main screen. I want to target the main scren timeline in level one from the control bar in level 2. On button one in the control bar swf I put:
    on (release) {
    _level1.body.gotoAndStop("there");
    }
    where "body" is the instance name on the main time and "there" is the instance name in the mainscreen swf.

    I push the button and nothing happens...what gives?
    Is my path wrong? if so how?

  5. #5
    Senior Member
    Join Date
    Sep 2000
    Posts
    910
    Hi PotusPete...I'm a little confused by your explanation of your set-up (of course, I can get confused pretty easily sometimes )

    Let me see if I can explain how I perceive of your situation...

    You said you loaded two external swf's into two target movieClips on _level0...correct?

    ...then you start talking about levels...this is where I lose you...are you confusing layers of the main timeline with levels??

    So if you have two movieClips(with external swf's loaded into them) and they both are on the main timeline of _level0...then you would target like this...

    ...on your button in Control Bar...and this is assuming you gave the movieClip that you loaded the mainscreen swf in...the instance name "body"

    on (release) {
    _root.body.gotoAndStop("there");
    }

    ...also "there" would have to be a frameLabel on the timeline of the mainscreen swf

    So that's the way I think you have your set-up...if not correct me and I'll try and figure it out from there...

    -pigghost-

  6. #6
    Ok Pigg...thanks for responding!
    you are almost correct.

    The main timeline (level 0) contains two movie clips in frame 6. the mainscreen.swf is loaded into the MC with an instance name of body, the other MC has the controlbar.swf in it and it is named controller. so controller is in level 2 and body is in level 1 ( I know the difference between layers on a timeline and the level to which a clip is loaded into) I load both movies in the beginning of the main timeline in frames 1 and 2 using a command like this:

    loadMovieNum ("mainsource.swf", 1);

    and this

    loadMovieNum ("controlbar.swf", 2);

    they both appear on screen at frame 6 because of this script:

    onClipEvent (data) {
    _root.controller.gotoAndStop(1);
    }

    and this clip

    onClipEvent (data) {
    _root.body.gotoAndstop("homebase");
    }

    so in the controlbar.swf I put a button and a script that says:
    (this is the script that is not working)

    on (release) {
    _level1.body.gotoAndStop("there");
    }



    now what I want to happen here is that when I push this button, that the mainsource.swf residing in level 1 on the main time line to which both swfs are placed, will go to the frame labeled "there". but it does not. nothing happens.
    So the question that i have is what is the proper command and path to activate the timeline in the mainsource movie?

  7. #7
    Senior Member
    Join Date
    Sep 2000
    Posts
    910
    Okay...maybe I'm totally missing something , but you keep saying the two mc's are on _level0...

    Well, with this action...

    loadMovieNum ("mainsource.swf", 1);

    ...and this action...

    loadMovieNum ("controlbar.swf", 2);

    ...you are not loading your swf's into the mc's...you're loading into levels...

    ...so the button in "controlbar" simply needs to say...

    on (release) {
    _level1.gotoAndStop("there");
    }

    Now as far as I know, to use the "onClipEvent(data)" you would have to be loading into those mc's...which doesn't look like you are...

    Maybe I'm being dense, but that's what I get from your explanation...

    Hope this helps...

    -pigghost-






  8. #8

    Smile

    Thanks Pigg,
    It is not you whom is dense, it is I. Though I thought I was loading into the clips I was not, so that caused the path to be wrong, and since you pointed out that I wasn't targeting the movie clips I did some testing, and you were right on the money! thanks for the enlightenment...

    I owe you one!

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