dcsimg
A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: [RESOLVED] Target _level and label not working !!!!!!!!!

  1. #1
    Lost in ActionScript
    Join Date
    Feb 2002
    Location
    California
    Posts
    27

    [RESOLVED] Target _level and label not working !!!!!!!!!

    Please Help, I think I've tried everything I know and read on this site regarding the following.

    I have the following code on ALL my buttons

    on (release) {
    gotoAndStop ("label name");
    loadMovieNum ("movie name", _level #);

    }

    All my Buttons (18 of them) reside in a SWF, "buttons.swf", that's called into the Main Movie at start up via loadMovieNum (_level #)

    I have several other SWF's that load the same way, called into the Main Movie at start up, each into thier own _level #. (the loadMovieNum at start up works fine that's not the problem, please read on)

    Another of these SWF's that loads at start up is "home.swf". In this SWF I have a Movie Clip, and in this Movie Clip I have a button that targets a _level and a Lable that resides in the Main Movie

    (THIS IS THE PROBLEM)

    I can target the _level, no problem, but I CAN"T get the playhead to gotoAndStop (label name)


    Can I get some help on this, is my code wrong?


    Peace
    Jose Antonio

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    Hi,

    I've created a simple example, and it works as expected.
    External movie is loaded.
    You click a button in the main movie, and the external movie loaded at level 1 plays.

    Just make sure that the external movie has finished loading. At least the frame you're trying to send the playhead to should be loaded/available already.
    You can't load and try to control the external movie at the same time, as it takes some time to load.
    Load it (preload it), and then you can control it.
    Attached Files Attached Files
    Last edited by nunomira; 04-28-2006 at 07:24 PM.

  3. #3
    Lost in ActionScript
    Join Date
    Feb 2002
    Location
    California
    Posts
    27
    Thank you for the quick reply.

    However I think I owe you an opology, I'm using FLASH MX, and I couldn't open the file you sent me, could you PLEASE resend in MX format?


    THANK YOU !!!!!!

    Peace
    Jose Antonio

  4. #4
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    here it is for MX
    Attached Files Attached Files

  5. #5
    Lost in ActionScript
    Join Date
    Feb 2002
    Location
    California
    Posts
    27
    nunomira,

    Thank You so much. I see what you did, but I think my problem is a little different.

    I'm targeting the _levels of the Main/_root movie, while at the same time targeting the labels in the "buttons.swf" (this is where all my buttons and the labels reside), and I'm trying to do this from a MC that's inside another swf on a _level in my Main/_root movie.

    I hope this makes sense, if not I can attach an example ZIP file.


    Peace
    Jose Antonio

  6. #6
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    That's pretty confusing.

    The main movie is _level0.
    If you use loadMovieNum() to load external movies, you load them into other levels: _level1, _level2, ....

    And you can control something on that movie / level by using _levelN (_level1, _level2, ...).

    If you want to control the main movie from another level, you use _level0.

    I suggest you take a look at understanding target paths and loading movies for more details.

    If you want, please upload a simple and clear example of your problem.

  7. #7
    Lost in ActionScript
    Join Date
    Feb 2002
    Location
    California
    Posts
    27
    Nunomira,

    Thank You again, and here is the zip file with an example of what I mean.

    I hope this helps you help me.


    Peace
    Jose Antonio
    Attached Files Attached Files

  8. #8
    Advance Motion Management
    Join Date
    Mar 2006
    Location
    India
    Posts
    84
    Hey JAntonio,
    Very Basics,
    *Main movie on _level0;
    **Buttons loaded on _level1;
    ***Movies Loaded from _level2 onwards;
    Here 3 movies are different SWF but they use the levels on the main Base Movie.

    So, If you load any movie through the click of a button make sure it starts from _level2, next movie on _level3, and so on.

    Now, if on a button you have an action:
    on (release) {
    gotoAndStop ("label name");
    loadMovieNum ("aboutus.swf", _level2);
    }
    unloadMovie(_level3); //contact.swf
    unloadMovie(_level4);// solution.swf
    unloadMovie(_level5);// whatever.swf

    // make sure when you are loading one movie on a paticular level, The other levels must be unloaded
    Last edited by vinitt jaiswal; 04-29-2006 at 10:49 PM.


    --
    Vini
    Its in my Blood, B+



  9. #9
    Lost in ActionScript
    Join Date
    Feb 2002
    Location
    California
    Posts
    27
    Vinitt,

    Thanks for the info, but that's not my problem.

    I have the Main Movie "Whatever.swf" this I know to be my Main/_root movie.

    on Layer one / Frame one of this Main movie I have:

    loadMovieNum ("buttons.swf", _level5);

    My "buttons.swf" has, say 5 buttons, and they all have a label to go to.

    Each one of my buttons has the followiing code

    on (release)
    gotoAndStop(label 1 ro 2 or 3 or 4 or 5 - a different # for each button)
    loadMovieNum ("whatever.swf", _level10):

    Since they ALL load into the same _level10 that takes care of the unloadMovie(_level??) part since no two movies can reside in the same _level.

    So far all of this works when I do it. I get this part it's the following that I'm not getting or not able to make work.

    Inside one of the SWF's I just loaded into _level10 I have a Movie Clip in which I have a button with the following code

    on (release)
    gotoAndStop(at whatever label I want that's in my "buttons.swf" movie) and
    loadMovieNum ("whateverTwo.swf", _level10);

    The _level10 part works, the SWF I wanted to load, loads, cause it's just a _level and Flash doesn't care what SWF you're in, it only knows to occupy _level10.

    The label part is where the Player is not cooperating with me on. I can't seem to get it to gotoAnd do anything with the label part of the code.


    Peace
    Jose Antonio

  10. #10
    Advance Motion Management
    Join Date
    Mar 2006
    Location
    India
    Posts
    84
    Where you wants to go with this button on the external movie time line or on the main time line where this external movie is loaded.
    And from the external movie button if you want to control the main movie time line(i.e.lable) Code it:

    on (release)
    _level0.gotoAndPlay(label)

    //if this dosen't work put and _root at the begining

    I hope this solves your query.
    Cheers


    --
    Vini
    Its in my Blood, B+



  11. #11
    Lost in ActionScript
    Join Date
    Feb 2002
    Location
    California
    Posts
    27
    Vinitt,

    Thanks but no, it did not work.

    I tried

    _root_level0.gotoAndStop("label name")
    _level0_root.gotoAndStop("label name")

    I even tried the two without the quotation marks around my label name, just in case, but no, nothing.

    The swf loads, no problem, but the playhead does not go to the label frame.

    What have I started?????


    Peace
    Jose Antonio

  12. #12
    Lost in ActionScript
    Join Date
    Feb 2002
    Location
    California
    Posts
    27
    Nunomira & Vinitt,

    Thanks for the help. I figured out what my problem was, I was so into targeting the _root movie that I fail to see that my "buttons.swf" movie was loading onto _level5 of my Main / _root movie which should have been the _level I should have been targeting for the labels.

    Thanks again and sorry for my error in over sight

    Peace
    Jose Antonio

  13. #13
    Advance Motion Management
    Join Date
    Mar 2006
    Location
    India
    Posts
    84
    Anytime Dude, I hope things worked fine for you

    Cheers...!!!


    --
    Vini
    Its in my Blood, B+



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